Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install GCC 4.9.3
#!/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
@aia-simps
Copy link

aia-simps commented Jul 17, 2018

what is the approximate run time of this script?

Loading

@markroxor
Copy link

markroxor commented Jul 20, 2018

@bloddie it mostly depends on your network speed.

Loading

@LmarLoe
Copy link

LmarLoe commented Jul 22, 2018

Failed with error cfns.gperf:101:1: error: 'const char* libc_name_p(const char*, unsigned int)' redeclared inline with 'gnu_inline' attribute

Loading

@NahidHosseinzadeh
Copy link

NahidHosseinzadeh commented Sep 15, 2018

following this:
cd objdir
../gcc-4.9.3/configure --prefix=$HOME/gcc-4.9.3 --enable-languages=c,c++,fortran,go --disable-multilib
make
confronted numerous warning in different run steps like:
"invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]"
and ended to the error:
"cfns.gperf:26:14: warning: inline function ‘const char* libc_name_p(const char*, unsigned int)’ used but never defined
Makefile:1058: recipe for target 'cp/except.o' failed
make[3]: *** [cp/except.o] Error 1
make[3]: Leaving directory '/home/user/objdir/gcc'
Makefile:4233: recipe for target 'all-stage1-gcc' failed
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory '/home/user/objdir'
Makefile:24345: recipe for target 'stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory '/home/user/objdir'
Makefile:900: recipe for target 'all' failed
make: *** [all] Error 2"

Loading

@anjalishenoy
Copy link

anjalishenoy commented Mar 27, 2019

Facing the same issue as @NahidHosseinzadeh
Did you find a solution for this?

Loading

@aryan57
Copy link

aryan57 commented Mar 1, 2020

Capture

can u help me with this error ('.' is not recognized as an internal or external command,operable program or batch file.)

Loading

@felipekm
Copy link

felipekm commented Mar 19, 2020

@aryan57 These commands are for bash systems, not for Windows based.

Loading

@bits-byte
Copy link

bits-byte commented Mar 19, 2020

@anjalishenoy
Did you find some soultion ?

Facing the same issue as @NahidHosseinzadeh
Did you find a solution for this?

Loading

@andybe
Copy link

andybe commented May 20, 2020

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.

Loading

@mehmetkuckgtu
Copy link

mehmetkuckgtu commented Jun 4, 2020

../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

Loading

@Athulia567
Copy link

Athulia567 commented Dec 4, 2020

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

Loading

@nmathewa
Copy link

nmathewa commented Aug 7, 2021

Actually the script looks pretty fine. But it failed with multiple errors. I have tried multiple GCC versions

Loading

@nmathewa
Copy link

nmathewa commented Aug 7, 2021

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

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment