MTD 248-645A Manual de usuario Pagina 66

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 347
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 65
Linux From Scratch - Version 7.0
46
5.10. GCC-4.6.1 - Pass 2
The GCC package contains the GNU compiler collection, which includes the C and C++ compilers.
Approximate build time: 7.0 SBU
Required disk space: 1.5 GB
5.10.1. Installation of GCC
Versions of GCC later than 4.3 will treat this build as if it were a relocated compiler and disallow searching for
startfiles in the location specified by --prefix. Since this will not be a relocated compiler, and the startfiles in /
tools are crucial to building a working compiler linked to the libs in /tools, apply the following patch which
partially reverts GCC to its old behavior:
patch -Np1 -i ../gcc-4.6.1-startfiles_fix-1.patch
Under normal circumstances the GCC fixincludes script is run in order to fix potentially broken header files. As
GCC-4.6.1 and Glibc-2.14.1 have already been installed at this point, and their respective header files are known to
not require fixing, the fixincludes script is not required. In fact, running this script may actually pollute the build
environment by installing fixed headers from the host system into GCC's private include directory. The running of
the fixincludes script can be suppressed by issuing the following commands:
cp -v gcc/Makefile.in{,.orig}
sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in
For x86 machines, a bootstrap build of GCC uses the -fomit-frame-pointer compiler flag. Non-bootstrap
builds omit this flag by default, and the goal should be to produce a compiler that is exactly the same as if it were
bootstrapped. Apply the following sed command to force the build to use the flag:
cp -v gcc/Makefile.in{,.tmp}
sed 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in.tmp \
> gcc/Makefile.in
The following command will change the location of GCC's default dynamic linker to use the one installed in /tools.
It also removes /usr/include from GCC's include search path. Doing this now rather than adjusting the specs
file after installation ensures that the new dynamic linker is used during the actual build of GCC. That is, all of the
binaries created during the build will link against the new Glibc. Issue:
for file in \
$(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
do
cp -uv $file{,.orig}
sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
-e 's@/usr@/tools@g' $file.orig > $file
echo '
#undef STANDARD_INCLUDE_DIR
#define STANDARD_INCLUDE_DIR 0
#define STANDARD_STARTFILE_PREFIX_1 ""
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
touch $file.orig
done
Vista de pagina 65
1 2 ... 61 62 63 64 65 66 67 68 69 70 71 ... 346 347

Comentarios a estos manuales

Sin comentarios