GCC 6.3.0 Build error | target xg++: g++: fatal error: unknown spec function ‘gt’

Oliver Fernandes Oliver.Fernandes@visus.uni-stuttgart.de
Tue Feb 21 13:21:00 GMT 2017


Hello,

Im in no way an expert on any of this, so it might be something trivial, but I can't figure it out...
I'm trying to build gcc 6.3.0, but keep getting the following error:


[ -f stage_final ] || echo stage3 > stage_final
make[1]: Entering directory '/local/fernanor/software/gcc-6.3.0/build'
make[2]: Entering directory '/local/fernanor/software/gcc-6.3.0/build'
make[3]: Entering directory '/local/fernanor/software/gcc-6.3.0/build'
rm -f stage_current
make[3]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build'
make[2]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build'
make[2]: Entering directory '/local/fernanor/software/gcc-6.3.0/build'
make[3]: Entering directory '/local/fernanor/software/gcc-6.3.0/build/build-x86_64-pc-linux-gnu/libiberty'
make[3]: Entering directory '/local/fernanor/software/gcc-6.3.0/build/intl'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build/intl'
make[3]: Entering directory '/local/fernanor/software/gcc-6.3.0/build/libdecnumber'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build/libdecnumber'
make[4]: Entering directory '/local/fernanor/software/gcc-6.3.0/build/build-x86_64-pc-linux-gnu/libiberty/testsuite'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build/build-x86_64-pc-linux-gnu/libiberty/testsuite'
make[3]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build/build-x86_64-pc-linux-gnu/libiberty'
make[3]: Entering directory '/local/fernanor/software/gcc-6.3.0/build/libiberty'
make[3]: Entering directory '/local/fernanor/software/gcc-6.3.0/build/libbacktrace'
make[3]: Entering directory '/local/fernanor/software/gcc-6.3.0/build/zlib'
true "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-g" "CXXFLAGS=-g" "CFLAGS_FOR_BUILD=-g -O2" "CFLAGS_FOR_TARGET=-g -O2" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install  -c" "LDFLAGS=-static-libstdc++ -static-libgcc " "LIBCFLAGS=-g -O2" "LIBCFLAGS_FOR_TARGET=-g -O2" "MAKE=make" "MAKEINFO=/local/fernanor/software/gcc-6.3.0/missing makeinfo --split-size=5000000 --split-size=5000000 --split-size=5000000 " "PICFLAG=" "PICFLAG_FOR_TARGET="  "SHELL=/bin/bash" "EXPECT=expect" "RUNTEST=runtest" "RUNTESTFLAGS=" "exec_prefix=/usr" "infodir=/usr/share/info" "libdir=/usr/lib" "prefix=/usr" "tooldir=/usr/x86_64-pc-linux-gnu" "AR=ar" "AS=as" "CC=gcc" "CXX=g++ -std=gnu++98" "LD=ld" "LIBCFLAGS=-g -O2" "NM=nm"  "PICFLAG=" "RANLIB=ranlib" "DESTDIR=" DO=all multi-do # make
make  all-am
make[3]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build/zlib'
make[4]: Entering directory '/local/fernanor/software/gcc-6.3.0/build/libiberty/testsuite'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build/libiberty/testsuite'
make[4]: Entering directory '/local/fernanor/software/gcc-6.3.0/build/libbacktrace'
make[3]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build/libiberty'
true  DO=all multi-do # make
make[4]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build/libbacktrace'
make[3]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build/libbacktrace'
make[3]: Entering directory '/local/fernanor/software/gcc-6.3.0/build/build-x86_64-pc-linux-gnu/fixincludes'
make[3]: Entering directory '/local/fernanor/software/gcc-6.3.0/build/libcpp'
test -f config.h || (rm -f stamp-h1 && make stamp-h1)
make[3]: Entering directory '/local/fernanor/software/gcc-6.3.0/build/lto-plugin'
make[3]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build/libcpp'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build/build-x86_64-pc-linux-gnu/fixincludes'
make  all-am
make[4]: Entering directory '/local/fernanor/software/gcc-6.3.0/build/lto-plugin'
make[4]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build/lto-plugin'
make[3]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build/lto-plugin'
make[3]: Entering directory '/local/fernanor/software/gcc-6.3.0/build/build-x86_64-pc-linux-gnu/libcpp'
make[3]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build/build-x86_64-pc-linux-gnu/libcpp'
make[3]: Entering directory '/local/fernanor/software/gcc-6.3.0/build/gcc'
(echo "@set version-GCC 6.3.0"; \
 if [ "" = "experimental" ]; \
 then echo "@set DEVELOPMENT"; \
 else echo "@clear DEVELOPMENT"; \
 fi) > gcc-vers.texiT
