[libxml2] python/Makefile.am: use *_LIBADD, not *_LDFLAGS for LIBS



commit a0f9211b5201f69844154ae80cf25115c3c19610
Author: Sam James <sam gentoo org>
Date:   Mon Jun 28 02:03:15 2021 +0100

    python/Makefile.am: use *_LIBADD, not *_LDFLAGS for LIBS
    
    This fixes over-linking in the built Python modules with various libraries.
    
    *_LIBADD is intended for adding additional libraries for linking, while
    *_LDFLAGS is for miscellaneous extra flags (possibly user-supplied).
    
    If using -Wl,-as-needed within user-supplied LDFLAGS, it is passed too
    late (after the library link line) and therefore has no effect.
    
    Notes:
    
    * Noticed while working on Gentoo's migration to libxcrypt because
    libxml2's Python modules were linking to libcrypt (and other libraries)
    unexpectedly.
    
    * It was suggested we could actually stop linking explicitly with all
    of Python's libraries / don't copy its LDFLAGS, but this resolves
    the original issue downstream and is a separate discussion. I couldn't
    find any clear documentation for/against such a change.
    
    Bug: https://bugs.gentoo.org/798942
    Signed-off-by: Sam James <sam gentoo org>

 python/Makefile.am | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/python/Makefile.am b/python/Makefile.am
index 34aed96c..726e6936 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -25,7 +25,8 @@ python_LTLIBRARIES = libxml2mod.la
 
 libxml2mod_la_SOURCES = libxml.c libxml_wrap.h libxml2-py.h libxml2-py.c types.c
 libxml2mod_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) -module -avoid-version \
-        $(top_builddir)/libxml2.la $(CYGWIN_EXTRA_PYTHON_LIBADD) $(WIN32_EXTRA_PYTHON_LIBADD) $(PYTHON_LIBS)
+        $(top_builddir)/libxml2.la
+libxml2mod_la_LIBADD = $(CYGWIN_EXTRA_PYTHON_LIBADD) $(WIN32_EXTRA_PYTHON_LIBADD) $(PYTHON_LIBS)
 
 BUILT_SOURCES = libxml2-export.c libxml2-py.h libxml2-py.c
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]