[Pkg-samba-maint] Bug#1128849: samba: FTBFS with glibc 2.43 due to openat2 redefinition

Aurelien Jarno aurel32 at debian.org
Mon Feb 23 17:08:53 GMT 2026


Source: samba
Version: 2:4.23.5+dfsg-1
Severity: important
Tags: ftbfs
Justification: fails to build from source
User: debian-glibc at lists.debian.org
Usertags: glibc-2.43

Dear maintainer(s),

samba fails to build from source with glibc 2.43, currently in
experimental. From the build log:

| 09:34:07 runner ['aarch64-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.23.5+dfsg=.', '-fstack-protector-strong', '-fstack-clash-protection', '-Wformat', '-Werror=format-security', '-mbranch-protection=standard', '-ffile-prefix-map=../../=', '-MMD', '-D_GNU_SOURCE=1', '-D_XOPEN_SOURCE_EXTENDED=1', '-D_SAMBA_HOSTCC_', '-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', '-Wno-error=cast-qual', '-Wno-error=discarded-qualifiers', '-Wno-error=old-style-definition', '-Wno-error=unused-result', '-Wno-error=unused-variable', '-Wno-strict-overflow', '-Wno-error=strict-prototypes', '-Wno-error=implicit-fallthrough', '-DSTATIC_compile_et_MODULES=NULL', '-DSTATIC_compile_et_MODULES_PROTO=extern void __compile_et_dummy_module_proto(void)', '-Ithird_party/heimdal_build', '-I../../third_party/heimdal_build', '-Ithird_party/heimdal/lib/com_err', '-I../../third_party/heimdal/lib/com_err', '-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', '-Ictdb', '-I../../ctdb', '-I.', '-I../..', '-Ithird_party/heimdal/lib/roken', '-I../../third_party/heimdal/lib/roken', '-Ithird_party/heimdal/include', '-I../../third_party/heimdal/include', '-Ithird_party/heimdal_build/include', '-I../../third_party/heimdal_build/include', 'third_party/heimdal_build/compile_et.objlist.empty.c', '-c', '-o/build/reproducible-path/samba-4.23.5+dfsg/bin/default/third_party/heimdal_build/compile_et.objlist.empty.c.126.o', '-Wdate-time', '-D_FORTIFY_SOURCE=2']
| In file included from ../../lib/replace/replace.c:28:
| ../../lib/replace/system/filesys.h:278:20: error: conflicting types for ‘openat2’; have ‘long int(int,  const char *, struct open_how *, size_t)’ {aka ‘long int(int,  const char *, struct open_how *, long unsigned int)’}
|   278 | static inline long openat2(int dirfd, const char *pathname,
|       |                    ^~~~~~~
| In file included from /usr/include/aarch64-linux-gnu/bits/fcntl-linux.h:492,
|                  from /usr/include/aarch64-linux-gnu/bits/fcntl.h:55,
|                  from /usr/include/fcntl.h:35,
|                  from /usr/include/aarch64-linux-gnu/sys/file.h:24,
|                  from ../../lib/replace/system/filesys.h:86:
| /usr/include/aarch64-linux-gnu/bits/fcntl-linux-fortify.h:36:1: note: previous definition of ‘openat2’ with type ‘int(int,  const char *, const struct open_how *, long unsigned int)’
|    36 | openat2 (int __dfd, const char *__filename, const struct open_how *__how,
|       | ^~~~~~~
| 
| In file included from ../../third_party/heimdal_build/replace.c:26:
| ../../lib/replace/system/filesys.h:278:20: error: conflicting types for ‘openat2’; have ‘long int(int,  const char *, struct open_how *, size_t)’ {aka ‘long int(int,  const char *, struct open_how *, long unsigned int)’}
|   278 | static inline long openat2(int dirfd, const char *pathname,
|       |                    ^~~~~~~
| In file included from /usr/include/aarch64-linux-gnu/bits/fcntl-linux.h:492,
|                  from /usr/include/aarch64-linux-gnu/bits/fcntl.h:55,
|                  from /usr/include/fcntl.h:35,
|                  from ../../third_party/heimdal_build/../heimdal/lib/roken/roken.h.in:329,
|                  from ../../third_party/heimdal_build/roken.h:160,
|                  from ../../third_party/heimdal_build/replace.c:25:
| /usr/include/aarch64-linux-gnu/bits/fcntl-linux-fortify.h:36:1: note: previous definition of ‘openat2’ with type ‘int(int,  const char *, const struct open_how *, long unsigned int)’
|    36 | openat2 (int __dfd, const char *__filename, const struct open_how *__how,
|       | ^~~~~~~
| 
| third_party/heimdal/lib/com_err/parse.tab.c: In function ‘name2number’:
| third_party/heimdal/lib/com_err/parse.tab.c:1408:19: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|  1408 |         char *q = strchr(x, *p);
|       |                   ^~~~~~
| third_party/heimdal/lib/com_err/parse.tab.c: In function ‘yyparse’:
| third_party/heimdal/lib/com_err/parse.tab.c:1157:21: warning: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
|  1157 |                     asprintf (&prefix, "%s_", (yyvsp[0].string));
|       |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| third_party/heimdal/lib/com_err/parse.tab.c:1183:25: warning: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
|  1183 |                         asprintf (&ec->name, "%s%s", prefix, (yyvsp[-2].string));
|       |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 
| Waf: Leaving directory `/build/reproducible-path/samba-4.23.5+dfsg/bin/default'
| Build failed
|  -> task in 'LIBREPLACE_HOSTCC' failed with exit status 1: 
| 	{task 267355802919872: c replace.c -> replace.c.1.o}
| ['aarch64-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.23.5+dfsg=.', '-fstack-protector-strong', '-fstack-clash-protection', '-Wformat', '-Werror=format-security', '-mbranch-protection=standard', '-ffile-prefix-map=../../=', '-MMD', '-D_GNU_SOURCE=1', '-D_XOPEN_SOURCE_EXTENDED=1', '-D_SAMBA_HOSTCC_', '-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_LIBREPLACE_HOSTCC_MODULES=NULL', '-DSTATIC_LIBREPLACE_HOSTCC_MODULES_PROTO=extern void __LIBREPLACE_HOSTCC_dummy_module_proto(void)', '-Ilib/replace', '-I../../lib/replace', '-Iinclude/public', '-I../../include/public', '-Isource4', '-I../../source4', '-Ilib', '-I../../lib', '-Isource4/lib', '-I../../source4/lib', '-Isource4/include', '-I../../source4/include', '-Iinclude', '-I../../include', '-Ictdb/include', '-I../../ctdb/include', '-Ictdb', '-I../../ctdb', '-I.', '-I../..', '../../lib/replace/replace.c', '-c', '-o/build/reproducible-path/samba-4.23.5+dfsg/bin/default/lib/replace/replace.c.1.o', '-Wdate-time', '-D_FORTIFY_SOURCE=2']
|  -> task in 'ROKEN_HOSTCC' failed with exit status 1: 
| 	{task 267355802917856: c replace.c -> replace.c.4.o}
| ['aarch64-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.23.5+dfsg=.', '-fstack-protector-strong', '-fstack-clash-protection', '-Wformat', '-Werror=format-security', '-mbranch-protection=standard', '-ffile-prefix-map=../../=', '-MMD', '-D_GNU_SOURCE=1', '-D_XOPEN_SOURCE_EXTENDED=1', '-D_SAMBA_HOSTCC_', '-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', '-Wno-error=cast-qual', '-Wno-error=discarded-qualifiers', '-Wno-error=old-style-definition', '-Wno-error=unused-result', '-Wno-error=unused-variable', '-DSTATIC_ROKEN_HOSTCC_MODULES=NULL', '-DSTATIC_ROKEN_HOSTCC_MODULES_PROTO=extern void __ROKEN_HOSTCC_dummy_module_proto(void)', '-Ithird_party/heimdal_build', '-I../../third_party/heimdal_build', '-Ithird_party/heimdal/lib/roken', '-I../../third_party/heimdal/lib/roken', '-Ithird_party/heimdal/include', '-I../../third_party/heimdal/include', '-Ithird_party/heimdal_build/include', '-I../../third_party/heimdal_build/include', '-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', '-Ictdb', '-I../../ctdb', '-I.', '-I../..', '../../third_party/heimdal_build/replace.c', '-c', '-o/build/reproducible-path/samba-4.23.5+dfsg/bin/default/third_party/heimdal_build/replace.c.4.o', '-Wdate-time', '-D_FORTIFY_SOURCE=2']
| make[2]: *** [debian/rules:217: bin/built.stamp] Error 1
| make[2]: Leaving directory '/build/reproducible-path/samba-4.23.5+dfsg'
| make[1]: *** [debian/rules:188: install] Error 2
| make[1]: Leaving directory '/build/reproducible-path/samba-4.23.5+dfsg'
| make: *** [debian/rules:188: binary] Error 2
| dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2

The full build log is available here [1].

The issue is due to a definition of the openat2 function, which is now
also provided by glibc 2.43 [2]. This issue is not present upstream and
is introduced by debian/patches/inline-openat2.diff. Removing this patch
is enough to get samba built with glibc 2.43.

I would like to thanks Emanuele Rocca for doing the archive rebuild on a
fast arm64 server.

Regards
Aurelien

[1] https://people.debian.org/~ema/glibc-2.43-rebuilds/output-1/samba_arm64.build
[2] https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=e271fb2e4d76903c77a302aaec1ca22ce31027d0;hb=f762ccf84f122d1354f103a151cba8bde797d521#l54

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien at aurel32.net                     http://aurel32.net



More information about the Pkg-samba-maint mailing list