echo @set srcdir /local/fernanor/software/gcc-6.3.0/build/gcc/../../gcc >> gcc-vers.texiT
if [ -n "(GCC) " ]; then \
  echo "@set VERSION_PACKAGE (GCC) " >> gcc-vers.texiT; \
fi
echo "@set BUGURL @uref{http://gcc.gnu.org/bugs.html}" >> gcc-vers.texiT; \
mv -f gcc-vers.texiT gcc-vers.texi
echo timestamp > gcc.pod
perl ../../gcc/../contrib/texi2pod.pl ../../gcc/doc/invoke.texi > gcc.pod
echo timestamp > doc/gcc.1
(pod2man --center="GNU" --release="gcc-6.3.0" --date=2016-12-21 --section=1 gcc.pod > doc/gcc.1.T$$ && \
        mv -f doc/gcc.1.T$$ doc/gcc.1) || \
        (rm -f doc/gcc.1.T$$ && exit 1)
cp doc/gcc.1 doc/g++.1
g++ -std=gnu++98 -no-pie   -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings  -fno-common  -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc  -o xg++ \
  gcc.o gcc-main.o ggc-none.o spellcheck.o cp/g++spec.o driver-i386.o  libcommon-target.a \
   libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a 
g++ -std=gnu++98 -fno-PIE -c  -DIN_GCC_FRONTEND -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros  -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -Ilto -I../../gcc -I../../gcc/lto -I../../gcc/../include -I../../gcc/../libcpp/include  -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace   -o  lto/lto-lang.o -MT lto/lto-lang.o -MMD -MP -MF lto/.deps/lto-lang.TPo ../../gcc/lto/lto-lang.c
g++ -std=gnu++98 -fno-PIE -c  -DIN_GCC_FRONTEND -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros  -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -Ilto -I../../gcc -I../../gcc/lto -I../../gcc/../include -I../../gcc/../libcpp/include  -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace   -o  lto/lto.o -MT lto/lto.o -MMD -MP -MF lto/.deps/lto.TPo ../../gcc/lto/lto.c
g++ -std=gnu++98 -fno-PIE -c  -DIN_GCC_FRONTEND -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros  -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -Ilto -I../../gcc -I../../gcc/lto -I../../gcc/../include -I../../gcc/../libcpp/include  -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace   -o  lto/lto-object.o -MT lto/lto-object.o -MMD -MP -MF lto/.deps/lto-object.TPo ../../gcc/lto/lto-object.c
g++ -std=gnu++98 -fno-PIE -c  -DIN_GCC_FRONTEND -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros  -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -Ilto -I../../gcc -I../../gcc/lto -I../../gcc/../include -I../../gcc/../libcpp/include  -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace   -o  lto/lto-partition.o -MT lto/lto-partition.o -MMD -MP -MF lto/.deps/lto-partition.TPo ../../gcc/lto/lto-partition.c
g++ -std=gnu++98 -fno-PIE -c  -DIN_GCC_FRONTEND -g -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros  -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -Ilto -I../../gcc -I../../gcc/lto -I../../gcc/../include -I../../gcc/../libcpp/include  -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace   -o  lto/lto-symtab.o -MT lto/lto-symtab.o -MMD -MP -MF lto/.deps/lto-symtab.TPo ../../gcc/lto/lto-symtab.c
g++: fatal error: unknown spec function ‘gt’
compilation terminated.
../../gcc/cp/Make-lang.in:59: recipe for target 'xg++' failed
make[3]: *** [xg++] Error 1
make[3]: *** Waiting for unfinished jobs....
rm gcc.pod
make[3]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build/gcc'
Makefile:4391: recipe for target 'all-stage1-gcc' failed
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build'
Makefile:21251: recipe for target 'stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory '/local/fernanor/software/gcc-6.3.0/build'
Makefile:913: recipe for target 'all' failed
make: *** [all] Error 2


I configured using:
../configure --prefix=/usr --disable-multilib --enable-languages=c,c++


Some other info you may need:
$ uname -a
Linux *** 4.4.0-63-generic #84-Ubuntu SMP Wed Feb 1 17:20:32 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ cat /proc/version
Linux version 4.4.0-63-generic (buildd@lcy01-31) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #84-Ubuntu SMP Wed Feb 1 17:20:32 UTC 2017

$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609

For all dependencies I installed the package currently available in the default repository.
Seems like Jorge D'Elia had the same problem, he got a script by someone, possibly fixing this, but the was no general solution. Also, he was building a different version of gcc.

Any pointers would be helpful!

Thanks,
Oliver Fernandes 

   


More information about the Gcc-help mailing list