https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121147
--- Comment #14 from terryinzaghi <terryinzaghi at 163 dot com> --- (In reply to terryinzaghi from comment #13) > (In reply to Jonathan Wakely from comment #12) > > (In reply to Jonathan Wakely from comment #3) > > > As it says at https://gcc.gnu.org/wiki/InstallingGCC "If your build fails > > > and your configure command has lots of complicated options you should try > > > removing options and keep it simple. Do not add lots of configure options > > > you don't understand, they might be the reason your build fails." > > > > It also says not to use ./configure at that link (and in several other docs > > on the gcc website). > > > > > > > > FAILED0 : { > mkdir GCC15-INSTALL-FAILED > cd GCC15-INSTALL-FAILED > [wget ... AND extract] > > mkdir gcc15-build > mkdir gcc15-installed > /* > drwxr-xr-x 40 dev dev 4096 Apr 25 16:52 gcc-15.1.0 > drwxr-xr-x 2 root root 4096 Jul 19 00:28 gcc15-build > //---------------use a name gcc15-build different from build > drwxr-xr-x 2 root root 4096 Jul 19 00:29 gcc15-installed > */ > cd gcc15-build > /* > root@dev:/home/cu-lib/GCC15-INSTALL-FAILED/gcc15-build# ls -l > total 0 > root@dev:/home/cu-lib/GCC15-INSTALL-FAILED/gcc15-build# > */ > ../gcc-15.1.0/configure > --prefix=/home/cu-lib/GCC15-INSTALL-FAILED/gcc15-installed --disable-multilib > > /* > -rw-r--r-- 1 root root 29863 Jul 19 00:31 config.log > -rwxr-xr-x 1 root root 39053 Jul 19 00:31 config.status > -rw-r--r-- 1 root root 1038809 Jul 19 00:31 Makefile > */ > > make -j10 2>make-error.log > > /* > with error such like > ‘GATHER_STATISTICS’ was not declared in this > scope; did you mean > ‘GCC_STATISTICS’? > In file included from ../../gcc-15.1.0/gcc/system.h:730: > ../../gcc-15.1.0/gcc/../include/libiberty.h:112:14: error: > ambiguating new declaration of ‘char* basename(const char*)’ > 112 | extern char *basename (const char *) > ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1); > | ^~~~~~~~ > /usr/include/string.h:537:26: note: old declaration ‘const > char* basename(const char*)’ > 537 | extern "C++" const char *basename (const char > *__filename) > | ^~~~~~~~ > > */ > } > > FAILED1: { // WITHOUT > --prefix=/home/cu-lib/GCC15-INSTALL-TEST-FAILED1/gcc15-installed > > mkdir gcc15-build > /* > root@dev:/home/cu-lib/GCC15-INSTALL-TEST-FAILED1# ls -l > total 12 > drwxr-xr-x 2 root root 4096 Jul 19 00:39 gcc15-build > //---------------use a name gcc15-build different from build > drwxr-xr-x 40 dev dev 4096 Apr 25 16:52 gcc-15.1.0 > */ > cd gcc15-build/ > ../gcc-15.1.0/configure --disable-multilib > > make -j10 2>make-error.log > /* > with error such like > ‘GATHER_STATISTICS’ was not declared in this > scope; did you mean > ‘GCC_STATISTICS’? > In file included from ../../gcc-15.1.0/gcc/system.h:730: > ../../gcc-15.1.0/gcc/../include/libiberty.h:112:14: error: > ambiguating new declaration of ‘char* basename(const char*)’ > 112 | extern char *basename (const char *) > ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1); > | ^~~~~~~~ > /usr/include/string.h:537:26: note: old declaration ‘const > char* basename(const char*)’ > 537 | extern "C++" const char *basename (const char > *__filename) > */ > > } > > FAILED2: { > mkdir GCC15-INSTALL-USING-BUILD-DIR-NAMED-build > cd GCC15-INSTALL-USING-BUILD-DIR-NAMED-build > > mkdir build > mkdir installed > cd build/ > ../gcc-15.1.0/configure > --prefix=/home/cu-lib/GCC15-INSTALL-USING-BUILD-DIR-NAMED-build/installed > --disable-multilib > make -j10 2>make-error.log > /* > with error such like > ‘GATHER_STATISTICS’ was not declared in this > scope; did you mean > ‘GCC_STATISTICS’? > In file included from ../../gcc-15.1.0/gcc/system.h:730: > ../../gcc-15.1.0/gcc/../include/libiberty.h:112:14: error: > ambiguating new declaration of ‘char* basename(const char*)’ > 112 | extern char *basename (const char *) > ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1); > | ^~~~~~~~ > /usr/include/string.h:537:26: note: old declaration ‘const > char* basename(const char*)’ > 537 | extern "C++" const char *basename (const char > *__filename) > */ > } > > > FAILED3: { // WITHOUT > --prefix=/home/cu-lib/GCC15-INSTALL-USING-BUILD-DIR-NAMED-build/installed > > cd GCC15-INSTALL-USING-BUILD-DIR-NAMED-build > rm -r build > mkdir build > > rm -r installed > > cd build/ > ../gcc-15.1.0/configure --disable-multilib > make -j10 2>make-error.log > /* > with error such like > ‘GATHER_STATISTICS’ was not declared in this > scope; did you mean > ‘GCC_STATISTICS’? > In file included from ../../gcc-15.1.0/gcc/system.h:730: > ../../gcc-15.1.0/gcc/../include/libiberty.h:112:14: error: > ambiguating new declaration of ‘char* basename(const char*)’ > 112 | extern char *basename (const char *) > ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1); > | ^~~~~~~~ > /usr/include/string.h:537:26: note: old declaration ‘const > char* basename(const char*)’ > 537 | extern "C++" const char *basename (const char > *__filename) > */ > } > > > > [ > I remove the orignally installed gcc-13, > and switch gcc-14 to default > finally SUCCESS.... > I do NOT known what happened, it just success. > ] > > > SUCCESS0: { > mkdir GCC15 > cd GCC15 > [wget ... AND extract] > mkdir build > cd build > ../gcc-15.1.0/configure --disable-multilib > make -j10 2>make-error.log > > finally SUCCESS > } I change to another linux-pc, with the following (before install gcc-15) condition, it can success # uname -a Linux dli 6.8.0-52-generic #53-Ubuntu SMP PREEMPT_DYNAMIC Sat Jan 11 00:06:25 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux # ldd --version ldd (Ubuntu GLIBC 2.39-0ubuntu8.5) 2.39 Copyright (C) 2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper. # g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/14/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 14.2.0-4ubuntu2~24.04' --with-bugurl=file:///usr/share/doc/gcc-14/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2,rust --prefix=/usr --with-gcc-major-version-only --program-suffix=-14 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-14-ig5ci0/gcc-14-14.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-14-ig5ci0/gcc-14-14.2.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 14.2.0 (Ubuntu 14.2.0-4ubuntu2~24.04) mkdir build cd build ../gcc-15.1.0/configure --disable-multilib make -j8
