solenv/gbuild/platform/linux.mk |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit baddc742c3fe260d20d7924ab134f0fbf179fd85
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Mon Dec 12 11:04:44 2022 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Mon Dec 12 12:28:32 2022 +0000

    lld 16 trunk defaults to --no-undefined-version now
    
    ...since
    
<https://github.com/llvm/llvm-project/commit/241dbd310599e3c1a0f1b0c9ced14c8b8760539e>
    "[ELF] Enable --no-undefined-version by default", causing e.g.
    
    > ld.lld: error: version script assignment of 'PRIVATE_1.4' to symbol 
'_ZN3sal13backtrace_getEm' failed: symbol not defined
    > ld.lld: error: version script assignment of 'GLIBCXX_3.4' to symbol 
'_ZNSs4_Rep20_S_empty_rep_storageE' failed: symbol not defined
    
    while building Library_sal and
    
    > ld.lld: error: version script assignment of 'LIBXML2_2.4.30' to symbol 
'xmlXPtrBuildNodeList' failed: symbol not defined
    > ld.lld: error: version script assignment of 'LIBXML2_2.4.30' to symbol 
'xmlXPtrEvalRangePredicate' failed: symbol not defined
    > ld.lld: error: version script assignment of 'LIBXML2_2.4.30' to symbol 
'xmlXPtrFreeLocationSet' failed: symbol not defined
    [...]
    
    while building ExternalProject_libxml2 (and the latter is the reason to add 
to
    USE_LD rather than gb_LinkTarget_LDFLAGS, so that this also goes into
    gb_ExternalProject_get_link_flags).
    
    This is only relevant for ELF targets, so at least for now add it to 
linux.mk
    rather than the general com_GCC_defs.mk.
    
    Change-Id: I2ea227bd9392c406e6c41de61df37ad7fe155c07
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143981
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/solenv/gbuild/platform/linux.mk b/solenv/gbuild/platform/linux.mk
index 8fc7d38e3f23..127a5f7b372c 100644
--- a/solenv/gbuild/platform/linux.mk
+++ b/solenv/gbuild/platform/linux.mk
@@ -15,6 +15,10 @@ endif
 endif
 gb_LinkTarget_LDFLAGS += $(gb__LinkTarget_LDFLAGS_zdefs)
 
+ifneq ($(findstring lld,$(USE_LD)),)
+USE_LD += -Wl,--undefined-version
+endif
+
 include $(GBUILDDIR)/platform/unxgcc.mk
 
 ifneq ($(ATOMIC_LIB),)

Reply via email to