Samba v4.2.0 vs. v4.3.5 and -ltinfo
Uri Simchoni
uri at samba.org
Sat Mar 5 20:56:53 UTC 2016
On 03/04/2016 11:32 PM, David Hauck wrote:
> Hi Uri,
>
> Thanks for your note, please see below.
>
> On Friday, March 04, 2016 11:26 AM, Uri Simchoni wrote:
>> On 03/04/2016 07:48 PM, David Hauck wrote:
>>> Hello,
>>>
>>> I've been working on migrating my cross-build from v4.2.0 to v4.3.5
>>> (latest
>> stable). I finally got this building but wanted to ask about the one
>> build failure I initially encountered. Specifically this related to a
>> missing libtinfo.so. My build environment includes 'ncurses' built
>> without the --with-termlib autoconf parameter set (hence no libtinfo)
>> and so packages that rely on 'ncurses', and that expect to use -ltinfo, will fail during link.
>>>
<snip>
>> Haven't looked into that, but I know that adding ncurses to build env
>> broke our (cross) samba build, and that --without-regedit in samba
>> configure was the workaround. So if you don't need regedit that could be a quick fix.
>
> My failure is occurring here:
>
> /home/dhauck/production/factory/build_i686-netacquire-linux-gnu/toolchain/lib/gcc/i686-netacquire-linux-gnu/4.9.3/../../../../i686-netacquire-linux-gnu/bin/ld: cannot find -ltinfo
> collect2: error: ld returned 1 exit status
> Waf: Leaving directory `/home/dhauck/production/factory/build_i686-netacquire-linux-gnu/samba-4.3.5/samba-4.3.5/bin'
> Build failed: -> task failed (err #1):
> {task: cc_link client_1.o,popt_common_5.o,smbreadline_1.o,popt_credentials_6.o,clilsa_2.o -> smbclient4}
> target/software/Networking/samba/samba.mk:54: recipe for target '/home/dhauck/production/factory/build_i686-netacquire-linux-gnu/samba-4.3.5/.stamp_built' failed
>
> The waf build hides (by default I guess - presumably there is a way to get it to be more verbose about what it's doing?) where this is actually happening, but this first occurrence seems to be in the attempted link for 'smbclient4'. Does --without-regedit have an impact on this target as well (and potentially all other targets that appear to be attempting to link with -ltinfo)?
I can confirm that removing --without-regedit gives me the same error
message. Probably it adds the -ltinfo for binaries other than regedit.
>
>> After a quick look, I would guess that the samba configuration script
>> for ncurses does not support cross-compiling because it runs
>> ncurses5-config or ncurses6-config, but the wrong ones - the system
>> ones. See source3/wscript_configure_system_ncurses.
>
> This script references 'ncurses' but not 'tinfo' specifically (or is there something subtle/indirect in the way this script results in the eventual usage of -ltinfo?).
The indirect thing is the invocation of ncurses5-config or
ncursers6-config - that's a pkgconfig-style program, which outputs the
linker and compiler flags needed for ncurses integration. Running the
native, or system, ncurses6-config for a cross-build is fundamentally
wrong, and that's a bug of the build system.
The ncurses(5|6)-config invocation is attempted if --without-regedit is
NOT specified AND if the ncurses.h headers are found. Since you seem to
have ncurses headers in your cross-build env, the way for you to avoid
this link flag (other than fixing the Samba configure script, and of
course I'd love to see a fix) is to specify --without-regedit (assuming
you can manage without regedit).
>
> Thanks,
> -David
>
>> Hope that helps,
>> Uri.
More information about the samba-technical
mailing list