another build failure on sparc64
Michael Tokarev
mjt at tls.msk.ru
Sun Feb 8 09:28:02 UTC 2026
Hi!
samba 4.24-to-be, once again, does not build on sparc64.
Here's the relevant part:
20:21:36 runner ['sparc64-linux-gnu-gcc', '-D_SAMBA_BUILD_=4',
'-DHAVE_CONFIG_H=1', '-g', '-O2',
'-Werror=implicit-function-declaration',
'-ffile-prefix-map=/build/reproducible-path/samba-4.24.0~rc2+dfsg=.',
'-fstack-protector-strong', '-Wformat', '-Werror=format-security',
'-ffile-prefix-map=../../=', '-MMD', '-D_GNU_SOURCE=1',
'-D_XOPEN_SOURCE_EXTENDED=1', '-fPIC', '-D__STDC_WANT_LIB_EXT1__=1',
'-D_REENTRANT', '-DCTDB_HELPER_BINDIR="/usr/libexec/ctdb"',
'-DLOGDIR="/var/log/ctdb"', '-DCTDB_DATADIR="/usr/share/ctdb"',
'-DCTDB_ETCDIR="/etc/ctdb"', '-DCTDB_VARDIR="/var/lib/ctdb"',
'-DCTDB_RUNDIR="/run/ctdb"', '-fstack-protector-strong',
'-fstack-clash-protection', '-DSTATIC_ctdb_conf_MODULES=NULL',
'-DSTATIC_ctdb_conf_MODULES_PROTO=extern void
__ctdb_conf_dummy_module_proto(void)', '-Ictdb', '-I../../ctdb',
'-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', '-I.', '-I../..',
'-Ilib/util/lib/util/debug-classes',
'-I../../lib/util/lib/util/debug-classes',
'-Ilib/util/build/reproducible-path/samba-4.24.0~rc2+dfsg/third_party/gpfs',
'-I../../lib/util/build/reproducible-path/samba-4.24.0~rc2+dfsg/third_party/gpfs',
'-Ilib/util/charset', '-I../../lib/util/charset', '-Ilib/talloc',
'-I../../lib/talloc', '-Ilib/tevent', '-I../../lib/tevent',
'-Ilibcli/util', '-I../../libcli/util', '-Ilib/async_req',
'-I../../lib/async_req', '-Idynconfig', '-I../../dynconfig',
'-Ilib/crypto', '-I../../lib/crypto', '-Ilib/tdb/include',
'-I../../lib/tdb/include', '-Ilib/tdb', '-I../../lib/tdb',
'-I/usr/include/p11-kit-1', '../../ctdb/conf/database_conf.c', '-c',
'-o/build/reproducible-path/samba-4.24.0~rc2+dfsg/bin/default/ctdb/conf/database_conf.c.13.o',
'-Wdate-time', '-D_FORTIFY_SOURCE=2']
In file included from ../../third_party/heimdal/lib/hx509/hx_locl.h:89,
from ../../source4/kdc/sdb_to_hdb.c:28:
../../third_party/heimdal/include/crypto-headers.h:5:2: error: #error
"need config.h"
5 | #error "need config.h"
| ^~~~~
I already worked around a very similar issue, which also happens on
sparc, - due to non-deterministic order of -I includes, and due to
the fact samba ships multiple copies of <gssapi/gssapi.h>, the wrong
header were included, and compilation didn't work (for details, see
https://bugs.debian.org/1013205
https://bugzilla.samba.org/show_bug.cgi?id=15080).
This bug isn't fixed still (and I had to rm one of gssapi/gssapi.h to
build 4.24.0, again).
Now, the situation is very similar. But just like with the previous
one, due to large number of -I dirs used by the samba build system, and
because it uses multiple files of the same name, it's quite difficult to
find out what's actually going on.
Also, it isn't even clear what the current directory is, while building
a particular build artifact. I'm assuming this one is built in
bin/default, but I might be wrong.
Out of the 2 config.h files in the samba build dir --
third_party/heimdal_build/config.h
bin/default/include/config.h
the second one is picked up, instead of the first. Because -Iinclude
goes before -I../../third_party/heimdal_build.
Now, I don't know how to fix or work-around this - for good.
On one hand, the build system itself is too flaky to use, it's been
said multiple times - there must be no reordering of arguments like
this in the first place, any dependency of hash function or hash
seed is definitely wrong. It is wrong not only because wrong
includes are being found, but also because wrong SYMBOLs are
being found - eg, when we replace a symbol in libreplace, but actual
libc-provided one is being used due to reordering - something like this
has happened before too. Build system must not reorder arguments,
period.
On the other hand, there must not be same-named include files like
in both these situations.
I think the best I can do here is to rename heimdai's config.h to
something like heimdal-config.h (patching all .c files which includes
it). Or maybe, do such rename too, and include heimdal-config.h from
samba's config.h - so both include files are always included.
Neither of these workarounds are good, but it should work.
Now, one might wonder - why do I care about sparc64 in the first
place? Well, at least because I dislike when my packages show
red in debian buildd status pages. But also this situation is
wrong regardless if it's sparc64 or not, really - we've a very
fragile build system which works just by accedent, not by design.
Thanks,
/mjt
More information about the samba-technical
mailing list