Bug 11764 - --builtin-libraries=replace causes undefined symbols
--builtin-libraries=replace causes undefined symbols
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build
All All
: P5 normal
: ---
Assigned To: Ralph Böhme
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2016-03-01 14:25 UTC by Ralph Böhme
Modified: 2016-10-06 18:35 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Böhme 2016-03-01 14:25:26 UTC
Trying to build Samba with ./configure --builtin-libraries=replace results in unpredicatable failing builds, depending on the remainning configure options.

When run with only --builtin-libraries=replace

[3364/3925] Linking default/nsswitch/libwbclient/libwbclient.so
default/source4/heimdal/lib/com_err/com_err_126.o: In function `error_message':
com_err.c:(.text+0x92): undefined reference to `rep_strlcpy'
default/source4/heimdal/lib/com_err/error_126.o: In function `com_right_r':
error.c:(.text+0x180): undefined reference to `rep_strlcpy'
collect2: error: ld returned 1 exit status

Trying to build Samba-4.4.0-rc3 results in:

[2448/2798] Linking default/source4/client/smbclient4
default/source3/libsamba-cluster-support-samba4.so: undefined reference
to `lp__ctdbd_socket'
collect2: error: ld returned 1 exit status

this is a problem in the waf dependency resolver that is triggered by


waf adds the libreplace objects directly into all components that use them, eg libsamba-cluster-support-samba4, but libsamba-cluster-support-samba4 has undefined symbols (lp__ctdbd_socket)

When linking binaries where libsamba-cluster-support-samba4 is passed as a library object, but the binary doesn't use symbols from it, the linker would drop the dependency because we pass --as-needed

But because due to --builtin-libraries=replace the library does contains needed symbols (the symbols from libreplace), the linker picks up the dependency and the chokes on the undefined symbol.

A possible way to address this would be to ensure libraries that set allow_undefined_symbols=True are not chosen as grouping library, but there may be more to it then just this.
Comment 1 Arkadiusz Miskiewicz 2016-10-06 18:35:44 UTC
4.2.X was building fine with --builtin-libraries=replace. 4.4.X and current 4.5.X, too no longer builds here, too :(