Building Samba 4.25.0 on Linux i686 fails while linking targets that depend on libsamba-cluster-support-private-samba.so: . . . [2483/3877] Compiling bin/default/librpc/gen_ndr/py_lsa.c 11:51:56 runner ['gcc', '-D_SAMBA_BUILD_=4', '-DHAVE_CONFIG_H=1', '-O2', '-flto=auto', '-ffat-lto-objects', '-fexceptions', '-g', '-grecord-gcc-switches', '-pipe', '-Wall', '-Werror=format-security', '-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3', '-Wp,-D_GLIBCXX_ASSERTIONS', '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1', '-fstack-protector-strong', '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1', '-m32', '-march=i686', '-mtune=generic', '-msse2', '-mfpmath=sse', '-mstackrealign', '-fasynchronous-unwind-tables', '-fstack-clash-protection', '-mtls-dialect=gnu', '-MMD', '-D_GNU_SOURCE=1', '-D_XOPEN_SOURCE_EXTENDED=1', '-DPY_SSIZE_T_CLEAN=1', '-fPIC', '-D__STDC_WANT_LIB_EXT1__=1', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_REENTRANT', '-DCTDB_DATADIR="/usr/share/ctdb"', '-DCTDB_ETCDIR="/etc/ctdb"', '-DCTDB_HELPER_BINDIR="/usr/libexec/ctdb"', '-DCTDB_LOCKDIR="/var/lib/samba/lock/ctdb"', '-DCTDB_PIDDIR="/run/ctdb"', '-DCTDB_SOCKETDIR="/run/samba/ctdb"', '-DCTDB_VARDIR="/var/lib/ctdb"', '-DLOGDIR="/var/log"', '-fstack-protector-strong', '-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3', '-fstack-clash-protection', '-Wno-unused-function', '-DSTATIC_python_lsa_MODULES=NULL', '-DSTATIC_python_lsa_MODULES_PROTO=extern void __python_lsa_dummy_module_proto(void)', '-fno-strict-aliasing', '-Isource4/librpc', '-I../../source4/librpc', '-Iinclude/public', '-I../../include/public', '-Isource4', '-I../../source4', '-Ilib', '-I../../lib', '-Isource4/lib', '-I../../source4/lib', '-Isource4/include', '-I../../source4/include', '-Iinclude', '-I../../include', '-Ilib/replace', '-I../../lib/replace', '-Ictdb/include', '-I../../ctdb/include', '-Ictdb', '-I../../ctdb', '-I.', '-I../..', '-Isource3', '-I../../source3', '-Isource3/include', '-I../../source3/include', '-Isource3/lib', '-I../../source3/lib', '-Ilibrpc', '-I../../librpc', '-Ilibcli/security', '-I../../libcli/security', '-Ilib/ldb-samba', '-I../../lib/ldb-samba', '-Ilibcli/auth', '-I../../libcli/auth', '-Isource3/param', '-I../../source3/param', '-Ilib/crypto', '-I../../lib/crypto', '-Isource4/auth', '-I../../source4/auth', '-Isource4/libcli', '-I../../source4/libcli', '-Isource4/lib/socket', '-I../../source4/lib/socket', '-Ithird_party/quic/libquic', '-I../../third_party/quic/libquic', '-Ithird_party/quic/modules/include/uapi', '-I../../third_party/quic/modules/include/uapi', '-Ithird_party/quic', '-I../../third_party/quic', '-Insswitch/libwbclient', '-I../../nsswitch/libwbclient', '-Isource4/auth/kerberos', '-I../../source4/auth/kerberos', '-Ilibcli/dns', '-I../../libcli/dns', '-Ilib/param', '-I../../lib/param', '-Ilib/util/lib/util/debug-classes', '-I../../lib/util/lib/util/debug-classes', '-Ilib/util/builddir/build/BUILD/samba-4.25.0-build/samba-4.25.0/third_party/gpfs', '-I../../lib/util/builddir/build/BUILD/samba-4.25.0-build/samba-4.25.0/third_party/gpfs', '-Ipython', '-I../../python', '-Ilib/ldb/include', '-I../../lib/ldb/include', '-Ilib/ldb', '-I../../lib/ldb', '-Ilib/pthreadpool', '-I../../lib/pthreadpool', '-Isource4/param', '-I../../source4/param', '-Iauth/credentials', '-I../../auth/credentials', '-Isource3/librpc', '-I../../source3/librpc', '-Ilib/messaging', '-I../../lib/messaging', '-Ilibcli/http', '-I../../libcli/http', '-Iauth', '-I../../auth', '-Iauth/gensec', '-I../../auth/gensec', '-Isource4/libcli/ldap', '-I../../source4/libcli/ldap', '-Ilib/dbwrap', '-I../../lib/dbwrap', '-Ilib/addns', '-I../../lib/addns', '-Isource4/cluster', '-I../../source4/cluster', '-Ilibds/common', '-I../../libds/common', '-Ilib/tsocket', '-I../../lib/tsocket', '-Ilibcli/nbt', '-I../../libcli/nbt', '-Isource4/auth/gensec', '-I../../source4/auth/gensec', '-Isource4/lib/events', '-I../../source4/lib/events', '-Ilib/util/charset', '-I../../lib/util/charset', '-Iauth/ntlmssp', '-I../../auth/ntlmssp', '-Ilib/krb5_wrap', '-I../../lib/krb5_wrap', '-Isource4/lib/messaging', '-I../../source4/lib/messaging', '-Ilibcli/registry', '-I../../libcli/registry', '-Ilib/compression', '-I../../lib/compression', '-Isource4/lib/tls', '-I../../source4/lib/tls', '-Ilib/audit_logging', '-I../../lib/audit_logging', '-Isource4/libcli/smb2', '-I../../source4/libcli/smb2', '-Ilib/socket', '-I../../lib/socket', '-Ilibcli/cldap', '-I../../libcli/cldap', '-Ilib/async_req', '-I../../lib/async_req', '-Ilibcli/smb', '-I../../libcli/smb', '-Ilibcli/util', '-I../../libcli/util', '-Ilibcli/netlogon', '-I../../libcli/netlogon', '-Isource4/lib/stream', '-I../../source4/lib/stream', '-Ilibcli/lsarpc', '-I../../libcli/lsarpc', '-Idynconfig', '-I../../dynconfig', '-Isource4/dsdb', '-I../../source4/dsdb', '-Ilibcli/ldap', '-I../../libcli/ldap', '-Ilibcli/drsuapi', '-I../../libcli/drsuapi', '-Iauth/kerberos', '-I../../auth/kerberos', '-Ilib/smbconf', '-I../../lib/smbconf', '-I/usr/include/python3.15', 'librpc/gen_ndr/py_lsa.c', '-c', '-o/builddir/build/BUILD/samba-4.25.0-build/samba-4.25.0/bin/default/librpc/gen_ndr/py_lsa.c.45.o'] /usr/bin/ld.bfd: /builddir/build/BUILD/samba-4.25.0-build/samba-4.25.0/bin/default/source3/libsamba-cluster-support-private-samba.so: undefined reference to `dynamic_lookup' collect2: error: ld returned 1 exit status . . . Configure reports: . . . Checking linker accepts ['-Wl,-undefined,dynamic_lookup'] : yes . . . The resulting link commands contain `-Wl,-undefined,dynamic_lookup`. This is a macOS option for resolving undefined symbols at load time. GNU ld.bfd instead interprets dynamic_lookup as the name of a symbol to leave undefined. This appears to be a regression from 9938c9a6f7baef906a1ddb3778eb71eaf8b69010, which changed the probe from ['-undefined', 'dynamic_lookup'] to ['-Wl,-undefined,dynamic_lookup']. In earlier Linux builds, the former probe returned "no", so the flag was not added. The new probe returns yes on i686 and x86_64 (and others). The observed x86_64 (and aarch64) build uses mold and succeeds; the i686 build uses ld.bfd and fails.
This bug was referenced in samba master: 7399c227bfb5e6e68030f8c694a9761c0c9d6d76
Created attachment 19250 [details] patch from master for v4-25-test