-
-
Save jtilly/2827af06e331e8e6b53c to your computer and use it in GitHub Desktop.
#!/bin/bash | |
# this script installs GCC 4.9.3 | |
# to use it navigate to your home directory and type: | |
# sh install-gcc-4.9.3.sh | |
# download and install gcc 4.9.3 | |
wget https://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.gz | |
tar xzf gcc-4.9.3.tar.gz | |
cd gcc-4.9.3 | |
./contrib/download_prerequisites | |
cd .. | |
mkdir objdir | |
cd objdir | |
../gcc-4.9.3/configure --prefix=$HOME/gcc-4.9.3 --enable-languages=c,c++,fortran,go --disable-multilib | |
make | |
# install | |
make install | |
# clean up | |
rm -rf ~/objdir | |
rm -f ~/gcc-4.9.3.tar.gz | |
# add to path (you may want to add these lines to $HOME/.bash_profile) | |
export PATH=$HOME/gcc-4.9.3/bin:$PATH | |
export LD_LIBRARY_PATH=$HOME/gcc-4.9.3/lib:$HOME/gcc-4.9.3/lib64:$LD_LIBRARY_PATH |
../gcc-4.9.3/configure --prefix=$HOME/gcc-4.9.3 --enable-languages=c,c++,fortran,go --disable-multilib
gave such an error
configure error : in '.../objdır':
configure error: no acceptable c compiler found in $path
i don't have apt-get, apt
Failed with this error :
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
cfns.gperf: At global scope:
cfns.gperf:26:14: warning: inline function ‘const char* libc_name_p(const char*, unsigned int)’ used but never defined
make[3]: *** [cp/except.o] Error 1
Actually the script looks pretty fine. But it failed with multiple errors. I have tried multiple GCC versions
Failed with this error :
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
cfns.gperf: At global scope:
cfns.gperf:26:14: warning: inline function ‘const char* libc_name_p(const char*, unsigned int)’ used but never defined
make[3]: *** [cp/except.o] Error 1
work with two patches (with gcc 9.4.0, ubuntu 20.04):
... and if you have some problems with sanitizer lib, you can make with --disable-libsanitizer , but it should be a patch for this (it is here: https://reviews.llvm.org/D47281 , but does not work with my configuration).
To speak in pricipals:
You need a working gcc. Bootstrap is also not done. Bad thing. It's to simple...works on his computer only.