Dear maintainer(s),
libnfs fails to build from source with glibc 2.43, currently in
experimental. From the build log:
| libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I/build/reproducible-path/libnfs-5.0.2/include -I/build/reproducible-path/libnfs-5.0.2/include/nfsc -I/build/reproducible-path/libnfs-5.0.2/mount -I/build/reproducible-path/libnfs-5.0.2/nfs -I/build/reproducible-path/libnfs-5.0.2/nfs4 -I/build/reproducible-path/libnfs-5.0.2/nlm -I/build/reproducible-path/libnfs-5.0.2/nsm -I/build/reproducible-path/libnfs-5.0.2/portmap -I/build/reproducible-path/libnfs-5.0.2/rquota -I/build/reproducible-path/libnfs-5.0.2/win32 "-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/libnfs-5.0.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -mbranch-protection=standard -c nfs_v3.c -fPIC -DPIC -o .libs/libnfs_la-nfs_v3.o
...
| nfs_v3.c: In function 'nfs3_mknod_async':
| nfs_v3.c:3231:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
| 3231 | ptr = strrchr(path, '/');
| | ^
| nfs_v3.c: In function 'nfs3_unlink_async':
| nfs_v3.c:3332:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
| 3332 | ptr = strrchr(path, '/');
| | ^
| nfs_v3.c: In function 'nfs3_create_async':
| nfs_v3.c:3598:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
| 3598 | ptr = strrchr(path, '/');
| | ^
| nfs_v3.c: In function 'nfs3_rmdir_async':
| nfs_v3.c:3698:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
| 3698 | ptr = strrchr(path, '/');
| | ^
| nfs_v3.c: In function 'nfs3_mkdir2_async':
| nfs_v3.c:3800:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
| 3800 | ptr = strrchr(path, '/');
| | ^
...
| cc1: all warnings being treated as errors
| libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I/build/reproducible-path/libnfs-5.0.2/include -I/build/reproducible-path/libnfs-5.0.2/include/nfsc -I/build/reproducible-path/libnfs-5.0.2/mount -I/build/reproducible-path/libnfs-5.0.2/nfs -I/build/reproducible-path/libnfs-5.0.2/nfs4 -I/build/reproducible-path/libnfs-5.0.2/nlm -I/build/reproducible-path/libnfs-5.0.2/nsm -I/build/reproducible-path/libnfs-5.0.2/portmap -I/build/reproducible-path/libnfs-5.0.2/rquota -I/build/reproducible-path/libnfs-5.0.2/win32 "-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/libnfs-5.0.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -mbranch-protection=standard -c nfs_v4.c -o libnfs_la-nfs_v4.o >/dev/null 2>&1
| make[3]: *** [Makefile:551: libnfs_la-nfs_v3.lo] Error 1
| make[3]: *** Waiting for unfinished jobs....
| make[3]: Leaving directory '/build/reproducible-path/libnfs-5.0.2/lib'
| make[2]: *** [Makefile:470: all-recursive] Error 1
| make[2]: Leaving directory '/build/reproducible-path/libnfs-5.0.2'
| make[1]: *** [Makefile:379: all] Error 2
| make[1]: Leaving directory '/build/reproducible-path/libnfs-5.0.2'
| dh_auto_build: error: make -j128 returned exit code 2
| make: *** [debian/rules:7: 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/libnfs_arm64.build
[2] https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=e271fb2e4d76903c77a302aaec1ca22ce31027d0;hb=f762ccf84f122d1354f103a151cba8bde797d521#l19