#1128682 libsmb2: FTBFS with glibc 2.43 due to ISO C23 const return types

Package:
src:libsmb2
Source:
src:libsmb2
Submitter:
Aurelien Jarno
Date:
2026-08-12 13:37:02 UTC
Severity:
normal
Tags:
#1128682#5
Date:
2026-02-22 12:32:31 UTC
From:
To:
Dear maintainer(s),

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

| /bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I/build/reproducible-path/libsmb2-6.2+dfsg/include -I/build/reproducible-path/libsmb2-6.2+dfsg/include/smb2 "-D_U_=__attribute__((unused))" -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wshadow -Wno-write-strings -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wno-strict-aliasing -Werror -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/libsmb2-6.2+dfsg=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -mbranch-protection=standard -D_FILE_OFFSET_BITS=64 -c -o libsmb2_la-init.lo `test -f 'init.c' || echo './'`init.c

...

| libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I/build/reproducible-path/libsmb2-6.2+dfsg/include -I/build/reproducible-path/libsmb2-6.2+dfsg/include/smb2 "-D_U_=__attribute__((unused))" -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wshadow -Wno-write-strings -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wno-strict-aliasing -Werror -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/libsmb2-6.2+dfsg=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -mbranch-protection=standard -D_FILE_OFFSET_BITS=64 -c init.c  -fPIC -DPIC -o .libs/libsmb2_la-init.o

...

| init.c: In function 'smb2_parse_args':
| init.c:92:22: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
|    92 |                 next = strchr(args, '&');
|       |                      ^
| init.c:97:23: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
|    97 |                 value = strchr(args, '=');
|       |                       ^

| make[3]: *** [Makefile:721: libsmb2_la-init.lo] Error 1
| make[3]: *** Waiting for unfinished jobs....
| make[3]: Leaving directory '/build/reproducible-path/libsmb2-6.2+dfsg/lib'
| make[2]: *** [Makefile:464: all-recursive] Error 1
| make[2]: Leaving directory '/build/reproducible-path/libsmb2-6.2+dfsg'
| make[1]: *** [Makefile:373: all] Error 2
| make[1]: Leaving directory '/build/reproducible-path/libsmb2-6.2+dfsg'
| dh_auto_build: error: make -j128 returned exit code 2
| make: *** [debian/rules:6: binary] Error 25
| 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 ISO C23 declaration of bsearch, memchr, strchr,
strpbrk, strrchr, strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr,
which now returns a pointer to a const-qualified type when the input
argument is a pointer to a const-qualified type [2].

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/libsmb2_arm64.build
[2] https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=e271fb2e4d76903c77a302aaec1ca22ce31027d0;hb=f762ccf84f122d1354f103a151cba8bde797d521#l19

#1128682#14
Date:
2026-08-10 12:44:53 UTC
From:
To:
control: severity 1127629 serious
control: severity 1128547 serious
control: severity 1128734 serious
control: severity 1128740 serious
control: severity 1128528 serious
control: severity 1128532 serious
control: severity 1128534 serious
control: severity 1128541 serious
control: severity 1128544 serious
control: severity 1128545 serious
control: severity 1128548 serious
control: severity 1128549 serious
control: severity 1128551 serious
control: severity 1128615 serious
control: severity 1128678 serious
control: severity 1128680 serious
control: severity 1128681 serious
control: severity 1128697 serious
control: severity 1128736 serious
control: severity 1128737 serious
control: severity 1128738 serious
control: severity 1128741 serious
control: severity 1128742 serious
control: severity 1128743 serious
control: severity 1128750 serious
control: severity 1128757 serious
control: severity 1128761 serious
control: severity 1128763 serious
control: severity 1128764 serious
control: severity 1128875 serious
control: severity 1128952 serious
control: severity 1128542 serious
control: severity 1128679 serious
control: severity 1128682 serious
control: severity 1128744 serious
control: severity 1128748 serious
control: severity 1128867 serious

Hi,

With the upload of glibc 2.43 to unstable, the packages now FTBFS in
unstable, hence upgrading the severity to serious.

Note that as a quick workaround, it is possible to roll back to C/C++17
standard using -std=c17, -std=gnu17, std=c++17 or std=gnu++17. This was
the default up to GCC 14, and GCC 15 changed it to C/C23.

