[Pkg-samba-maint] linking libsmbconf

Michael Tokarev mjt at tls.msk.ru
Thu Mar 24 13:19:50 GMT 2022


Hi!

I'm trying to build samba 4.16, and am facing somewhat weird issue.
For one, libsmbconf.so link fails like this:

(unstable-amd64-sbuild):<builddir>/bin/default$ gcc -Wl,--as-needed -Wl,--version-script=<builddir>/bin/default/source3/smbconf.vscript -shared 
-Wl,-h,libsmbconf.so.0 lib/util/util_pw.c.99.o librpc/gen_ndr/ndr_server_id.c.40.o source3/lib/cluster_support.c.45.o 
source3/lib/dbwrap/dbwrap_ctdb.c.45.o source3/lib/messages_ctdb.c.45.o source3/lib/messages_ctdb_ref.c.45.o source3/lib/ctdbd_conn.c.45.o 
source3/lib/smbconf/smbconf_init.c.77.o source3/lib/smbconf/smbconf_reg.c.77.o source3/lib/system.c.44.o source3/lib/sendfile.c.44.o 
source3/lib/recvfile.c.44.o source3/lib/time.c.44.o source3/lib/util_sid.c.44.o source3/lib/util_specialsids.c.44.o source3/lib/util_file.c.44.o 
source3/lib/util.c.44.o source3/lib/util_path.c.44.o source3/lib/util_matching.c.44.o source3/lib/util_procid.c.44.o source3/lib/util_sock.c.44.o 
source3/lib/util_tsock.c.44.o source3/lib/util_transfer_file.c.44.o source3/lib/util_macstreams.c.44.o source3/lib/util_tdb.c.116.o 
source3/param/util.c.1.o source3/lib/messages.c.52.o source3/lib/util_cluster.c.52.o source3/lib/id_cache.c.52.o source3/lib/serverid.c.52.o 
source3/lib/server_id_watch.c.52.o source3/lib/server_id_db_util.c.52.o source3/lib/addrchange.c.52.o lib/util/debug_s3.c.52.o 
source3/lib/dumpcore.c.52.o source3/lib/interface.c.52.o source3/lib/username.c.52.o source3/lib/smbrun.c.52.o source3/lib/wins_srv.c.52.o 
source3/lib/substitute.c.52.o source3/lib/substitute_generic.c.52.o source3/lib/ms_fnmatch.c.52.o source3/lib/tallocmsg.c.52.o 
source3/lib/dmallocmsg.c.52.o source3/lib/gencache.c.52.o source3/lib/util_event.c.52.o source3/lib/global_contexts.c.52.o 
source3/lib/ldap_escape.c.52.o source3/lib/system_smbd.c.52.o source3/lib/audit.c.52.o source3/lib/idmap_cache.c.52.o source3/lib/namemap_cache.c.52.o 
source3/lib/util_ea.c.52.o source3/lib/background.c.52.o source3/lib/version.c.109.o source3/lib/dbwrap/dbwrap_open.c.48.o 
source3/lib/dbwrap/dbwrap_watch.c.48.o source3/lib/g_lock.c.48.o lib/smbconf/smbconf.c.1.o lib/smbconf/smbconf_txt.c.1.o 
lib/smbconf/smbconf_util.c.1.o source3/registry/reg_backend_smbconf.c.36.o source3/registry/reg_init_smbconf.c.36.o 
source3/registry/reg_util_token.c.36.o source3/registry/reg_api_util.c.36.o lib/async_req/async_sock.c.1.o source3/registry/reg_api.c.35.o 
source3/registry/reg_dispatcher.c.35.o source3/registry/reg_cachehook.c.35.o source3/registry/reg_objects.c.35.o 
source3/registry/reg_util_internal.c.35.o source3/lib/util_nttoken.c.35.o source3/registry/reg_backend_db.c.35.o 
source3/registry/reg_parse_internal.c.35.o source3/registry/reg_parse.c.35.o source3/lib/srprs.c.35.o source3/registry/reg_init_basic.c.35.o 
source3/param/loadparm_ctx.c.2.o librpc/gen_ndr/ndr_messaging.c.154.o source3/libsmb/errormap.c.126.o source3/libsmb/smberr.c.126.o 
source3/lib/errmap_unix.c.126.o source3/param/loadparm.c.76.o source3/lib/sharesec.c.76.o source3/lib/ldap_debug_handler.c.76.o 
source3/lib/util_names.c.76.o -o<builddir>/bin/default/source3/libsmbconf.so -Wl,-Bstatic -Wl,-Bdynamic 
-L<builddir>/bin/default/third_party/heimdal_build -L<builddir>/bin/default/source4/lib/events -L<builddir>/bin/default/lib/tdb_wrap 
-L<builddir>/bin/default/lib -L<builddir>/bin/default/librpc -L<builddir>/bin/default/lib/replace -L<builddir>/bin/default/lib/socket 
-L<builddir>/bin/default/libcli/util -L<builddir>/bin/default/lib/param -L<builddir>/bin/default/lib/messaging 
-L<builddir>/bin/default/libcli/registry -L<builddir>/bin/default/lib/dbwrap -L<builddir>/bin/default/lib/util -L<builddir>/bin/default/source3 
-L<builddir>/bin/default/libcli/security -L/usr/local/lib -L/usr/local/lib -lsamba-security-samba4 -lmessages-util-samba4 -lserver-id-db-samba4 
-lsamba-debug-samba4 -lsamba-util -ldbwrap-samba4 -ltevent-util -lsamba3-util-samba4 -lutil-tdb-samba4 -lutil-reg-samba4 -lsys-rw-samba4 
-ltalloc-report-printf-samba4 -lCHARSET3-samba4 -lmessages-dgm-samba4 -lsamba-hostconfig -lsamba-errors -linterfaces-samba4 -lreplace-samba4 -lndr 
-liov-buf-samba4 -lsamba-sockets-samba4 -lsmbd-shim-samba4 -lsocket-blocking-samba4 -ltdb-wrap-samba4 -ltime-basic-samba4 -lutil-setid-samba4 
-lgenrand-samba4 -lmsghdr-samba4 -lserver-role-samba4 -lndr-nbt -levents-samba4 -lroken-samba4 -lutil -lresolv -licudata -licui18n -licuuc -lbsd -lz 
-ldl -lgnutls -ltdb -lcups -ltalloc -lpthread -llber -lldap -lcap -ltevent -ltalloc -lsystemd -Wl,-z,relro -Wl,-z,now -Wl,-z,relro,-z,now 
-Wl,-no-undefined -Wl,--export-dynamic

