[bf8c11f] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-cross-tools-flags">
|
---|
| 9 | <?dbhtml filename="flags.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Build Flags</title>
|
---|
| 12 |
|
---|
| 13 | <para>We will need to setup target specific flags for the compiler
|
---|
| 14 | and linkers.</para>
|
---|
| 15 |
|
---|
| 16 | <screen><userinput>export BUILD32="-mabi=32"
|
---|
| 17 | export BUILDN32="-mabi=n32"
|
---|
| 18 | export BUILD64="-mabi=64"</userinput></screen>
|
---|
| 19 |
|
---|
| 20 | <para>You will need to set your host target triplet for o32 bit:</para>
|
---|
| 21 |
|
---|
| 22 | <screen><userinput>export LFS_TARGET32="`echo ${LFS_TARGET}| sed -e 's/64//g'`"</userinput></screen>
|
---|
| 23 |
|
---|
| 24 | <screen><userinput>if [ "${LFS_HOST}" = "${LFS_TARGET32}" ]; then \
|
---|
| 25 | echo "Host and Target can't be the same." ; fi</userinput></screen>
|
---|
| 26 |
|
---|
| 27 | <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
|
---|
| 28 | a different target triplet:</para>
|
---|
| 29 |
|
---|
| 30 | <screen><userinput>export LFS_HOST="`echo ${MACHTYPE} | sed -e 's/unknown/cross/g' -e 's/-pc-/-cross-/g'`"</userinput></screen>
|
---|
| 31 |
|
---|
| 32 | <para>Lets add the build flags to <filename>~/.bashrc</filename> to
|
---|
| 33 | prevent issues if we stop and come back later.</para>
|
---|
| 34 |
|
---|
| 35 | <screen><userinput>echo export BUILD32=\""${BUILD32}\"" >> ~/.bashrc
|
---|
| 36 | echo export BUILDN32=\""${BUILDN32}\"" >> ~/.bashrc
|
---|
| 37 | echo export BUILD64=\""${BUILD64}\"" >> ~/.bashrc
|
---|
| 38 | echo export LFS_TARGET32=\""${LFS_TARGET32}\"" >> ~/.bashrc
|
---|
| 39 | echo export LFS_HOST=\""${LFS_HOST}\"" >> ~/.bashrc</userinput></screen>
|
---|
| 40 |
|
---|
| 41 | </sect1>
|
---|