Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 923334 - net-nds/openldap-2.6.6 fails to compile: ld.lld: error: version script assignment of OPENLDAP_2.200 to symbol ber_sockbuf_io_udp failed: symbol not defined
Summary: net-nds/openldap-2.6.6 fails to compile: ld.lld: error: version script assign...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo LDAP project
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2024-01-30 11:55 UTC by Agostino Sarubbo
Modified: 2024-12-28 18:03 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,128.88 KB, text/plain)
2024-01-30 11:55 UTC, Agostino Sarubbo
Details
build.log (2.6.8) (openldap-2.6.8-build.log,48.06 KB, text/plain)
2024-08-27 08:44 UTC, Petr Šabata
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2024-01-30 11:55:55 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: net-nds/openldap-2.6.6 fails to compile.
Discovered on: amd64 (internal ref: python-3.12_tinderbox)
System: CLANG-LLD (https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#CLANG-LLD)

Info about the issue:
https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#CF0014
Comment 1 Agostino Sarubbo gentoo-dev 2024-01-30 11:55:57 UTC
Created attachment 883719 [details]
build.log

build log and emerge --info
Comment 2 NHO 2024-04-28 19:35:31 UTC
upstream bug: https://bugs.openldap.org/show_bug.cgi?id=9982
Comment 3 NHO 2024-04-29 05:03:04 UTC
That was wrong upstream bug, sorry. Relevant code from that bug is in.

https://bugs.openldap.org/show_bug.cgi?id=9739
Comment 4 Mosaic J 2024-07-17 16:59:20 UTC
Hi, has this been resolved or have you found a way to work around? I have just encountered the same issue and don't know what's to do now. Would you like to kindly share if you made progress?
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2024-08-25 20:05:05 UTC
1. I cannot reproduce this.
2. Please retest with 2.6.8
3. Those upstream bugs are NOT the correct bugs; those deal w/ the LDAP_CONNECTIONLESS code, that is NOT enabled in ago's build.
Comment 6 Petr Šabata 2024-08-27 08:43:53 UTC
(In reply to Robin Johnson from comment #5)
> 1. I cannot reproduce this.
> 2. Please retest with 2.6.8

Odd, as I can reproduce this right away with the following:

=net-nds/openldap-2.6.8
+ llvm/clang/lld 18.1.8

I'll attach the build.log but it's effectively still the same as the original one.

(In reply to Mosaic J from comment #4)
> Hi, has this been resolved or have you found a way to work around? I have
> just encountered the same issue and don't know what's to do now. Would you
> like to kindly share if you made progress?

This is a common issue starting with llvm 17; as a workaround you can add "-Wl,--undefined-version" to your LDFLAGS.
Comment 7 Petr Šabata 2024-08-27 08:44:47 UTC
Created attachment 901297 [details]
build.log (2.6.8)
Comment 8 Petr Šabata 2024-09-21 11:08:36 UTC
Just for the record, still reproducible with LLVM 19.1.
Comment 9 NHO 2024-11-17 17:04:36 UTC
Upstream bug:
https://bugs.openldap.org/show_bug.cgi?id=9739

But we don't set up experimental and stateless?
Comment 10 Larry the Git Cow gentoo-dev 2024-12-28 18:03:09 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=74f7ab1af81e3ce05117cd8b801d68c2bac10357

commit 74f7ab1af81e3ce05117cd8b801d68c2bac10357
Author:     Z. Liu <zhixu.liu@gmail.com>
AuthorDate: 2024-12-26 08:21:25 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-12-28 18:02:24 +0000

    net-nds/openldap: fix build issue with llvm profile and a test failure
    
    1. building with llvm profile causes many error messagees like the
       one bellow:
    
         ld.lld: error: version script assignment of OPENLDAP_2.200 to symbol ... failed: symbol not defined
    
       This is caused by lld enable option "--no-undefined-version" by default
       (see 'https://reviews.llvm.org/D135402'). OpenLDAP define all dynamic
       symbols in libraries/{liblber/lber,libldap/ldap}.map, but some symbols
       are only available when specific configuration option are enabled. We've
       identified the options like HAVE_TLS, HAVE_CYRUS_SASL and LDAP_CONNECTIONLESS
       will cause build failures.
       There are two workarounds:
         1. Remove the symbol from .map file if the corresponding configuration
            option is not set.
         2. Add the linker option "-Wl,--undefined-version" to restore the default
            behavior that undefined symbols in shared libraries are allowed.
    
       Option 1 requires identifying all symbols controlled by different options,
       and using sed to remove them based on the configuration. Option 2 is much
       simpler and has no known side effects. We choose option 2.
    
    2. In patch 'openldap-2.6.1-fix-missing-mapping.patch', 'ber_sockbuf_io_udp'
       was added to lber.map, but it's not completed. This symbol is part an
       unsupported feature (cldap or ldap over udp) and is only built when the
       unsupported LDAP_CONNECTIONLESS flag is defined. All the user of
       'ber_sockbuf_io_udp' are enclosed by #ifdef guards, it make no sense to not
       enclose it by #ifdef too. Another patch for ldap.map form Fedora is included
       too. Patch is updated to v2.
    
    3. USE="debug" is required for USE="test", otherwise "test065-proxyauthz"
       will failed:
         must compile with LDAP_DEBUG for debugging
         unrecognized log level "pcache" (deferred)
    
    Upstream Issue: https://bugs.openldap.org/show_bug.cgi?id=9739
    FreeBSD Bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277585
    
    Closes: https://bugs.gentoo.org/923334
    Closes: https://bugs.gentoo.org/938553
    Closes: https://bugs.gentoo.org/946816
    Closes: https://bugs.gentoo.org/946975
    Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/39844
    Signed-off-by: Sam James <sam@gentoo.org>

 .../openldap-2.6.1-fix-missing-mapping.v2.patch    |  53 ++
 net-nds/openldap/openldap-2.6.4-r4.ebuild          | 870 ++++++++++++++++++++
 net-nds/openldap/openldap-2.6.6-r2.ebuild          |   2 +-
 net-nds/openldap/openldap-2.6.6-r3.ebuild          | 877 ++++++++++++++++++++
 net-nds/openldap/openldap-2.6.8-r1.ebuild          | 898 +++++++++++++++++++++
 5 files changed, 2699 insertions(+), 1 deletion(-)