/usr/bin/ld: source3/lib/messages_ctdb_ref.c.45.o: in function `msg_ctdb_ref_destructor':
./bin/default/../../source3/lib/messages_ctdb_ref.c:137: undefined reference to `_talloc_free'
/usr/bin/ld: source3/lib/messages_ctdb_ref.c.45.o: in function `messaging_ctdb_ref':
./bin/default/../../source3/lib/messages_ctdb_ref.c:55: undefined reference to `talloc_named_const'
/usr/bin/ld: ./bin/default/../../source3/lib/messages_ctdb_ref.c:100: undefined reference to `_talloc_set_destructor'
/usr/bin/ld: ./bin/default/../../source3/lib/messages_ctdb_ref.c:81: undefined reference to `_talloc_free'
/usr/bin/ld: ./bin/default/../../source3/lib/messages_ctdb_ref.c:90: undefined reference to `_talloc_free'
/usr/bin/ld: source3/lib/ctdbd_conn.c.45.o: in function `ctdbd_msg_call_back':
./bin/default/../../source3/lib/ctdbd_conn.c:182: undefined reference to `talloc_get_size'
..

- this happens apparently for all symbols in -ltalloc. static libtalloc.a works
(after moving libtalloc.so out of the way)

It is interesting since other things links with this -ltalloc just fine.

There's one more link error, here:

./bin/default/../../source3/lib/ctdbd_conn.c:1276: undefined reference to `tdb_null'
/usr/bin/ld: source3/lib/ctdbd_conn.c.45.o: relocation R_X86_64_PC32 against undefined hidden symbol `tdb_null' can not be used when making a shared 
object

It is this place -- the ctdb_control() call:

int ctdbd_control_local(struct ctdbd_connection *conn, uint32_t opcode,
                         uint64_t srvid, uint32_t flags, TDB_DATA data,
                         TALLOC_CTX *mem_ctx, TDB_DATA *outdata,
                         int32_t *cstatus)
{
         return ctdbd_control(conn, CTDB_CURRENT_NODE, opcode, srvid, flags, data,
                              mem_ctx, outdata, cstatus);
}

Both of these issues are puzzling. I'm digging for now,
but if anyone have an idea, please speak up :)

Thanks!

/mjt



More information about the Pkg-samba-maint mailing list