mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-03-06 14:24:48 +00:00
Updating chapter 6 Binutils and Gcc installation text.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@2690 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
parent
871df54793
commit
ae581daa00
@ -6,7 +6,7 @@
|
|||||||
default optimization flags (including the -march and -mcpu options).
|
default optimization flags (including the -march and -mcpu options).
|
||||||
Therefore, if you have defined any environment variables that override
|
Therefore, if you have defined any environment variables that override
|
||||||
default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting
|
default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting
|
||||||
or modifying them when building binutils.</para>
|
or modifying them when building Binutils.</para>
|
||||||
|
|
||||||
<para>It is recommended by the Binutils installation documentation to build
|
<para>It is recommended by the Binutils installation documentation to build
|
||||||
Binutils outside of the source directory:</para>
|
Binutils outside of the source directory:</para>
|
||||||
@ -14,29 +14,34 @@ Binutils outside of the source directory:</para>
|
|||||||
<para><screen><userinput>mkdir ../binutils-build
|
<para><screen><userinput>mkdir ../binutils-build
|
||||||
cd ../binutils-build</userinput></screen></para>
|
cd ../binutils-build</userinput></screen></para>
|
||||||
|
|
||||||
<para>Next, prepare Binutils to be compiled:</para>
|
<para>Now prepare Binutils for compilation:</para>
|
||||||
|
|
||||||
<para><screen><userinput>../binutils-&binutils-version;/configure \
|
<para><screen><userinput>../binutils-&binutils-version;/configure \
|
||||||
--prefix=/usr --enable-shared</userinput></screen></para>
|
--prefix=/usr --enable-shared</userinput></screen></para>
|
||||||
|
|
||||||
<para>Continue with compiling the package:</para>
|
<para>Compile the package:</para>
|
||||||
|
|
||||||
<para><screen><userinput>make tooldir=/usr</userinput></screen></para>
|
<para><screen><userinput>make tooldir=/usr</userinput></screen></para>
|
||||||
|
|
||||||
<para><screen><userinput>make check</userinput></screen></para>
|
|
||||||
|
|
||||||
<para>Normally, the <emphasis>tooldir</emphasis> (the directory where the
|
<para>Normally, the <emphasis>tooldir</emphasis> (the directory where the
|
||||||
executables end up) is set to $(exec_prefix)/$(target_alias) which expands
|
executables end up) is set to $(exec_prefix)/$(target_alias), which expands
|
||||||
into, for example, /usr/i686-pc-linux-gnu. Since we only build for our
|
into, for example, <filename>/usr/i686-pc-linux-gnu</filename>. Since we only
|
||||||
own system, we don't need this target specific directory in /usr. That
|
build for our own system, we don't need this target specific directory in
|
||||||
setup would be used if the system was used to cross-compile (for example
|
<filename>/usr</filename>. That setup would be used if the system was used to
|
||||||
compiling a package on the Intel machine that generates code that can be
|
cross-compile (for example compiling a package on an Intel machine that
|
||||||
executed on Apple PowerPC machines).</para>
|
generates code that can be executed on PowerPC machines).</para>
|
||||||
|
|
||||||
|
<para>Check the results:</para>
|
||||||
|
|
||||||
|
<para><screen><userinput>make check</userinput></screen></para>
|
||||||
|
|
||||||
<para>Install the package:</para>
|
<para>Install the package:</para>
|
||||||
|
|
||||||
<para><screen><userinput>make tooldir=/usr install</userinput></screen></para>
|
<para><screen><userinput>make tooldir=/usr install</userinput></screen></para>
|
||||||
|
|
||||||
|
<para>And remove a library that normally is not meant to be installed on its
|
||||||
|
own:</para>
|
||||||
|
|
||||||
<para><screen><userinput>rm /usr/lib/libiberty.a</userinput></screen></para>
|
<para><screen><userinput>rm /usr/lib/libiberty.a</userinput></screen></para>
|
||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
@ -9,29 +9,30 @@ Therefore, if you have defined any environment variables that override
|
|||||||
default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting
|
default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting
|
||||||
or modifying them when building GCC.</para>
|
or modifying them when building GCC.</para>
|
||||||
|
|
||||||
<para>We will be building the C and C++ compilers at this time, so you'll
|
<para>This time we will build both the C and the C++ compiler, so you'll have
|
||||||
need to unpack both the gcc-core and gcc-g++ tarballs. Other compilers are
|
to unpack the GCC-core <emphasis>and</emphasis> the GCC-g++ tarball -- they
|
||||||
available in the full gcc package; instructions for building them may be
|
will unfold into the same directory. The full GCC package contains even more
|
||||||
found at <ulink url="&blfs-root;view/cvs/general/gcc.html"/>.</para>
|
compilers. Instructions for building these can be found at
|
||||||
|
<ulink url="&blfs-root;view/cvs/general/gcc.html"/>.</para>
|
||||||
|
|
||||||
<para><screen><userinput>patch -Np1 -i ../gcc-&gcc-version;-no_fixincludes.patch
|
<para><screen><userinput>patch -Np1 -i ../gcc-&gcc-version;-no_fixincludes.patch
|
||||||
patch -Np1 -i ../gcc-&gcc-version;-mmap_test.patch</userinput></screen></para>
|
patch -Np1 -i ../gcc-&gcc-version;-mmap_test.patch</userinput></screen></para>
|
||||||
|
|
||||||
<para>It is recommended by the GCC installation documentation to build GCC
|
<para>GCC's installation documentation recommends to build the package in a
|
||||||
in a dedicated directory outside of the source tree. Create the build
|
dedicated directory separate from the source tree. Create this build
|
||||||
directory:</para>
|
directory and go there:</para>
|
||||||
|
|
||||||
<para><screen><userinput>mkdir ../gcc-build
|
<para><screen><userinput>mkdir ../gcc-build
|
||||||
cd ../gcc-build</userinput></screen></para>
|
cd ../gcc-build</userinput></screen></para>
|
||||||
|
|
||||||
<para>Prepare GCC to be compiled:</para>
|
<para>Now prepare GCC for compilation:</para>
|
||||||
|
|
||||||
<para><screen><userinput>../gcc-&gcc-version;/configure --prefix=/usr \
|
<para><screen><userinput>../gcc-&gcc-version;/configure --prefix=/usr \
|
||||||
--enable-shared --enable-threads=posix \
|
--enable-shared --enable-threads=posix \
|
||||||
--enable-__cxa_atexit --enable-clocale=gnu \
|
--enable-__cxa_atexit --enable-clocale=gnu \
|
||||||
--enable-languages=c,c++</userinput></screen></para>
|
--enable-languages=c,c++</userinput></screen></para>
|
||||||
|
|
||||||
<para>The meanings of the configure options are:</para>
|
<para>The meaning of the new configure options:</para>
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem><para><userinput>--enable-threads=posix</userinput>: This enables
|
<listitem><para><userinput>--enable-threads=posix</userinput>: This enables
|
||||||
@ -50,13 +51,16 @@ this specific locale, then the correct locale mode (<emphasis>gnu</emphasis>)
|
|||||||
is implemented.</para></listitem>
|
is implemented.</para></listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|
||||||
<para>Continue with compiling the package:</para>
|
<para>Compile the package:</para>
|
||||||
|
|
||||||
<para><screen><userinput>make</userinput></screen></para>
|
<para><screen><userinput>make</userinput></screen></para>
|
||||||
|
|
||||||
|
<para>Check the results, but don't stop at errors (you'll remember the few
|
||||||
|
known ones):</para>
|
||||||
|
|
||||||
<para><screen><userinput>make -k check</userinput></screen></para>
|
<para><screen><userinput>make -k check</userinput></screen></para>
|
||||||
|
|
||||||
<para>Finish installing the package:</para>
|
<para>And install the package:</para>
|
||||||
|
|
||||||
<para><screen><userinput>make install</userinput></screen></para>
|
<para><screen><userinput>make install</userinput></screen></para>
|
||||||
|
|
||||||
@ -66,12 +70,13 @@ To honor those packages, create two symlinks:</para>
|
|||||||
|
|
||||||
<para><screen><userinput>ln -s ../usr/bin/cpp /lib</userinput></screen></para>
|
<para><screen><userinput>ln -s ../usr/bin/cpp /lib</userinput></screen></para>
|
||||||
|
|
||||||
<para>Many packages compile using <emphasis>cc</emphasis> as the name for
|
<para>Many packages use the name <userinput>cc</userinput> to call the C
|
||||||
the C compiler. To satisfy those packages, create a <emphasis>cc</emphasis>
|
compiler. To satisfy those packages, create a symlink:</para>
|
||||||
symlink:</para>
|
|
||||||
|
|
||||||
<para><screen><userinput>ln -s gcc /usr/bin/cc</userinput></screen></para>
|
<para><screen><userinput>ln -s gcc /usr/bin/cc</userinput></screen></para>
|
||||||
|
|
||||||
|
<para>Remove the spurious a-out library again:</para>
|
||||||
|
|
||||||
<para><screen><userinput>rm /usr/lib/libiberty.a</userinput></screen></para>
|
<para><screen><userinput>rm /usr/lib/libiberty.a</userinput></screen></para>
|
||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
Loading…
Reference in New Issue
Block a user