0

I am trying to install GCC4.8.5 under CentOS 8 using GCC 8.5. Here's what I did

Get the compiler and its dependencies

wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.8.5/gcc-4.8.5.tar.gz
tar zxf gcc-4.8.5.tar.gz
cd gcc-4.8.5
./contrib/download_prerequisites

Patch the file as described here: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=ec1cc0263f156f70693a62cf17b254a0029f4852

Configure and make

mkdir gcc-build-4.8.5
cd gcc-build-4.8.5
../configure --prefix=/usr/local/gcc4.8.5 --enable-checking=release --enable-languages=c,c++ --disable-multilib
make

The whole thing fails on the MAKE step with the following error:

checking how to run the C preprocessor... (cached) /BioDB2/wgf/software/gcc-4.8.5/gcc-build-4.8.5/./gcc/xgcc -B/BioDB2/wgf/software/gcc-4.8.5/gcc-build-4.8.5/./gcc/ -B/usr/local/gcc4.8.5/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gcc4.8.5/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gcc4.8.5/x86_64-unknown-linux-gnu/include -isystem /usr/local/gcc4.8.5/x86_64-unknown-linux-gnu/sys-include    -E
configure: error: in `/BioDB2/wgf/software/gcc-4.8.5/gcc-build-4.8.5/x86_64-unknown-linux-gnu/libgcc':
configure: error: C preprocessor "/BioDB2/wgf/software/gcc-4.8.5/gcc-build-4.8.5/./gcc/xgcc -B/BioDB2/wgf/software/gcc-4.8.5/gcc-build-4.8.5/./gcc/ -B/usr/local/gcc4.8.5/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gcc4.8.5/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gcc4.8.5/x86_64-unknown-linux-gnu/include -isystem /usr/local/gcc4.8.5/x86_64-unknown-linux-gnu/sys-include    -E" fails sanity check
See `config.log' for more details
make[2]: *** [Makefile:17330: configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory '/BioDB2/wgf/software/gcc-4.8.5/gcc-build-4.8.5'
make[1]: *** [Makefile:21493: stage1-bubble] Error 2
make[1]: Leaving directory '/BioDB2/wgf/software/gcc-4.8.5/gcc-build-4.8.5'
make: *** [Makefile:892: all] Error 2

I checked the config.log

configure:4939: checking whether g++ accepts -static-libstdc++ -static-libgcc
configure:4956: g++ -o conftest -g -O2   -static-libstdc++ -static-libgcc conftest.cpp  >&5
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
configure:4956: $? = 1
configure: failed program was:
/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
/* end confdefs.h.  */
#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
#error -static-libstdc++ not implemented

then I use the command to install the dependencies:

yum install -y libstdc++*

and after that, I reconfigure and make,but it still failed and the error is same as before

Could you help me to figure how to overcome this issue? Thanks

5
  • Note the suggestion See config.log' for more details`. Commented Mar 9, 2022 at 5:21
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Commented Mar 9, 2022 at 5:21
  • The config.log file said /usr/bin/ld: cannot find -lstdc++, then I install the lib using yum install -y libstdc++*,but it still failed and the error is same as before@mashuptwice Commented Mar 9, 2022 at 7:56
  • do you have g++ compiler instlled? Commented Mar 9, 2022 at 11:00
  • yes, when I use yum install gcc-c++ , it said Package gcc-c++-8.5.0-4.el8_5.x86_64 is already installed. Dependencies resolved. Nothing to do. Complete!@Vaibhav.c Commented Mar 10, 2022 at 2:14

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.