Installing GCC: Manual One
============
First decide on a prefix directory (installation dir)
export $P=that dir path
export $PREFIX=that dir path
Install GMP first
============
with:
wget http://ftp.gnu.org/gnu/gmp/gmp-5.0.5.tar.bz2 tar -jxvvf gmp-5.0.5.tar.bz2 cd gmp-5.0.5 ./configure --prefix=$P --enable-cxx make ; make install export LD_LIBRARY_PATH=/home/users/d/dr/droidzone/hostusr/lib export LD_RUN_PATH=/home/users/d/dr/droidzone/hostusr/lib cd ..
Note the following compiler message:
Libraries have been installed in:
/home/droidzone/buildtools/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:
– add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
during execution
– add LIBDIR to the `LD_RUN_PATH’ environment variable
during linking
– use the `-Wl,-rpath -Wl,LIBDIR’ linker flag
– have your system administrator add LIBDIR to `/etc/ld.so.conf’See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
Install PPL next
============
PPL depends on GMP, so specify its location
./configure --prefix=$P --with-gmp-prefix=$P
I think that something has changed with PPL 1.0. Because it doesnt seem to recognize the option –with-gmp-prefix
I needed:
./configure --prefix=$PREFIX --with-gmp=$PREFIX
make ; make install
Install MPFR
============
wget http://www.mpfr.org/mpfr-current/mpfr-3.1.1.tar.bz2 tar -jxvvf mpfr-3.1.1.tar.bz2 cd mpfr-3.1.1 ./configure --prefix=/home/users/d/dr/droidzone/hostusr --with-gmp=/home/users/d/dr/droidzone/hostusr make ; make install
I think that something has
Now, Install MPC (http://www.multiprecision.org/?prog=mpc&page=download)
================
Install MPFR and GMP first
, and then specify their path for MPC!
wget http://www.multiprecision.org/mpc/download/mpc-1.0.1.tar.gz tar -xvvf mpc-1.0.1.tar.gz cd mpc-1.0.1 ./configure --prefix=$P --with-gmp=$P --with-mpfr=$P make make install
Now, install CLOOG-PPL (For Graphite Loop Optimizations) http://www.cloog.org/
========================
wget http://www.bastoul.net/cloog/pages/download/cloog-0.17.0.tar.gz ./configure --prefix=$P --with-gmp=$P --with-ppl=$P make make install
Now, Install GCCÂ http://ftp.gnu.org/gnu/gcc/
================
cd ~/depend/gcc-4.6.2/ ;
export LD_LIBRARY_PATH=/home/users/d/dr/droidzone/hostusr/lib:/home/users/d/dr/droidzone/hostusr:$LD_LIBRARY_PATH ; ./configure –prefix=$P –with-gmp=$P –with-ppl=$P –with-cloog=$P –with-mpc=$P –with-mpfr=$P
make
Libraries have been installed in:
/home/users/d/dr/droidzone/hostusr/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:
– add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
during execution
– add LIBDIR to the `LD_RUN_PATH’ environment variable
during linking
– use the `-Wl,-rpath -Wl,LIBDIR’ linker flag
– have your system administrator add LIBDIR to `/etc/ld.so.conf’
———————————————————————-
Libraries have been installed in:
/home/users/d/dr/droidzone/hostusr/libexec/gcc/x86_64-unknown-linux-gnu/4.6.2
/home/users/d/dr/droidzone/hostusr/lib/../lib64
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:
– add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
during execution
– add LIBDIR to the `LD_RUN_PATH’ environment variable
during linking
– use the `-Wl,-rpath -Wl,LIBDIR’ linker flag
– have your system administrator add LIBDIR to `/etc/ld.so.conf’
ERROR (gcc build)
=====
-fvisibility=hidden -DHIDE_EXPORTS
In file included from /home/users/d/dr/droidzone/depend/gcc-4.6.2/host-x86_64-unknown-linux-gnu/gcc/include-fixed/features.h:361:0,
from /usr/include/stdio.h:28,
from ../../.././libgcc/../gcc/tsystem.h:87,
from ../../.././libgcc/../gcc/libgcc2.c:29:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
compilation terminated.
make[5]: *** [_muldi3.o] Error 1
make[5]: Leaving directory `/home/users/d/dr/droidzone/depend/gcc-4.6.2/x86_64-unknown-linux-gnu/32/libgcc’
make[4]: *** [multi-do] Error 1
make[4]: Leaving directory `/home/users/d/dr/droidzone/depend/gcc-4.6.2/x86_64-unknown-linux-gnu/libgcc’
make[3]: *** [all-multi] Error 2
make[3]: Leaving directory `/home/users/d/dr/droidzone/depend/gcc-4.6.2/x86_64-unknown-linux-gnu/libgcc’
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/home/users/d/dr/droidzone/depend/gcc-4.6.2′
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/users/d/dr/droidzone/depend/gcc-4.6.2′
make: *** [all] Error 2
FIX
===
./configure with –disable-multilib
./configure –prefix=/home/users/d/dr/droidzone/hostusrgcc –with-gmp=/home/users/d/dr/droidzone/hostusr –with-ppl=/home/users/d/dr/droidzone/hostusr –with-cloog=/home/users/d/dr/droidzone/hostusr –with-mpc=/home/users/d/dr/droidzone/hostusr –with-mpfr=/home/users/d/dr/droidzone/hostusr –disable-multilib
ERROR
=====
Autoconf installed but “installed autoconf does not work”
Fix
===
Autoconf 2.13 required by Smitna’s script was too old. Soln was to compile and install a newer version.
Error on compiling glibc with new gcc
=====================================
if test -r /home/users/d/dr/droidzone/hostusr/include/gnu/stubs-64.h && cmp -s /home/users/d/dr/droidzone/depend/glibcb/stubs.h /home/users/d/dr/droidzone/hostusr/include/gnu/stubs-64.h;
then echo ‘stubs.h unchanged’;
else /home/users/d/dr/droidzone/hostusr/bin/install -c -m 644 /home/users/d/dr/droidzone/depend/glibcb/stubs.h /home/users/d/dr/droidzone/hostusr/include/gnu/stubs-64.h; fi
rm -f /home/users/d/dr/droidzone/depend/glibcb/stubs.h
/home/users/d/dr/droidzone/depend/glibcb/elf/sln /home/users/d/dr/droidzone/depend/glibcb/elf/symlink.list
rm -f /home/users/d/dr/droidzone/depend/glibcb/elf/symlink.list
rm: error while loading shared libraries: /home/users/d/dr/droidzone/hostusr/lib/libc.so.6: ELF file OS ABI invalid
make[1]: *** [install-symbolic-link] Error 127
make[1]: Leaving directory `/home/users/d/dr/droidzone/depend/glibc-2.14′
make: *** [install] Error 2
Compile binutils
./configure –prefix=/home/users/d/dr/droidzone/hostusr –with-mpc=/home/users/d/dr/droidzone/hostusr –with-ppl=/home/users/d/dr/droidzone/hostusr –with-mpfr=/home/users/d/dr/droidzone/hostusr –with-gmp=/home/users/d/dr/droidzone/hostusr –with-cloog=/home/users/d/dr/droidzone/hostusr
configure: error: in `/home/users/d/dr/droidzone/depend/binutils-2.22′:
configure: error: C compiler cannot create executables
See `config.log’ for more details.
Joel G Mathew, known in tech circles by the pseudonym Droidzone, is an opensource and programming enthusiast.
He is a full stack developer, whose favorite languages are currently Python and Vue.js. He is also fluent in Javascript, Flutter/Dart, Perl, PHP, SQL, C and bash shell scripting. He loves Linux, and can often be found tinkering with linux kernel code, and source code for GNU applications. He used to be an active developer on XDA forums, and his tinkered ROMS used to be very popular in the early 2000s.
His favorite pastime is grappling with GNU compilers, discovering newer Linux secrets, writing scripts, hacking roms, and programs (nothing illegal), reading, blogging. and testing out the latest gadgets.
When away from the tech world, Dr Joel G. Mathew is a practising ENT Surgeon, busy with surgeries and clinical practise.