Created attachment 914898 [details] build.log Found while testing GCC15 on alt arches, this was found in QEMU usermode. usr/m68k-unknown-linux-musl/bin/ -B/usr/m68k-unknown-linux-musl/lib/ -isystem /usr/m68k-unknown-linux-musl/include -isystem /usr/m68k-unknown-linux-musl/sys-include -fno-checking -DHAVE_CONFIG_H -I. -I/var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-15-20241222/libstdc++-v3/src/libbacktrace -I../.. -I /var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-15-20241222/libstdc++-v3/../include -I /var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-15-20241222/libstdc++-v3/../libgcc -I ../../../libgcc -I .. -I /var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-15-20241222/libstdc++-v3 -I /var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-15-20241222/libstdc++-v3/../libbacktrace -I /var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-15-20241222/libstdc++-v3/../libiberty -include /var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-15-20241222/libstdc++-v3/src/libbacktrace/backtrace-rename.h -D_GNU_SOURCE -DHAVE_ATOMIC_FUNCTIONS=1 -DHAVE_SYNC_FUNCTIONS=1 -DHAVE_DL_ITERATE_PHDR=1 -DHAVE_FCNTL=1 -DBACKTRACE_ELF_SIZE=32 -prefer-pic -D_GLIBCXX_SHARED -W -Wall -Wwrite-strings -Wmissing-format-attribute -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wno-unused-but-set-variable -funwind-tables -g -pipe -O2 -c -o std_stacktrace-cp-demangle.lo `test -f 'cp-demangle.c' || echo '/var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-15-20241222/libstdc++-v3/src/libbacktrace/'`cp-demangle.c libtool: compile: /var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/build/./gcc/ -B/usr/m68k-unknown-linux-musl/bin/ -B/usr/m68k-unknown-linux-musl/lib/ -isystem /usr/m68k-unknown-linux-musl/include -isystem /usr/m68k-unknown-linux-musl/sys-include -fno-checking -DHAVE_CONFIG_H -I. -I/var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-15-20241222/libstdc++-v3/src/libbacktrace -I../.. -I /var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-15-20241222/libstdc++-v3/../include -I /var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-15-20241222/libstdc++-v3/../libgcc -I ../../../libgcc -I .. -I /var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-15-20241222/libstdc++-v3 -I /var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-15-20241222/libstdc++-v3/../libbacktrace -I /var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-15-20241222/libstdc++-v3/../libiberty -include /var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-15-20241222/libstdc++-v3/src/libbacktrace/backtrace-rename.h -D_GNU_SOURCE -DHAVE_ATOMIC_FUNCTIONS=1 -DHAVE_SYNC_FUNCTIONS=1 -DHAVE_DL_ITERATE_PHDR=1 -DHAVE_FCNTL=1 -DBACKTRACE_ELF_SIZE=32 -D_GLIBCXX_SHARED -W -Wall -Wwrite-strings -Wmissing-format-attribute -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wno-unused-but-set-variable -funwind-tables -g -pipe -O2 -c cp-demangle.c -fPIC -DPIC -o .libs/std_stacktrace-cp-demangle.o In file included from cp-demangle.c:138: /var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-15-20241222/libstdc++-v3/../include/libiberty.h:112:14: error: conflicting types for 'basename'; have 'char *(const char *)' 112 | extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1); | ^~~~~~~~ In file included from cp-demangle.c:115: /usr/include/string.h:99:7: note: previous declaration of 'basename' with type 'char *(void)' 99 | char *basename(); | ^~~~~~~~ make[6]: *** [Makefile:625: std_stacktrace-cp-demangle.lo] Error 1
On second reading this looks like a musl issue, will confirm.
Confirmed on multiple arches musl only.
``` * Please include /var/tmp/portage/sys-devel/gcc-15.0.0_pre20241222/work/gcc-build-logs.tar.xz in your bug report. ``` is this musl-1.2.5? it'll work with that, I think, and fail with earlier (it's because of the basename hack in musl headers that went away in 1.2.5)
You are correct it does work with 1.2.5, I assumed incorrectly and jumped to a conclusion.
It is a real bug though and we should try to fix GCC to cope with older musl with C23.