From 0eb906581f5309be74fe1fd4f2f7b27d4b80f48a Mon Sep 17 00:00:00 2001 From: DJ Lucas Date: Sun, 12 Oct 2008 04:09:47 +0000 Subject: Use static linked gcc for pass 1 - #2056. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8647 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter01/changelog.xml | 4 ++++ chapter05/gcc-pass1.xml | 26 +++++++++++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index f8114203b..e31fbbfd2 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -40,6 +40,10 @@ 2008-10-12 + + [dj] - Changed Chapter 5 GCC Pass 1 build to static. Thanks to + Jeremy Huntwork for the suggestion and supporting text. + [dj] - Added note to Chapter 6 GCC abuot the new include-fixed directory and changed the sample output to match. diff --git a/chapter05/gcc-pass1.xml b/chapter05/gcc-pass1.xml index 218566bab..1731034da 100644 --- a/chapter05/gcc-pass1.xml +++ b/chapter05/gcc-pass1.xml @@ -61,8 +61,8 @@ cd ../gcc-build Prepare GCC for compilation: CC="gcc -B/usr/bin/" ../gcc-&gcc-version;/configure --prefix=/tools \ - --with-local-prefix=/tools --disable-nls --enable-shared \ - --enable-languages=c --disable-decimal-float + --with-local-prefix=/tools --disable-nls --disable-shared \ + --enable-languages=c The meaning of the configure options: @@ -90,14 +90,11 @@ cd ../gcc-build - --enable-shared + --disable-shared - This switch allows the building of libgcc_s.so.1 and - libgcc_eh.a. - Having libgcc_eh.a - available ensures that the configure script for Glibc (the - next package we compile) produces the proper results. + This switch forces gcc to link its internal libraries + statically. We do this to avoid possible issues with the host + system. @@ -130,6 +127,17 @@ cd ../gcc-build make install + Using --disable-shared means that the + libgcc_eh.a file isn't created and installed. The + Glibc package depends on this library as it uses + -lgcc_eh within its build system. We can satisfy + that dependency by creating a symlink to libgcc.a, + since that file will end up containing the objects normally contained in + libgcc_eh.a. + +ln -vs libgcc.a `gcc -print-libgcc-file-name | \ + sed 's/libgcc/&_eh/'` + As a finishing touch, create a symlink. Many programs and scripts run cc instead of gcc, which is used to keep programs generic and therefore usable on all kinds of UNIX -- cgit v1.2.3-54-g00ecf