Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 946956 - sys-devel/gcc-15.0.0_pre20241222 musl - 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);
Summary: sys-devel/gcc-15.0.0_pre20241222 musl - libstdc++-v3/../include/libiberty.h:1...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: c23-porting gcc-15
  Show dependency tree
 
Reported: 2024-12-26 21:04 UTC by immolo
Modified: 2024-12-27 06:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (gcc15-m68k-build.log.xz,69.19 KB, application/x-xz)
2024-12-26 21:04 UTC, immolo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description immolo 2024-12-26 21:04:50 UTC
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
Comment 1 immolo 2024-12-26 21:42:26 UTC
On second reading this looks like a musl issue, will confirm.
Comment 2 immolo 2024-12-27 00:51:24 UTC
Confirmed on multiple arches musl only.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-27 05:06:43 UTC
```
 * 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)
Comment 4 immolo 2024-12-27 06:12:30 UTC
You are correct it does work with 1.2.5, I assumed incorrectly and jumped to a conclusion.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-27 06:16:11 UTC
It is a real bug though and we should try to fix GCC to cope with older musl with C23.