Author: jim Date: 2005-06-02 15:57:41 -0600 (Thu, 02 Jun 2005) New Revision: 5607
Added: branches/cross-lfs/BOOK/cross-tools/mips64/gcc-final.xml Modified: branches/cross-lfs/BOOK/ branches/cross-lfs/BOOK/cross-tools/mips64-chapter.xml branches/cross-lfs/BOOK/cross-tools/mips64/glibc-startfiles-64bit.xml Log: Mirrored from jg555.com on Thu Jun 2 14:57:31 PDT 2005 ---------------------------------------------------------------------- jim - Time based on jg555.com - 2005-06-02 14:48:39 -0700 Removed /tools/lib symlink ---------------------------------------------------------------------- jim - Time based on jg555.com - 2005-06-02 14:49:45 -0700 Added gcc-final to MIPS64, had to add --with-abi=64 for the final gcc build ---------------------------------------------------------------------- Property changes on: branches/cross-lfs/BOOK ___________________________________________________________________ Name: svk:merge - 7321b066-45f8-0310-a5e2-f63eff31be55:/cross-lfs:5608 dfc39d96-41f8-0310-9e44-b84af8e7c7f6:/books/local:5516 + 7321b066-45f8-0310-a5e2-f63eff31be55:/cross-lfs:5611 dfc39d96-41f8-0310-9e44-b84af8e7c7f6:/books/local:5516 Added: branches/cross-lfs/BOOK/cross-tools/mips64/gcc-final.xml =================================================================== --- branches/cross-lfs/BOOK/cross-tools/mips64/gcc-final.xml 2005-06-02 20:04:07 UTC (rev 5606) +++ branches/cross-lfs/BOOK/cross-tools/mips64/gcc-final.xml 2005-06-02 21:57:41 UTC (rev 5607) @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../../general.ent"> + <!ENTITY % patches-entities SYSTEM "../../patches.ent"> + %general-entities; + %patches-entities; +]> + +<sect1 id="ch-cross-tools-gcc-final" role="wrap"> +<title>GCC-&gcc-version; - Cross Compiler Final</title> +<?dbhtml filename="gcc-final.html"?> + +<indexterm zone="ch-cross-tools-gcc-final"> +<primary sortas="a-GCC">GCC</primary> +<secondary>cross tools, final</secondary></indexterm> + +<sect2 role="package"><title/> +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../../final-system/common/gcc.xml" xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + +<segmentedlist> +<segtitle>&buildtime;</segtitle> +<segtitle>&diskspace;</segtitle> +<seglistitem><seg>4.4 SBU</seg><seg>300 MB</seg></seglistitem> +</segmentedlist> + +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../../final-system/common/gcc.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/> + +</sect2> + +<sect2 role="installation"> +<title>Installation of GCC Cross Compiler</title> + +<para>We will make a couple of essential adjustments to the specs file to point +to our build environment:</para> + +<screen><userinput>patch -Np1 -i ../&gcc-specs-patch;</userinput></screen> + +<para>To make sure that we use the proper syntax for a couple of tools, we apply +the following patch:</para> + +<screen><userinput>patch -Np1 -i ../&gcc-posix-patch;</userinput></screen> + +<para>The following patch ensures that gcc does not search the /usr directory for +libgcc_s.so when cross-compling:</para> + +<screen><userinput>patch -Np1 -i ../&gcc-cross_search-patch;</userinput></screen> + +<para>Now we will need to setup our StartFile Spec to the correct library +location:</para> + +<screen><userinput>echo " +#undef STARTFILE_PREFIX_SPEC +#define STARTFILE_PREFIX_SPEC \"/tools/lib/\"" >> gcc/config/linux.h</userinput></screen> + +<para>Now we will change gcc's search path to look into /tools only:</para> + +<screen><userinput>sed -i "[EMAIL PROTECTED](^CROSS_SYSTEM_HEADER_DIR =\)[EMAIL PROTECTED] /tools/[EMAIL PROTECTED]" \ + gcc/Makefile.in</userinput></screen> + +<para>Finally, disable -B in Makefile.in, so it doesn't pick up the host's header +files:</para> + +<screen><userinput>sed -i '/FLAGS_FOR_TARGET.*\/lib\//[EMAIL PROTECTED] ]*/lib/@@g' configure configure.in</userinput></screen> + +<important><para>The above patches and sed's are critical in ensuring a +successful overall build. Do not forget to apply them.</para></important> + +<para>The GCC documentation recommends building GCC outside of the +source directory in a dedicated build directory:</para> + +<screen><userinput>mkdir ../gcc-build +cd ../gcc-build</userinput></screen> + +<para>Prepare GCC for compilation:</para> + +<screen><userinput>../gcc-&gcc-version;/configure --prefix=/cross-tools \ + --target=${LFS_TARGET} --host=${LFS_HOST} --with-abi=64 \ + --with-local-prefix=/tools --disable-nls --enable-shared \ + --enable-languages=c,c++ --enable-__cxa_atexit \ + --enable-c99 --enable-long-long --enable-threads=posix</userinput></screen> + +<para>The meaning of the configure options:</para> + +<variablelist> +<varlistentry> +<term><parameter>--with-local-prefix=/tools</parameter></term> +<listitem><para>The purpose of this switch is to remove <filename class="directory">/usr/local/include</filename> +from <command>gcc</command>'s include search path. This is not absolutely +essential, however, it helps to minimize the influence of the host +system.</para> +</listitem> +</varlistentry> + +<varlistentry> +<term><parameter>--enable-languages=c</parameter></term> +<listitem><para>This option ensures that only the C compiler is built. +This option is only needed when you have downloaded and unpacked the +full GCC tarball, as opposed to just the gcc-core +tarball.</para></listitem> +</varlistentry> +</variablelist> + +<para>Continue with compiling the package:</para> + +<screen><userinput>make</userinput></screen> + +<para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + +</sect2> + +<sect2 role="content"><title/> +<para>Details on this package are located in <xref +linkend="contents-gcc" role="."/></para> +</sect2> + +</sect1> + Modified: branches/cross-lfs/BOOK/cross-tools/mips64/glibc-startfiles-64bit.xml =================================================================== --- branches/cross-lfs/BOOK/cross-tools/mips64/glibc-startfiles-64bit.xml 2005-06-02 20:04:07 UTC (rev 5606) +++ branches/cross-lfs/BOOK/cross-tools/mips64/glibc-startfiles-64bit.xml 2005-06-02 21:57:41 UTC (rev 5607) @@ -98,11 +98,6 @@ <screen><userinput>install -d /tools/lib64 cp -fp csu/crt[i1n].o /tools/lib64</userinput></screen> -<para>Now we link the 64 bit library to /tools/lib so that 64 bit is -our default.</para> - -<screen><userinput>ln -s /tools/lib64 /tools/lib</userinput></screen> - </sect2> </sect1> Modified: branches/cross-lfs/BOOK/cross-tools/mips64-chapter.xml =================================================================== --- branches/cross-lfs/BOOK/cross-tools/mips64-chapter.xml 2005-06-02 20:04:07 UTC (rev 5606) +++ branches/cross-lfs/BOOK/cross-tools/mips64-chapter.xml 2005-06-02 21:57:41 UTC (rev 5607) @@ -22,6 +22,6 @@ <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mips/gcc-shared.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mips64/glibc.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mips64/glibc-64bit.xml"/> -<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mips/gcc-final.xml"/> +<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mips64/gcc-final.xml"/> </chapter> -- http://linuxfromscratch.org/mailman/listinfo/lfs-book FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
