regshell.c: compiler uses -m32 as well as -m64

Andrew Bartlett abartlet at samba.org
Mon Feb 3 02:05:05 UTC 2020


On Sun, 2020-01-26 at 07:52 +0100, Rouven WEILER via samba-technical
wrote:
> The system is Openindiana which is based on Illumos. Frankly said it
> is the „gcc“ version of Solaris.
> Right now I just wanted to update to distro-package. Therefore, on e
> just needs to change the Makefile in the respective package build
> system.
> For an impression here a link: 
> https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/network/samba/Makefile
>  <
> https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/network/samba/Makefile
> >
> Using that build system I actually do not set the -m64 on my own, it
> it done in the background of the openindiana Makefiles. 
> If samba does set that also I cannot tell as I am not very familiar
> with waf.
> 
> Version 4.11.4 of samba worked very well in that build environment,
> version 4.11.5 throws a "READELF32 error" when linking
> "regshell.15.o“
> regshell has that compiler line I already sent containing a "-m64“ as
> well as a "-m32“ which does not seem correct and causing the linker
> error.
> So my main idea was to find out why there is this "-m32“ and probably
> kick it out.
> 
> Referring to ncurses: I do not see how this would harm the build.
> Could you give me some more background.

When we build against a system package we run a program on the system
to work out what compile flags to use.  

Those programs are ncurses5-config, ncurses6-config

My thought is that this flags is coming from that.  On my system this
is what I get:

$ ncurses5-config --cflags
-D_GNU_SOURCE -D_DEFAULT_SOURCE

If you get -m32 in there, then that is how it sneaks in.  We pass
unfiltered whatever is the output from ncurses-config --cflags along
just as we would (on my system) the 
"-D_GNU_SOURCE -D_DEFAULT_SOURCE"

when compiling the parts of Samba that #include the ncurses headers,
which would explain why only a single .o file is 32-bit.

You should also determine if ncurses is built as 32-bit on Openindiana.

I hope this helps you understand this a little better. 

Andrew Bartlett

-- 
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT - Expert Open Source
Solutions
https://catalyst.net.nz/services/samba









More information about the samba-technical mailing list