According to the CI results, gcc-4.8 hasn’t built successfuly in a while:
I was able to fix the current build failure:
Toggle snippet (6 lines)
In file included from ../../gcc-4.8.5/gcc/cp/except.c:1008:0:
cfns.gperf: In function ‘const char* libc_name_p(const char*, unsigned int)’:
cfns.gperf:101:1: error: ‘const char* libc_name_p(const char*, unsigned int)’ redeclared inline with ‘gnu_inline’ attribute
cfns.gperf:26:14: note: ‘const char* libc_name_p(const char*, unsigned int)’ previously declared here
by backporting a patch from GCC 4.9 (which I will send in the next email),
but then I hit another failure:
Toggle snippet (20 lines)
In file included from /tmp/guix-build-gcc-4.8.5.drv-0/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/cstdlib:72:0,
/gnu/store/358n1m2c8fbn6nr1mib4racjh7wfqfmy-gcc-10.3.0/include/c++/stdlib.h:38:12: error: ‘std::abort’ has not been declared
/gnu/store/358n1m2c8fbn6nr1mib4racjh7wfqfmy-gcc-10.3.0/include/c++/stdlib.h:39:12: error: ‘std::atexit’ has not been declared
/gnu/store/358n1m2c8fbn6nr1mib4racjh7wfqfmy-gcc-10.3.0/include/c++/stdlib.h:40:12: error: ‘std::exit’ has not been declared
/gnu/store/358n1m2c8fbn6nr1mib4racjh7wfqfmy-gcc-10.3.0/include/c++/stdlib.h:51:12: error: ‘std::div_t’ has not been declared
/gnu/store/358n1m2c8fbn6nr1mib4racjh7wfqfmy-gcc-10.3.0/include/c++/stdlib.h:52:12: error: ‘std::ldiv_t’ has not been declared
and so on, for several `std::` functions. Unlike the other old GCC build
failures I’ve investigated recently, I couldn’t find anyone else hitting
this specific problem. So we would have to create our own patch to fix it.
This message from Jakub Jelinek about a similar error in some unspecified
makes me think that there’s something in GCC 4.8’s libstdc++ (probably
in libsupc++) doing something wrong with <stdlib.h> which trips GCC 6
However, I don’t think it’s worth making GCC 4.8 build again. It’s not
supported upstream anymore and if it’s needed in some bootstrap path,
it’s better to move it to ‘(gnu packages commencement)’ instead. In that
case, instead of fixing this build issue it’s likely better to just build
it with a GCC older than version 6.
Is it needed for bootstrap though? The definition of ‘%bootstrap-gcc’
suggests that it’s needed at least for armhf-linux but since aarch64-linux,
powerpc64le-linux and even i586-hurd use GCC 5.5, I suspect it would also
work for armhf-linux as well.
Therefore, my suggestion is to simply remove gcc-4.8.