The GCC package contains GNU compilers. This is useful for compiling programs written in C, C++, Fortran, Java, Objective C and Ada.
Download (HTTP): http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-3.4.1/gcc-3.4.1.tar.bz2
Download (FTP): ftp://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-3.4.1/gcc-3.4.1.tar.bz2
Download MD5 sum: 31b459062499f9f68d451db9cbf3205c
Download size: 27.2 MB
Estimated disk space required: 1.53 GB
Estimated build time: 48.94 SBU
Required patch: http://www.linuxfromscratch.org/blfs/downloads/6.0/gcc-3.4.1-no_fixincludes-1.patch
Required patch: http://www.linuxfromscratch.org/blfs/downloads/6.0/gcc-3.4.1-linkonce-1.patch
Test suite: http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-3.4.1/gcc-testsuite-3.4.1.tar.bz2
Test suite MD5 sum: 641f45606e17db4a3079cb7364a9e295
If you plan to compile Ada, you will need to install GNAT temporarily to satisfy the circular dependency when you recompile GCC to include Ada.
Download (FTP): ftp://cs.nyu.edu/pub/gnat/3.15p/gnat-3.15p-i686-pc-redhat71-gnu-bin.tar.gz
Download MD5 sum: 57c060cd1ccef8b1ae9165b11d98780a
Download size: 13.5 MB
Estimated disk space required: 48 MB
Estimated build time: 0.01 SBU
Install GNAT by running the following commands:
./doconfig
The above script will ask you how and where you would like to install GNAT. To avoid conflicts with the system gcc, the package will be installed in a separate directory, that can later be removed from the system.
In response to the questions asked by the doconfig script, enter 3 in response to the first question and /opt/gnat in response to the second question.
To finish the install, run the following command as the root user:
./doinstall
The GNAT compiler can be invoked by executing the gcc binary installed by the above script.
Prepare to compile GCC by placing the GNAT gcc at the beginning of the PATH variable by using the following commands:
PATH_HOLD=$PATH &&
export PATH=/opt/gnat/bin:$PATH
Install GCC by running the following commands:
The installation process may overwrite your existing GCC compiler and libraries. It is highly recommended that you have the Tcl, Expect and DejaGnu packages installed, as well as unpacking the GCC testsuite tarball before beginning the build.
Do not continue with the make install command until you're confident the build was successful. You can compare your test results with those found at http://gcc.gnu.org/ml/gcc-testresults/. There's also an i686 platform test result produced by an LFS-6.0 system at http://linuxfromscratch.org/~randy/gcc341_test.txt. You may also want to refer to the information found in the GCC-Pass 2 section of Chapter 5 in the LFS book ( ../../../../lfs/view/6.0/chapter05/gcc-pass2.html).
Some of the Java programs installed by the GCC package conflict (have the same names) with programs from the J2SDK-1.4.2 package. If you're installing the Java language from the GCC package but you wish to use the programs from the J2SDK as the defaults, ensure $JAVA_HOME/bin is listed before /usr/bin in your PATH variable.
patch -Np1 -i ../gcc-3.4.1-no_fixincludes-1.patch &&
patch -Np1 -i ../gcc-3.4.1-linkonce-1.patch &&
sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in &&
mkdir ../gcc-build &&
cd ../gcc-build &&
../gcc-3.4.1/configure --prefix=/usr --libexecdir=/usr/lib \
--enable-shared --enable-threads=posix --enable-__cxa_atexit \
--enable-clocale=gnu --enable-languages=c,c++,objc,f77,ada,java &&
make bootstrap &&
make -C gcc gnatlib-shared &&
make -C gcc gnattools &&
make -k check &&
../gcc-3.4.1/contrib/test_summary
Now, as the root user:
make install &&
ln -v -sf ../usr/bin/cpp /lib &&
ln -v -sf gcc /usr/bin/cc &&
ln -v -sf g77 /usr/bin/f77 &&
chown -v -R root:root /usr/lib/gcc/i686-pc-linux-gnu/3.4.1/include &&
chown -v -R root:root /usr/lib/gcc/i686-pc-linux-gnu/3.4.1/ada{lib,include}
You may remove the GNAT installation and restore your old PATH:
rm -rf /opt/gnat &&
export PATH=$PATH_HOLD
sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in: This command suppresses the installation of libiberty.a as the version provided by Binutils is used instead.
mkdir ../gcc-build; cd ../gcc-build: The GCC documentation recommends building the package in a dedicated build directory.
--enable-shared --enable-threads=posix --enable-__cxa_atexit: These commands are required to build the C++ libraries to published standards.
--enable-clocale=gnu: This command is a failsafe for incomplete locale data.
--enable-languages=c,c++,objc,f77,ada,java: This command identifies which languages to build. You may modify this command to remove undesired languages.
make -C gcc gnatlib-shared: This command builds the Ada shared and static libraries. Skip this step if you have not enabled Ada as one of the languages.
make -C gcc gnattools: This command builds the Ada development tools and binaries. Skip this step if you have not enabled Ada as one of the languages.
make -k check: This command runs the test suite without stopping should any errors be encountered.
../gcc-3.4.1/contrib/test_summary: This command will produce a summary of the test suite results. You can append | grep -A7 Summ to the command to produce an even more condensed version of the summary. You may also wish to redirect the output to a file for review and comparison later on.
ln -sf ../usr/bin/cpp /lib: This command creates a link to the C PreProcessor as some packages expect it to be installed in the /lib directory.
ln -sf gcc /usr/bin/cc; ln -sf g77 /usr/bin/f77: These links are created as some packages refer to the C and Fortran compilers using an alternate name.
chown -R root:root /usr/lib/gcc/i686-pc-linux-gnu/...: If the package is built by a user other than root, the ownership of the installed include and adalib directories (and their contents) will be incorrect. These commands change the ownership to root:root. Omit the command changing the Ada directories if you did not include Ada as one of the installed languages.
Some program and library descriptions are not listed here, but can be found at ../../../../lfs/view/6.0/chapter06/gcc.html#contents-gcc.
emulates some of the functionality of addr2line.
is a symlink to g77, created for compatibility purposes.
is the Fortran compiler invoked by gcc.
is an ahead-of-time compiler for the Java language.
generates header files from Java class files.
is the GNU interpreter for Java bytecode.
is the Ada compiler invoked by gcc.
is used to bind compiled objects.
is the Ada linker.
is useful for renaming files to meet the standard Ada default file naming conventions.
is used to remove files associated with a GNAT project.
is the GNAT definition/use finder.
is used to determine the crunched name for a given file, when crunched to a specified maximum length.
is used to link programs and build an executable file.
is the compiled unit browser.
is an automatic make facility.
will list the files associated with a GNAT project.
is the GNAT external preprocessor.
is the GNAT cross-referencer.
is a tool used to create Makefiles that support compilation by multiple languages.
is a utility used by Makefile.generic to handle multi-language builds. It provides a set of commands so that the Makefiles do not need to depend on Unix utilities not available on all targets.
searches jar files for a pattern.
is an archive tool for Java archives.
prints information about Java class files.
converts files from one encoding to another.
prints information about Java source files.
generates stubs for Remote Method Invocation.
starts a remote object registry on the current host.
Last updated on 2005-02-28 13:39:06 -0700