bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with linking samba with ncurses


From: Thomas Dickey
Subject: Re: Problem with linking samba with ncurses
Date: Mon, 4 Sep 2023 18:24:45 -0400

On Mon, Sep 04, 2023 at 11:50:02PM +0100, G2V WUch wrote:
> Hi,
> 
> I have problem with ncurses and building samba.
> ncurses in samba is used by few binaries. One of these biaries is regedit.
> On linkinking regedit it fails with
> 
> [3349/3592] Linking bin/default/source4/lib/registry/
> py-registry.cpython-38-x86_64-linux-gnu.so
> 22:08:03 runner ['/usr/bin/gcc', '-Wl,--as-needed', '-shared',
> 'source4/lib/registry/pyregistry.c.26.o',
> '-o/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/lib/registry/
> py-registry.cpython-38-x86_64-linux-gnu.so',
> '-Wl,-rpath,/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/shared',
> '-Wl,-rpath,/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/shared/private',
> '-Wl,-Bstatic', '-Wl,-Bdynamic',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/messaging',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/auth',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/libcli/ldap',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/nsswitch/libwbclient',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/dns',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/socket',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/tdb_wrap',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/krb5_wrap',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/dbwrap',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/auth/kerberos',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/ldap',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libds/common',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/cluster',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source3',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/cldap',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/auth/gensec',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/http',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/addns',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/lib/socket',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/lib/events',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/auth',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/libcli',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/nbt',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/smb',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/auth/credentials',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/security',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/dsdb',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/util',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/lib/messaging',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/librpc',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/librpc',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/util',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/ldb-samba',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/registry',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/param',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/python',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/replace',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/lib/registry',
> '-L/usr/local/lib', '-L/usr/local/lib', '-L/usr/lib64', '-L/usr/lib64',
> '-L/usr/lib64', '-L/usr/lib64', '-lregistry-samba4', '-lreplace-samba4',
> '-lsamba-python.cpython-38-x86-64-linux-gnu-samba4', '-lsamba-hostconfig',
> '-lutil-reg-samba4', '-lldbsamba-samba4', '-lsamba-util', '-ldcerpc',
> '-ldcerpc-samba-samba4', '-lMESSAGING-samba4', '-lserver-role-samba4',
> '-lsamba-errors', '-lndr', '-lsamdb-common-samba4',
> '-lsamba-security-samba4', '-lndr-samba-samba4', '-lgenrand-samba4',
> '-lsocket-blocking-samba4', '-lutil-setid-samba4', '-lsamba-debug-samba4',
> '-ltime-basic-samba4', '-lsys-rw-samba4', '-ldcerpc-pkt-auth-samba4',
> '-ldcerpc-binding', '-lsamba-credentials', '-lsamba-sockets-samba4',
> '-lcli-smb-common-samba4', '-lcli-nbt-samba4', '-lsmbclient-raw-samba4',
> '-ltevent-util', '-lcliauth-samba4', '-levents-samba4', '-lndr-nbt',
> '-lnetif-samba4', '-laddns-samba4', '-lhttp-samba4', '-lgensec-samba4',
> '-lcli-cldap-samba4', '-lndr-standard', '-lmessages-util-samba4',
> '-lserver-id-db-samba4', '-lndr-samba4', '-ltalloc-report-printf-samba4',
> '-lcluster-samba4', '-lflag-mapping-samba4', '-lcli-ldap-common-samba4',
> '-lasn1util-samba4', '-lstable-sort-samba4', '-lndr-krb5pac',
> '-liov-buf-samba4', '-lauthkrb5-samba4', '-ldbwrap-samba4',
> '-lkrb5samba-samba4', '-ltdb-wrap-samba4', '-lutil-tdb-samba4',
> '-linterfaces-samba4', '-lsmb-transport-samba4', '-lclidns-samba4',
> '-lsamba-modules-samba4', '-lwbclient', '-lsamdb', '-lcli-ldap-samba4',
> '-lcommon-auth-samba4', '-lMESSAGING-SEND-samba4', '-lmessages-dgm-samba4',
> '-lmsghdr-samba4', '-lpython3.8', '-lpython3.8', '-lgnutls', '-lsystemd',
> '-licuuc', '-licudata', '-licui18n', '-lz', '-lkrb5', '-lk5crypto',
> '-lcom_err', '-lgssapi_krb5', '-lkrb5', '-lk5crypto', '-lcom_err',
> '-lcom_err', '-ljansson', '-lresolv', '-ltdb', '-ltalloc',
> '-lpytalloc-util.cpython-38-x86-64-linux-gnu', '-ltalloc', '-lldb',
> '-ltevent', '-ltalloc', '-lpython3.8', '-lpython3.8', '-Wl,--gc-sections',
> '-Wl,--as-needed', '-flto=auto', '-flto-partition=none',
> '-fuse-linker-plugin', '-Wl,-z,now',
> '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld', '-Wl,--build-id=sha1',
> '-Wl,-z,relro,-z,now', '-Wl,--export-dynamic']
> /usr/bin/ld: /tmp/ccBM5CCA.lto.o: undefined reference to symbol 'cbreak'
> /usr/bin/ld: /usr/lib64/libtinfo.so.6: error adding symbols: DSO missing
> from command line
> collect2: error: ld returned 1 exit status
> 
> * Node
> /home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c
> is created more than once (full message on 'waf -v -v'). The task
> generators are:
>   1. 'spotlight2es.objlist' in
> /home/tkloczko/rpmbuild/BUILD/samba-4.19.0/source3
>   2. 'rpcd_mdssvc.objlist' in
> /home/tkloczko/rpmbuild/BUILD/samba-4.19.0/source3/rpc_server
> If you think that this is an error, set no_errcheck_out on the task instance
> * Node
> /home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source3/rpc_server/mdssvc/es_parser.tab.h
> is created more than once (full message on 'waf -v -v'). The task
> generators are:
>   1. 'spotlight2es.objlist' in
> /home/tkloczko/rpmbuild/BUILD/samba-4.19.0/source3
>   2. 'rpcd_mdssvc.objlist' in
> /home/tkloczko/rpmbuild/BUILD/samba-4.19.0/source3/rpc_server
> If you think that this is an error, set no_errcheck_out on the task instance
> * Node
> /home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source3/rpc_server/mdssvc/es_lexer.lex.c
> is created more than once (full message on 'waf -v -v'). The task
> generators are:
>   1. 'spotlight2es.objlist' in
> /home/tkloczko/rpmbuild/BUILD/samba-4.19.0/source3
>   2. 'rpcd_mdssvc.objlist' in
> /home/tkloczko/rpmbuild/BUILD/samba-4.19.0/source3/rpc_server
> If you think that this is an error, set no_errcheck_out on the task instance
> Waf: Leaving directory
> `/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default'
> Build failed
>  -> task in 'samba-regedit' failed with exit status 1:
>         {task 140170981922288: cprogram
> cmdline_s3.c.4.o,regedit.c.36.o,regedit_samba3.c.36.o,regedit_wrap.c.36.o,regedit_treeview.c.36.o,regedit_valuelist.c.36.o,regedit_dialog.c.36.o,regedit_hexedit.c.36.o,regedit_list.c.36.o
> -> samba-regedit}
> ['/usr/bin/gcc', '-Wl,--as-needed', 'lib/cmdline/cmdline_s3.c.4.o',
> 'source3/utils/regedit.c.36.o', 'source3/utils/regedit_samba3.c.36.o',
> 'source3/utils/regedit_wrap.c.36.o',
> 'source3/utils/regedit_treeview.c.36.o',
> 'source3/utils/regedit_valuelist.c.36.o',
> 'source3/utils/regedit_dialog.c.36.o',
> 'source3/utils/regedit_hexedit.c.36.o',
> 'source3/utils/regedit_list.c.36.o',
> '-o/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source3/utils/samba-regedit',
> '-Wl,-rpath,/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/shared',
> '-Wl,-rpath,/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/shared/private',
> '-Wl,-Bstatic', '-Wl,-Bdynamic',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/cluster',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/lib/messaging',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/auth',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/libcli/ldap',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/nsswitch/libwbclient',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/dns',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/ldap',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libds/common',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/auth/kerberos',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/tdb_wrap',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/cldap',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/auth/gensec',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/http',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/addns',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/lib/socket',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/lib/events',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/libcli',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/nbt',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/dsdb',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/auth',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/krb5_wrap',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/auth/credentials',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/smb',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/param',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/socket',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/messaging',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/util',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/security',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/dbwrap',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/replace',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/librpc',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/librpc',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/util',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/ldb-samba',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/libcli/registry',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/lib/cmdline',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source3',
> '-L/home/tkloczko/rpmbuild/BUILD/samba-4.19.0/bin/default/source4/lib/registry',
> '-L/usr/local/lib', '-L/usr/local/lib', '-L/usr/lib64',
> '-lregistry-samba4', '-lsmbconf', '-lcmdline-samba4', '-lsecrets3-samba4',
> '-lutil-reg-samba4', '-lldbsamba-samba4', '-lsamba-util', '-ldcerpc',
> '-ldcerpc-samba-samba4', '-lreplace-samba4', '-lndr',
> '-lmessages-util-samba4', '-lsamba3-util-samba4', '-lsamba-debug-samba4',
> '-ldbwrap-samba4', '-lsys-rw-samba4', '-lserver-id-db-samba4',
> '-lsamba-security-samba4', '-ltalloc-report-printf-samba4',
> '-lsamba-errors', '-liov-buf-samba4', '-lsocket-blocking-samba4',
> '-lmessages-dgm-samba4', '-linterfaces-samba4', '-lsamba-sockets-samba4',
> '-lCHARSET3-samba4', '-lsmbd-shim-samba4', '-ltevent-util',
> '-lsamba-cluster-support-samba4', '-lutil-tdb-samba4',
> '-lsamba-hostconfig', '-lcli-smb-common-samba4', '-lsamba-credentials',
> '-lkrb5samba-samba4', '-lndr-samba4', '-lcliauth-samba4',
> '-lsamdb-common-samba4', '-lndr-samba-samba4', '-lgenrand-samba4',
> '-lutil-setid-samba4', '-ltime-basic-samba4', '-ldcerpc-pkt-auth-samba4',
> '-ldcerpc-binding', '-lcli-nbt-samba4', '-lsmbclient-raw-samba4',
> '-levents-samba4', '-lndr-nbt', '-lnetif-samba4', '-laddns-samba4',
> '-lhttp-samba4', '-lgensec-samba4', '-lcli-cldap-samba4', '-lndr-standard',
> '-ltdb-wrap-samba4', '-lmsghdr-samba4', '-lserver-role-samba4',
> '-lsmb-transport-samba4', '-lauthkrb5-samba4', '-lstable-sort-samba4',
> '-lndr-krb5pac', '-lasn1util-samba4', '-lflag-mapping-samba4',
> '-lcli-ldap-common-samba4', '-lclidns-samba4', '-lsamba-modules-samba4',
> '-lwbclient', '-lsamdb', '-lcli-ldap-samba4', '-lcommon-auth-samba4',
> '-lMESSAGING-SEND-samba4', '-lcluster-samba4', '-llber', '-lcups',
> '-lldap', '-lgnutls', '-lsystemd', '-licuuc', '-licudata', '-licui18n',
> '-lz', '-lkrb5', '-lk5crypto', '-lcom_err', '-lgssapi_krb5', '-lkrb5',
> '-lk5crypto', '-lcom_err', '-lcom_err', '-ljansson', '-lresolv', '-lform',
> '-ltalloc', '-lldb', '-lncurses', '-lpanel', '-ltevent', '-ltalloc',
> '-ltdb', '-lcap', '-lpopt', '-ltalloc', '-lmenu', '-Wl,--gc-sections',
> '-Wl,--as-needed', '-flto=auto', '-flto-partition=none',
> '-fuse-linker-plugin', '-Wl,-z,now',
> '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld', '-Wl,--build-id=sha1',
> '-pie', '-Wl,-z,relro,-z,now', '-Wl,-no-undefined', '-Wl,--export-dynamic']
> make: *** [Makefile:7: all] Error 1
> 
> In other words it is issue with "cbreak" symbol however nm show this symbol
> in libtinfo
> 
> [tkloczko@pers-jacek SPECS]$ nm -D /usr/lib64/libtinfo.so.6.4 | grep cbreak
> 000000000001c890 T cbreak
> 000000000001c690 T cbreak_sp
> 000000000001cca0 T nocbreak
> 000000000001cb50 T nocbreak_sp
> 
> ncurses source code is configured with (part of my ncurses.spec file):

I'd have put the library in someplace other than /usr/lib*,
to avoid conflicts with the system's libraries.

> %configure \
>         --disable-lib-suffixes \
>         --disable-root-access \
>         --disable-root-environ \
>         --disable-rpath \
>         --disable-rpath-hack \
>         --disable-setuid-environ \
>         --disable-stripping \
>         --disable-wattr-macros \
>         --enable-colorfgbg \
>         --enable-hard-tabs \
>         --enable-overwrite \
>         --enable-pc-files \
>         --enable-widec \
>         --enable-xmc-glitch \
>         --with-abi-version=6 \
>         --with-cxx-shared \
>         --with-dlsym \
>         --with-libtool \
>         --with-manpage-aliases \
>         --with-manpage-format=normal \
>         --with-manpage-tbl \
>         --with-ospeed=unsigned \
>         --without-ada \
>         --with-pkg-config-libdir=%{_libdir}/pkgconfig \
>         --with-progs \
>         --with-shared \
>         --with-terminfo-dirs=%{_datadir}/terminfo \
>         --with-termlib=tinfo \
>         --with-ticlib=tic \
>         --with-x11-rgb=%{_datadir}/X11/rgb.txt \
>         --with-xterm-kbs=DEL \
>         %{nil}
> 
> `cbreak` is used in samba code in
> https://gitlab.com/samba-team/samba/-/blob/master/source3/utils/regedit.c#L698
> and to be honest I don't see anything special here.

The link command uses "-lncurses", while you have configured ncurses
"--with-termlib", which creates libtinfo (and the linker doesn't
know where to find it using the given linker options).  Adding a
"-ltinfo" should improve that.
 
> As I'm working on the whole distribution there are no any other problems
> with ncurses DSos built out of source code configured like above.

> Any suggestions what could be wrong in this case?🤔

The error message gives some clues

https://stackoverflow.com/questions/65269574/understanding-linker-error-dso-missing-from-command-line

but what's different in your other builds, I can't guess.

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]