https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121147
--- Comment #13 from terryinzaghi <terryinzaghi at 163 dot com> --- (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 }
