Difference between revisions of "GCC"

From CBLFS
Jump to navigationJump to search
(Multilib)
(Multilib)
Line 54: Line 54:
 
Configure GCC:
 
Configure GCC:
  
  PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" \
+
  export PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" &&
 
  ../gcc-4.1.1/configure --prefix=/usr --libdir=/usr/lib64 \
 
  ../gcc-4.1.1/configure --prefix=/usr --libdir=/usr/lib64 \
 
     --libexecdir=/usr/lib64 --enable-shraed --enable-threads=posix \
 
     --libexecdir=/usr/lib64 --enable-shraed --enable-threads=posix \
 
     --enable-__cxa_atexit --enable-c99 --enable-long-long \
 
     --enable-__cxa_atexit --enable-c99 --enable-long-long \
     --enable-clocale=gnu --disable-libstdcxx-pch \
+
     --enable-clocale=gnu --disable-libstdcxx-pch --enable-multilib \
 
     --enable-languages=c,c++,objc,f95,java,treelang
 
     --enable-languages=c,c++,objc,f95,java,treelang
  
 
Compile GCC:
 
Compile GCC:
  
  make bootstrap
+
  make bootstrap &&
 +
unset PKG_CONFIG_PATH
  
 
Test the Results, But do not stop at errors:
 
Test the Results, But do not stop at errors:
Line 80: Line 81:
  
 
  make install &&
 
  make install &&
  ln -v -sf ../usr/bin/cpp /lib &&
+
  ln -sfv ../usr/bin/cpp /lib &&
  ln -v -sf gcc /usr/bin/cc &&
+
  ln -sfv gcc /usr/bin/cc &&
  chown -v -R root:root \
+
  chown -Rv root:root /usr/lib64/gcc/$(gcc -dumpmachine)/4.1.1/include &&
    /usr/lib64/gcc/$(gcc -dumpmachine)/4.1.1/include &&
+
  chown -Rv root:root /usr/lib64/gcc/$(gcc -dumpmachine)/4.1.1/ada{lib,include}
  chown -v -R root:root \
 
    /usr/lib64/gcc/$(gcc -dumpmachine)/4.1.1/ada{lib,include}
 
  
 
The '''libffi''' interface header is installed in a location where other packages will not be able to find it. If you included Java as one of the installed languages, create a symbolic link in '''/usr/include''' to remedy this:
 
The '''libffi''' interface header is installed in a location where other packages will not be able to find it. If you included Java as one of the installed languages, create a symbolic link in '''/usr/include''' to remedy this:
  
  ln -v -sf `find /usr/lib64/gcc -name ffitarget.h` /usr/include
+
  ln -sfv `find /usr/lib64/gcc -name ffitarget.h` /usr/include

Revision as of 10:54, 22 November 2006

BIG FAT WARNING!


You are about to over-write your currently installed GCC. If you have ANY doubts that this may fail. Do not continue. Also, Do not continue with make install unless you are 100% confident that your build was successful!

This page is still under development!


Download Source: http://ftp.gnu.org/gnu/gcc/gcc-4.1.1/gcc-4.1.1.tar.bz2
Download Patch: http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk/patches/gcc-4.1.1-PR20425-1.patch

Figure out ada.

Dependencies

Recommended

Optional (Required to Build the Fortran Compiler)

Optional (Java's Classpath Library Can Use)

Non-Multilib

Write-Me!

Multilib

The following patch fixes the searching of multilib dirs for specs file. The patch standardizes the gcc drivers path iteration functions, ensuring multilib directories are searched in the correct order. This fixes various issues, most noticably with libtool on multilib systems:

patch -Np1 -i ../gcc-4.1.1-PR20425-1.patch

Suppress the installation of libiberty.a. The version of libiberty.a provided by Binutils will be used instead:

sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in

Create the Build Directory:

mkdir -v ../gcc-build &&
cd ../gcc-build

Configure GCC:

export PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" &&
../gcc-4.1.1/configure --prefix=/usr --libdir=/usr/lib64 \
    --libexecdir=/usr/lib64 --enable-shraed --enable-threads=posix \
    --enable-__cxa_atexit --enable-c99 --enable-long-long \
    --enable-clocale=gnu --disable-libstdcxx-pch --enable-multilib \
    --enable-languages=c,c++,objc,f95,java,treelang

Compile GCC:

make bootstrap &&
unset PKG_CONFIG_PATH

Test the Results, But do not stop at errors:

make -k check

The -k flag is used to make the test suite run through to completion and not stop at the first failure. The GCC test suite is very comprehensive and is almost guaranteed to generate a few failures. To receive a summary of the test suite results, run:

../gcc-4.1.1/contrib/test_summary
  • For only the summaries, pipe the output through grep -A7 Summ.

At this time only proceed if you are 100% positive that you have built a sane compiler.

Install GCC:

make install &&
ln -sfv ../usr/bin/cpp /lib &&
ln -sfv gcc /usr/bin/cc &&
chown -Rv root:root /usr/lib64/gcc/$(gcc -dumpmachine)/4.1.1/include &&
chown -Rv root:root /usr/lib64/gcc/$(gcc -dumpmachine)/4.1.1/ada{lib,include}

The libffi interface header is installed in a location where other packages will not be able to find it. If you included Java as one of the installed languages, create a symbolic link in /usr/include to remedy this:

ln -sfv `find /usr/lib64/gcc -name ffitarget.h` /usr/include
Retrieved from "?title=GCC&oldid=4180"