I'm using Arch linux and I need GCC 4.7.0 for a class.
I only have GCC 6.2.1 installed on my system currently.
I followed all the install instructions correctly but I still yield this error after running the initial make
.
$ make
.
.
In file included from /home/flounder/src/gcc-4.7.0/gcc-4.7.0/gcc/cp/except.c:987:0:
cfns.gperf: At top level:
cfns.gperf:101:1: error: ‘gnu_inline’ attribute present on ‘libc_name_p’
cfns.gperf:26:14: error: but not here
.
.
make[3]: *** [Makefile:1055: cp/except.o] Error 1
make[3]: Leaving directory '/home/flounder/src/gcc_compile/gcc'
make[2]: *** [Makefile:4101: all-stage1-gcc] Error 2
make[2]: Leaving directory '/home/flounder/src/gcc_compile'
make[1]: *** [Makefile:19342: stage1-bubble] Error 2
make[1]: Leaving directory '/home/flounder/src/gcc_compile'
make: *** [Makefile:898: all] Error 2
I've read that this can happen when trying to build old versions of GCC with modern versions because:
GCC adds new errors as versions go on, so the source code of older versions of GCC isn't always considered valid under newer versions of GCC
I read that here, here, and here.
So what can I do to remedy the issue?
Two possible solutions I think could work:
- Cross compile GCC 4.7.0 for my computer using the school Linux computers (which also have GCC 4.7.0 but they're 32-bit and I have a 64-bit OS)
- First compile GCC 5.4.x on my computer using GCC 6.2.1 then use GCC 5.4.x to compile GCC 4.7.0
The first option seems more bulletproof. Would they both work? Is one better than the other?
Edit:
As @Kenneth B. Jensen mentioned below, I attempted to run the configuration with the --disable-werror
flag set and attempted to run the initial make
with the -k
flag set but I still ran into trouble. The following is the error output:
$ make -k
.
.
.
if [ xinfo = xinfo ]; then \
makeinfo --split-size=5000000 --split-size=5000000 --split-size=5000000 --no-split -I . -I /home/flounder/src/gcc-4.7.0/gcc/doc \
-I /home/flounder/src/gcc-4.7.0/gcc/doc/include -o doc/cppinternals.info /home/flounder/src/gcc-4.7.0/gcc/doc/cppinternals.texi; \
fi
echo timestamp > gcc.pod
perl /home/flounder/src/gcc-4.7.0/gcc/../contrib/texi2pod.pl /home/flounder/src/gcc-4.7.0/gcc/doc/invoke.texi > gcc.pod
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\@strong{ <-- HERE (.*)}$/ at /home/flounder/src/gcc-4.7.0/gcc/../contrib/texi2pod.pl line 319.
echo timestamp > doc/gcc.1
(pod2man --center="GNU" --release="gcc-4.7.0" --date=2012-03-22 --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)
echo timestamp > gpl.pod
perl /home/flounder/src/gcc-4.7.0/gcc/../contrib/texi2pod.pl /home/flounder/src/gcc-4.7.0/gcc/doc/include/gpl_v3.texi > gpl.pod
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\@strong{ <-- HERE (.*)}$/ at /home/flounder/src/gcc-4.7.0/gcc/../contrib/texi2pod.pl line 319.
echo timestamp > doc/gpl.7
(pod2man --center="GNU" --release="gcc-4.7.0" --date=2012-03-22 --section=7 gpl.pod > doc/gpl.7.T$$ && \
mv -f doc/gpl.7.T$$ doc/gpl.7) || \
(rm -f doc/gpl.7.T$$ && exit 1)
cp doc/gcc.1 doc/g++.1
make[3]: Target 'all' not remade because of errors.
rm gcc.pod
make[3]: Leaving directory '/home/flounder/src/gcc_compile/gcc'
make[2]: *** [Makefile:4101: all-stage1-gcc] Error 2
make[2]: Target 'all-stage1' not remade because of errors.
make[2]: Leaving directory '/home/flounder/src/gcc_compile'
make[1]: *** [Makefile:19342: stage1-bubble] Error 2
make[1]: Target 'stage3-bubble' not remade because of errors.
make[1]: Leaving directory '/home/flounder/src/gcc_compile'
make: *** [Makefile:898: all] Error 2
-Werror
flag set (among others). I'm not sure if there are any scenario's where GCC 4.7.0 would throw a warning and GCC 6.2.1 would not but that would definitely be one example of why I'd like to use GCC 4.7.0 instead. Also, the class is an operating systems class, so there will be a large amount of threaded and concurrent programming.make distclean
as suggested in the installation documentation but still came about the errors posted above in the edit