https://bugs.openldap.org/show_bug.cgi?id=9213
Bug ID: 9213 Summary: undefined reference in back_ldap when --enable-ldap=mod and --disable-dynamic Product: OpenLDAP Version: 2.4.49 Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: --- Component: build Assignee: bugs@openldap.org Reporter: ryan@openldap.org Target Milestone: ---
./configure --enable-modules --enable-ldap=mod
doesn't link back_ldap with libldap (--enable-dynamic is disabled per default). The resulting binary doesn't work; slapd has libldap statically linked, but doesn't include all the symbols back_ldap uses: specifically ldap_modify_ext.
slaptest passes, but back_ldap fails at runtime (test022 fails). Not sure if other modules would have the same problem.
https://bugs.openldap.org/show_bug.cgi?id=9213
--- Comment #1 from Ryan Tandy ryan@openldap.org --- LD_BIND_NOW=1 makes it fail at load time, so we can use slaptest to check the modules.
for mod in servers/slapd/back-*/*.la servers/slapd/overlays/*.la; do echo "moduleload $mod" > slaptest.conf if ! LD_BIND_NOW=1 ./servers/slapd/slaptest -f slaptest.conf >/dev/null 2>&1; then LD_BIND_NOW=1 LD_DEBUG=symbols ./servers/slapd/slaptest -f slaptest.conf 2>&1 | grep undefined fi done
11846: servers/slapd/back-asyncmeta/.libs/back_asyncmeta-2-devel.so.0: error: symbol lookup error: undefined symbol: ldap_build_delete_req (fatal) 11849: servers/slapd/back-dnssrv/.libs/back_dnssrv-2-devel.so.0: error: symbol lookup error: undefined symbol: ldap_domain2hostlist (fatal) 11852: servers/slapd/back-ldap/.libs/back_ldap-2-devel.so.0: error: symbol lookup error: undefined symbol: ldap_parse_whoami (fatal) 11856: servers/slapd/back-meta/.libs/back_meta-2-devel.so.0: error: symbol lookup error: undefined symbol: ldap_parse_reference (fatal)
For back-meta and back-asyncmeta: I guess it doesn't matter since they both require back_ldap to be loaded anyway.
For back-ldap and back-dnssrv: is it a problem to link libldap dynamically when slapd already linked it statically?
If linking libldap explicitly doesn't cause problems (only case I can think of is if slapd and libldap get out-of-sync), any reason to not just add it for all of them, regardless of --enable-dynamic?
https://bugs.openldap.org/show_bug.cgi?id=9213
--- Comment #2 from Howard Chu hyc@openldap.org --- (In reply to Ryan Tandy from comment #1)
If linking libldap explicitly doesn't cause problems (only case I can think of is if slapd and libldap get out-of-sync), any reason to not just add it for all of them, regardless of --enable-dynamic?
This will only work if the static libldap was compiled as PIC. Which is generally an odd thing to do for a static library. The static and dynamic libldap's will each have their own separate copies of global options, which might get confusing.
Way back in the past, we built symdummy.c for non-Windows builds (not just for Windows builds), to force slapd to reference the rest of libldap, for this reason. We dropped all this when we started trying to move to less hacked up local copies of the build tools.
We probably should just prevent using --enable-modules without --enable-dynamic.
https://bugs.openldap.org/show_bug.cgi?id=9213
--- Comment #3 from Ryan Tandy ryan@openldap.org --- (In reply to Howard Chu from comment #2)
We probably should just prevent using --enable-modules without --enable-dynamic.
Makes sense. Thanks for the explanation.
https://bugs.openldap.org/show_bug.cgi?id=9213
--- Comment #4 from Quanah Gibson-Mount quanah@openldap.org --- (In reply to Howard Chu from comment #2)
We probably should just prevent using --enable-modules without --enable-dynamic.
+1
https://bugs.openldap.org/show_bug.cgi?id=9213
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.5.0 Keywords| |OL_2_5_REQ
https://bugs.openldap.org/show_bug.cgi?id=9213
Ryan Tandy ryan@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |IN_PROGRESS
--- Comment #5 from Ryan Tandy ryan@openldap.org --- https://git.openldap.org/openldap/openldap/-/merge_requests/34
https://bugs.openldap.org/show_bug.cgi?id=9213
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|IN_PROGRESS |RESOLVED Resolution|--- |TEST Keywords|OL_2_5_REQ |
--- Comment #6 from Quanah Gibson-Mount quanah@openldap.org --- Commits: • 5368e22b by Ryan Tandy at 2020-04-14T12:10:06-07:00 ITS#9213 Make --enable-modules imply --enable-dynamic
The default for --enable-dynamic is now "auto", meaning "yes" if --enable-modules and "no" otherwise.
https://bugs.openldap.org/show_bug.cgi?id=9213
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|TEST |FIXED Status|RESOLVED |VERIFIED