GCC 8.5를 사용하여 CentOS 8에 GCC4.8.5를 설치하려고 합니다. 이게 내가 한 일이야
컴파일러 및 해당 종속성 가져오기
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
여기에 설명된 대로 파일을 패치합니다. https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=ec1cc0263f156f70693a62cf17b254a0029f4852
구성 및 제작
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
다음 오류로 인해 MAKE 단계에서 전체 프로세스가 실패합니다.
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
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
그런 다음 다음 명령을 사용하여 종속성을 설치합니다.
yum install -y libstdc++*
그 후 재구성하고 만들었지만 여전히 이전과 같은 오류로 인해 실패합니다.
이 문제를 극복하는 방법을 생각하도록 도와주실 수 있나요? 감사해요