Author: jim Date: 2005-08-28 15:34:19 -0600 (Sun, 28 Aug 2005) New Revision: 6768
Added: branches/cross-lfs/BOOK/cross-tools/common/variables-multilib.xml Modified: branches/cross-lfs/BOOK/ branches/cross-lfs/BOOK/cross-tools/common/variables.xml branches/cross-lfs/BOOK/cross-tools/mips64-chapter.xml branches/cross-lfs/BOOK/cross-tools/mips64/flags.xml branches/cross-lfs/BOOK/cross-tools/sparc64-chapter.xml branches/cross-lfs/BOOK/cross-tools/sparc64/flags.xml branches/cross-lfs/BOOK/cross-tools/x86_64-chapter.xml branches/cross-lfs/BOOK/cross-tools/x86_64/flags.xml branches/cross-lfs/BOOK/introduction/common/changelog.xml Log: [EMAIL PROTECTED]: jim | 2005-08-28 14:30:34 -0700 Added a second sanity check on LFS_HOST, LFS_TARGET, and LFS_TARGET32 Property changes on: branches/cross-lfs/BOOK ___________________________________________________________________ Name: svk:merge - 7321b066-45f8-0310-a5e2-f63eff31be55:/cross-lfs:7265 dfc39d96-41f8-0310-9e44-b84af8e7c7f6:/books/local:5516 + 7321b066-45f8-0310-a5e2-f63eff31be55:/cross-lfs:7288 dfc39d96-41f8-0310-9e44-b84af8e7c7f6:/books/local:5516 Added: branches/cross-lfs/BOOK/cross-tools/common/variables-multilib.xml =================================================================== --- branches/cross-lfs/BOOK/cross-tools/common/variables-multilib.xml 2005-08-28 13:15:18 UTC (rev 6767) +++ branches/cross-lfs/BOOK/cross-tools/common/variables-multilib.xml 2005-08-28 21:34:19 UTC (rev 6768) @@ -0,0 +1,155 @@ +<?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"> + %general-entities; +]> + +<sect1 id="ch-cross-tools-variables"> + <?dbhtml filename="variables.html"?> + + <title>Build Variables</title> + + <bridgehead renderas="sect4">Configuration # 1 - Creating different + architecture tools</bridgehead> + + <para>This method is recommended for all LiveCD based distro's.</para> + + <para>During the building of the cross-compile tools you will need to + set a few variables that will be dependent on your particular needs. + The first variable will be the triplet of the <envar>HOST</envar> machine. + You will need to set the <envar>CHOST</envar> triplet to match your + particular needs. To set this information you can issue the following + command:</para> + +<screen><userinput>export LFS_HOST="${MACHTYPE}"</userinput></screen> + + <para>Now you will need to set the target triplet for the target + architecure. You can do this by running the same command as above, just + running it on the target machine. If you can't run the command on the + target machine, you can use the table at the bottom of this page. Set + the command using the method listed below:</para> + +<screen><userinput>export LFS_TARGET="{target triplet}"</userinput></screen> + + <bridgehead renderas="sect4">Configuration # 2 - Creating same + architecture tools</bridgehead> + + <para>You can also create <quote>clean</quote> tools on your current + distro. This will ensure that you have all the prerequisites for the + LFS build.</para> + + <para>You will need to set your host target triplet a little differently. + To set this information you can issue the following commands:</para> + +<screen><userinput>export LFS_HOST="`echo ${MACHTYPE} | sed -e 's/unknown/cross/g' -e 's/-pc-/-cross-/g'`"</userinput></screen> + + <para>Now you will need to set the target triplet for the target, which + in this case is very simple. Set the command using the method listed + below:</para> + +<screen><userinput>export LFS_TARGET="${MACHTYPE}"</userinput></screen> + + <bridgehead renderas="sect4">Sanity Check</bridgehead> + + <para>Let's perform a sanity check to prevent build issues. If our LFS_HOST matches our + target, we will get some failures during our cross-compile:</para> + +<screen><userinput>if [ "${LFS_HOST}" = "${LFS_TARGET}" ]; then \ + echo "Host and Target can't be the same. Use the Other Configuration Method" ; fi</userinput></screen> + + <para>If you received an message, "Host and Target can't be the same." + You will need to use the other Configuration Method. This will prevent build + issues during the early phases of the build.</para> + + <bridgehead renderas="sect4">Copy settings to Environment</bridgehead> + + <para>Now we will add these to <filename>~/.bashrc</filename>, just in + case you have to exit and restart building later:</para> + +<screen><userinput>echo export LFS_TARGET=\""${LFS_TARGET}\"" >> ~/.bashrc</userinput></screen> + + <table> + <title>List of architectures, target triplets, and recommended book</title> + <tgroup cols="2" align="center"> + <colspec colname="Processor"/> + <colspec colname="Triplet"/> + <colspec colname="Book"/> + <thead> + <row> + <entry>Architecture</entry> + <entry>Target Triplet</entry> + <entry>LFS Book</entry> + </row> + </thead> + <tbody> + <row> + <entry>Pentium, K6, 586 Compatibles</entry> + <entry>i586-pc-linux-gnu</entry> + <entry>Intel/AMD x86</entry> + </row> + <row> + <entry>Pentium II, Pentium III, Pentium 4</entry> + <entry>i686-pc-linux-gnu</entry> + <entry>Intel/AMD x86</entry> + </row> + <row> + <entry>Athlon, Duron</entry> + <entry>i686-pc-linux-gnu</entry> + <entry>Intel/AMD x86</entry> + </row> + <row> + <entry>Athlon64</entry> + <entry>x86_64-pc-linux-gnu</entry> + <entry>x86_64</entry> + </row> + <row> + <entry>PowerPC</entry> + <entry>powerpc-unknown-linux-gnu</entry> + <entry>PowerPC</entry> + </row> + <row> + <entry>PowerPC64</entry> + <entry>ppc64-unknown-linux-gnu</entry> + <entry>PowerPC</entry> + </row> + <row> + <entry>MIPS</entry> + <entry>mips-unknown-linux-gnu</entry> + <entry>MIPS 32 Bit</entry> + </row> + <row> + <entry>MIPS Little Endian</entry> + <entry>mipsel-unknown-linux-gnu</entry> + <entry>MIPS 32 Bit</entry> + </row> + <row> + <entry>MIPS 64</entry> + <entry>mips64-unknown-linux-gnu</entry> + <entry>MIPS 64 Bit</entry> + </row> + <row> + <entry>MIPS 64 Little Endian</entry> + <entry>mips64el-unknown-linux-gnu</entry> + <entry>MIPS 64 Bit</entry> + </row> + <row> + <entry>Supersparc and Hypersparc</entry> + <entry>sparcv8-unknown-linux-gnu</entry> + <entry>Sparc32</entry> + </row> + <row> + <entry>Ultrasparc</entry> + <entry>sparcv9-unknown-linux-gnu</entry> + <entry>Sparc32</entry> + </row> + <row> + <entry>Ultrasparc</entry> + <entry>sparc64-unknown-linux-gnu</entry> + <entry>Sparc64</entry> + </row> + </tbody> + </tgroup> + </table> + +</sect1> Modified: branches/cross-lfs/BOOK/cross-tools/common/variables.xml =================================================================== --- branches/cross-lfs/BOOK/cross-tools/common/variables.xml 2005-08-28 13:15:18 UTC (rev 6767) +++ branches/cross-lfs/BOOK/cross-tools/common/variables.xml 2005-08-28 21:34:19 UTC (rev 6768) @@ -56,9 +56,9 @@ target, we will get some failures during our cross-compile:</para> <screen><userinput>if [ "${LFS_HOST}" = "${LFS_TARGET}" ]; then \ - echo "Host and Target can't be the same. Use the Other Configuration Method" ; fi</userinput></screen> + echo "Host and Target can't be the same." ; fi</userinput></screen> - <para>If you received an message, "Host and Target can't be the same..." + <para>If you received an message, "Host and Target can't be the same." You will need to use the other Configuration Method. This will prevent build issues during the early phases of the build.</para> Modified: branches/cross-lfs/BOOK/cross-tools/mips64/flags.xml =================================================================== --- branches/cross-lfs/BOOK/cross-tools/mips64/flags.xml 2005-08-28 13:15:18 UTC (rev 6767) +++ branches/cross-lfs/BOOK/cross-tools/mips64/flags.xml 2005-08-28 21:34:19 UTC (rev 6768) @@ -22,6 +22,14 @@ <screen><userinput>export LFS_TARGET32="`echo ${LFS_TARGET}| sed -e 's/64//g'`"</userinput></screen> +<screen><userinput>if [ "${LFS_HOST}" = "${LFS_TARGET32}" ]; then \ + echo "Host and Target can't be the same." ; fi</userinput></screen> + + <para>If the above test gave you "Host and Target can't be the same", you will need to change your LFS_HOST to a + a different target triplet:</para> + +<screen><userinput>export LFS_HOST="`echo ${MACHTYPE} | sed -e 's/unknown/cross/g' -e 's/-pc-/-cross-/g'`"</userinput></screen> + <para>Lets add the build flags to <filename>~/.bashrc</filename> to prevent issues if we stop and come back later.</para> @@ -29,6 +37,7 @@ echo export BUILDN32=\""${BUILDN32}\"" >> ~/.bashrc echo export BUILD64=\""${BUILD64}\"" >> ~/.bashrc echo export LFS_TARGET32=\""${LFS_TARGET32}\"" >> ~/.bashrc +echo export LFS_HOST=\""${LFS_HOST}\"" >> ~/.bashrc echo export GCCTARGET=\""$GCCTARGET}\"" >> ~/.bashrc</userinput></screen> </sect1> Modified: branches/cross-lfs/BOOK/cross-tools/mips64-chapter.xml =================================================================== --- branches/cross-lfs/BOOK/cross-tools/mips64-chapter.xml 2005-08-28 13:15:18 UTC (rev 6767) +++ branches/cross-lfs/BOOK/cross-tools/mips64-chapter.xml 2005-08-28 21:34:19 UTC (rev 6768) @@ -13,7 +13,7 @@ <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/introduction.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/cflags.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/variables.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/variables-multilib.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mips64/flags.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mips64/linux-libc-headers.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mips64/binutils.xml"/> Modified: branches/cross-lfs/BOOK/cross-tools/sparc64/flags.xml =================================================================== --- branches/cross-lfs/BOOK/cross-tools/sparc64/flags.xml 2005-08-28 13:15:18 UTC (rev 6767) +++ branches/cross-lfs/BOOK/cross-tools/sparc64/flags.xml 2005-08-28 21:34:19 UTC (rev 6768) @@ -21,13 +21,22 @@ <screen><userinput>export LFS_TARGET32="sparcv9-unknown-linux-gnu"</userinput></screen> +<screen><userinput>if [ "${LFS_HOST}" = "${LFS_TARGET32}" ]; then \ + echo "Host and Target can't be the same." ; fi</userinput></screen> + + <para>If the above test gave you "Host and Target can't be the same", you will need to change your LFS_HOST to a + a different target triplet:</para> + +<screen><userinput>export LFS_HOST="`echo ${MACHTYPE} | sed -e 's/unknown/cross/g' -e 's/-pc-/-cross-/g'`"</userinput></screen> + <para>Lets add the build flags to <filename>~/.bashrc</filename> to prevent issues if we stop and come back later.</para> <screen><userinput>echo export BUILD32=\""${BUILD32}\"" >> ~/.bashrc echo export BUILD64=\""${BUILD64}\"" >> ~/.bashrc echo export GCCTARGET=\""${GCCTARGET}\"" >> ~/.bashrc -echo export LFS_TARGET32=\""${LFS_TARGET32}\"" >> ~/.bashrc</userinput></screen> +echo export LFS_TARGET32=\""${LFS_TARGET32}\"" >> ~/.bashrc +echo export LFS_HOST=\""${LFS_HOST}\"" >> ~/.bashrc</userinput></screen> <para>The following table gives the entires for different Sparc 64 capable processors. Pick the processor that matches your system.</para> Modified: branches/cross-lfs/BOOK/cross-tools/sparc64-chapter.xml =================================================================== --- branches/cross-lfs/BOOK/cross-tools/sparc64-chapter.xml 2005-08-28 13:15:18 UTC (rev 6767) +++ branches/cross-lfs/BOOK/cross-tools/sparc64-chapter.xml 2005-08-28 21:34:19 UTC (rev 6768) @@ -13,7 +13,7 @@ <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/introduction.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/cflags.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/variables.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/variables-multilib.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sparc64/flags.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sparc64/linux-libc-headers.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sparc64/binutils.xml"/> Modified: branches/cross-lfs/BOOK/cross-tools/x86_64/flags.xml =================================================================== --- branches/cross-lfs/BOOK/cross-tools/x86_64/flags.xml 2005-08-28 13:15:18 UTC (rev 6767) +++ branches/cross-lfs/BOOK/cross-tools/x86_64/flags.xml 2005-08-28 21:34:19 UTC (rev 6768) @@ -21,12 +21,27 @@ <screen><userinput>export LFS_TARGET32="i686-pc-linux-gnu"</userinput></screen> + <para>Let's perform a sanity check to prevent build issues. If our LFS_HOST matches our + target, we will get some failures during our cross-compile:</para> + +<screen><userinput>if [ "${LFS_HOST}" = "${LFS_TARGET32}" ]; then \ + echo "Host and Target can't be the same." ; fi</userinput></screen> + + <para>If the above test gave you "Host and Target can't be the same", you will need to change your LFS_HOST to a + a different target triplet:</para> + + <para>If the above test gave you an error, you will need to change your LFS_HOST to a + a different target triplet:</para> + +<screen><userinput>export LFS_HOST="`echo ${MACHTYPE} | sed -e 's/unknown/cross/g' -e 's/-pc-/-cross-/g'`"</userinput></screen> + <para>Lets add the build flags to <filename>~/.bashrc</filename> to prevent issues if we stop and come back later.</para> <screen><userinput>echo export BUILD32=\""${BUILD32}\"" >> ~/.bashrc echo export BUILD64=\""${BUILD64}\"" >> ~/.bashrc echo export LFS_TARGET32=\""${LFS_TARGET32}\"" >> ~/.bashrc +echo export LFS_HOST=\""${LFS_HOST}\"" >> ~/.bashrc echo export GCCTARGET=\""${GCCTARGET}\"" >> ~/.bashrc</userinput></screen> </sect1> Modified: branches/cross-lfs/BOOK/cross-tools/x86_64-chapter.xml =================================================================== --- branches/cross-lfs/BOOK/cross-tools/x86_64-chapter.xml 2005-08-28 13:15:18 UTC (rev 6767) +++ branches/cross-lfs/BOOK/cross-tools/x86_64-chapter.xml 2005-08-28 21:34:19 UTC (rev 6768) @@ -14,7 +14,7 @@ <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/introduction.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/cflags.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="x86_64/flags.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/variables.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="common/variables-multilib.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="x86_64/linux-libc-headers.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="x86_64/binutils.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="x86_64/glibc-headers.xml"/> Modified: branches/cross-lfs/BOOK/introduction/common/changelog.xml =================================================================== --- branches/cross-lfs/BOOK/introduction/common/changelog.xml 2005-08-28 13:15:18 UTC (rev 6767) +++ branches/cross-lfs/BOOK/introduction/common/changelog.xml 2005-08-28 21:34:19 UTC (rev 6768) @@ -39,6 +39,15 @@ --> <listitem> + <para>August 28, 2005</para> + <itemizedlist> + <listitem> + <para>[jim] - Added another sanity check to prevent error during gcc compile.</para> + </listitem> + </itemizedlist> + </listitem> + + <listitem> <para>August 27, 2005</para> <itemizedlist> <listitem> -- http://linuxfromscratch.org/mailman/listinfo/lfs-book FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
