https://bugs.openldap.org/show_bug.cgi?id=9739
Issue ID: 9739 Summary: Undefined reference to ber_sockbuf_io_udp in 2.6.0 Product: OpenLDAP Version: 2.6.0 Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: build Assignee: bugs@openldap.org Reporter: simon.pichugin@gmail.com Target Milestone: ---
While I was trying to build OpenLDAP 2.6 on Fedora Rawhide I've got the error message:
/usr/bin/ld: ./.libs/libldap.so: undefined reference to `ber_sockbuf_io_udp'
I've checked commits from https://bugs.openldap.org/show_bug.cgi?id=9673 and found that 'ber_sockbuf_io_udp' was not added to https://git.openldap.org/openldap/openldap/-/blob/master/libraries/liblber/l...
I've asked on the project's mailing list and got a reply:
"That symbol only exists if OpenLDAP is built with LDAP_CONNECTIONLESS defined, which is not a supported feature. Feel free to file a bug report at https://bugs.openldap.org/"
https://lists.openldap.org/hyperkitty/list/openldap-technical@openldap.org/t...
Hence, creating the bug.
https://bugs.openldap.org/show_bug.cgi?id=9739
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|bugs@openldap.org |hyc@openldap.org Target Milestone|--- |2.6.1 Keywords|needs_review |
--- Comment #1 from Quanah Gibson-Mount quanah@openldap.org --- Need to decide how to handle this case in general as there may be other features hidden behind defines. Should the map file simply declare every possible symbol regardless of whether it is available?
https://bugs.openldap.org/show_bug.cgi?id=9739
--- Comment #2 from Ondřej Kuzník ondra@mistotebe.net --- We have a number of public symbols that are present depending on whether a macro is set, there seem to be three main types to consider: 1. those that depend on what we (don't) build with - tls seems to be fine and sasl probably too, so long as noone inspects _pvt.h headers. But our own tools do just that 2. LDAP_CONNECTIONLESS which is set at build time by us (and potentially LDAP_DEPRECATED if we decide to remove them) 3. features (ppolicy, paged results, ...) which we should expose once (updating our library version) and never hide again
3. is easy to manage, 1. we should be able to pull off since we're also in good place for that. We have broken ABI from our historical libldap.so.2 by removing some of the LDAP_CONNECTIONLESS symbols (ldap_is_ldapc_url is gone) and we might need to expose them again or bump our ABI to libldap/liblber.so.3.
https://bugs.openldap.org/show_bug.cgi?id=9739
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|2.6.1 |---
https://bugs.openldap.org/show_bug.cgi?id=9739
--- Comment #3 from Howard Chu hyc@openldap.org --- Since the symbol in question is part of an unsupported feature, only built when the unsupported LDAP_CONNECTIONLESS flag is defined, we will not be adding it to the officially released library map files. If you want to add unsupported features to your builds, then you'll be responsible for tweaking your map files appropriately to make those unsupported features visible in your builds.
Thanks for bringing this to our attention and giving us the opportunity to clarify the Project policy on the matter. This ticket will now be closed.
https://bugs.openldap.org/show_bug.cgi?id=9739
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |SUSPENDED Status|UNCONFIRMED |RESOLVED
https://bugs.openldap.org/show_bug.cgi?id=9739
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |VERIFIED
https://bugs.openldap.org/show_bug.cgi?id=9739
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |shoober420@gmail.com
--- Comment #4 from Quanah Gibson-Mount quanah@openldap.org --- *** Issue 9771 has been marked as a duplicate of this issue. ***
https://bugs.openldap.org/show_bug.cgi?id=9739
--- Comment #5 from zhixu.liu@gmail.com zhixu.liu@gmail.com --- besides "undefined reference to `ber_sockbuf_io_udp'" in this bug, which can be fix by "#define LDAP_CONNECTIONLESS", I found two problems which should be fixed. Correct me if I'm wrong.
1. if configure run without "--with-cyrus-sasl", i.e, HAVE_CYRUS_SASL is not defined, bild failed with message: ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_host_connected_to' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_int_sasl_config' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_int_sasl_get_option' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_int_sasl_open' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_int_sasl_set_option' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_sasl_cbinding' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_sasl_cbinding_parse' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_sasl_install' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_sasl_mutex_dispose' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_sasl_mutex_lock' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_sasl_mutex_new' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_sasl_mutex_unlock' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_sasl_remove' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_sasl_secprops' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_sasl_secprops_unparse' failed: symbol not defined
2. if configure run without "--enable-debug", i.e, LDAP_DEBUG is not defined, bild failed with message: ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_dump_connection' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_dump_requests_and_responses' failed: symbol not defined
all the undefined symbols are defined in libraries/libldap/ldap.map desite of the config exist or not, so we should modify ldap.map to include the undefined symbol above by test of HAVE_CYRUS_SAS and LDAP_DEBUG?
https://bugs.openldap.org/show_bug.cgi?id=9739
--- Comment #6 from zhixu.liu@gmail.com zhixu.liu@gmail.com --- if no HAVE_TLS:
ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_int_tls_destroy' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_int_tls_impl' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_int_tls_start' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_accept' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_check_hostname' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_config' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_connect' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_ctx_free' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_destroy' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_get_cipher' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_get_endpoint' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_get_my_dn' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_get_option' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_get_peer_dn' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_get_peercert' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_get_strength' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_get_unique' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_get_version' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_init' failed: symbol not defined ld.lld: error: version script assignment of 'OPENLDAP_2.200' to symbol 'ldap_pvt_tls_init_def_ctx' failed: symbol not defined
https://bugs.openldap.org/show_bug.cgi?id=9739
--- Comment #7 from zhixu.liu@gmail.com zhixu.liu@gmail.com --- 1. error of "symbol not defined" reported by ld.ldd can be fixed by add ldflags "-Wl,--undefined-version", i.e., restore the old behavior that undefined symbols in shared libraries are allowed.
2.undefined reference to `ber_sockbuf_io_udp' can be fixed by patch below, enclosed the ber_sockbuf_io_udp by #ifdef, I search the code, all the user of ber_sockbuf_io_udp are enclosed by #ifdef, so it make no sense to not include it too.
diff --git a/include/lber.h b/include/lber.h index 530359dc92..fd4957ddcd 100644 --- a/include/lber.h +++ b/include/lber.h @@ -590,7 +590,9 @@ LBER_V( Sockbuf_IO ) ber_sockbuf_io_tcp; LBER_V( Sockbuf_IO ) ber_sockbuf_io_readahead; LBER_V( Sockbuf_IO ) ber_sockbuf_io_fd; LBER_V( Sockbuf_IO ) ber_sockbuf_io_debug; +#ifdef LDAP_CONNECTIONLESS LBER_V( Sockbuf_IO ) ber_sockbuf_io_udp; +#endif
/* * LBER memory.c
https://bugs.openldap.org/show_bug.cgi?id=9739
--- Comment #8 from Ondřej Kuzník ondra@mistotebe.net --- It seems that at least lld, gold and bdf linkers support preprocessor macros during version script processing. Do we know if that support is universal whenever "--(gnu-)version-script" is available?