Regards
Aurelien

#1128682#19
Date:
2026-08-12 13:35:03 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
libsmb2, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1128682@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matheus Polkorny <mpolkorny@gmail.com> (supplier of updated libsmb2 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Wed, 12 Aug 2026 00:31:20 -0300
Source: libsmb2
Architecture: source
Version: 6.2+dfsg-4
Distribution: unstable
Urgency: medium
Maintainer: Debian Security Tools <team+pkg-security@tracker.debian.org>
Changed-By: Matheus Polkorny <mpolkorny@gmail.com>
Closes: 1128682
Changes:
 libsmb2 (6.2+dfsg-4) unstable; urgency=medium
 .
   * d/control:
     - Bump Standards Version to 4.7.4
     - Remove redundant Priority field
     - Remove redundant Rules-Requires-Root field
   * d/p/fix-discarded-const-warning.patch: New upstream patch
     - (Closes: #1128682)
Checksums-Sha1:
 b7babe453cbe9ad4ee2352d46a740119429c6650 2044 libsmb2_6.2+dfsg-4.dsc
 4590ab5c09508dc3c96c19e5cd33614d5f8571a9 19168 libsmb2_6.2+dfsg-4.debian.tar.xz
 98def015d9b60443cabcbbc43f3c80cf75762e4e 7155 libsmb2_6.2+dfsg-4_arm64.buildinfo
Checksums-Sha256:
 98b1da9f537d4c61491fd1654c478d6848e46b3a60b6dc80cfe613a309ed437d 2044 libsmb2_6.2+dfsg-4.dsc
 ce71bfe4380104fc13d56c9f5cd2391a7418a147955cb5d17d159184b13a70bf 19168 libsmb2_6.2+dfsg-4.debian.tar.xz
 1ee66aabc4a8bf76e448824cb002713f60687f4f0e01431a74f4c4f9a3f5ae03 7155 libsmb2_6.2+dfsg-4_arm64.buildinfo
Files:
 65bc2ab238196e98c222c650e848f29a 2044 libs optional libsmb2_6.2+dfsg-4.dsc
 7e359189e2385796a0f8330e72239bf5 19168 libs optional libsmb2_6.2+dfsg-4.debian.tar.xz
 7644fda06e68c8e4d2b2a99f89ee1e1a 7155 libs optional libsmb2_6.2+dfsg-4_arm64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJIBAEBCgAyFiEEcRD/fHLtdypUR2KKShyoWjj77loFAmp8cawUHG1wb2xrb3Ju
eUBnbWFpbC5jb20ACgkQShyoWjj77lqz9BAAmLhCf1BM6AGpUntd3iXkHbcgXieJ
bLqOKd6z2f61x1gq2aUdsyibVdfZwtPGk8nHETqBfqJor+GjLXNLwPoEAf8xy2o1
83wRBjzB4c8WZwRM5kvD2XhnvJfA1RJVLn7EBNW3sRBJ3XQpISmdZHyXbn7uu/eL
ApS0v1/6vc3FMIQlHUyke8ZkEyzHK1lY+M5m/+Cr5YemLT31rd9Lklkhi9ZpJKXL
G45o6+44ZCwu/uYu41UEol66iJMaMoBYkmfRhYzu1VkVSPM+I6NUHnue0i79ueTs
IXOEt8rbI2laLV1sz0UEC1doMebeY33fk2TI94apgIv+jJfAgQ7PCx/2INFd4wVC
lmFhJxRrI4dqB98RdXQ8Bgn1vRUr17nSPrp807R0wgc/az2d4lf6njTJ2dwr2lGg
NuFu8xXndQifm7BbiNPThcXcYCzI8iMsMCg0lkmJ00TFXNnevibzBLxEhjMi4Lgj
bAEYGvYkWOr9Vi+rfAJdIxSGBVcl9Datou2qilvAIG7igpIQpZOiqoDfS5BPi++S
zajTgaBrhtQLAG5sRPhNIQ/sr0YloZd+KQBLJPHYMjKY35f3NdEpBSOA5tRNeQQw
K7jQ5mso3GvK/3pNYx0LoOr/IxojsAE31GHoMhXwaQ+/kdauIvICj923e0iye+vy
lIubncpjKeaxXOM=
=/x7d
-----END PGP SIGNATURE-----