[ad36f39] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[bd48e48] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[ad36f39] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-cross-tools-variables">
|
---|
| 9 | <?dbhtml filename="variables.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Build Variables</title>
|
---|
| 12 |
|
---|
| 13 | <bridgehead renderas="sect4">Setting Host and Target</bridgehead>
|
---|
| 14 |
|
---|
[b220338] | 15 | <para os="a">During the building of the cross-compile tools, you will need to
|
---|
[7926af1] | 16 | set a few variables that will be dependent on your particular needs.
|
---|
[b220338] | 17 | You will need to select the target triplet for the target architecture, the CPU
|
---|
| 18 | endianess, the CPU architecture, the CPU mode, the CPU floating point hardware
|
---|
| 19 | availability, and (if available) the type of floating point hardware. If you
|
---|
| 20 | do not know what values can be chosen for each of these, you can use the
|
---|
| 21 | tables at the bottom of this page as a reference.</para>
|
---|
| 22 |
|
---|
[a5cbaf25] | 23 | <para os="a1">Most ARM processors are little endian, it is a safe choice. If
|
---|
| 24 | your processor is an ARM9, good choices include: triplet of
|
---|
| 25 | armv5l-unknown-linux-uclibeabi, ARM arch of armv5t, and float of soft. ARM9
|
---|
| 26 | processors do not usually have hardware floating point abilities. If your
|
---|
| 27 | processor is a Cortex-A series, which often have hardware floating point
|
---|
| 28 | capability, good choices include: triplet of
|
---|
| 29 | armv7a-unknown-linux-uclibceabi, ARM arch of armv7-a, float of hard, and fpu
|
---|
| 30 | of vfpv3-d16.</para>
|
---|
[c31ae75] | 31 |
|
---|
| 32 | <para os="a2">First, set the host and target triplets:</para>
|
---|
[ad36f39] | 33 |
|
---|
| 34 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
[7926af1] | 35 | href="../common/variables.xml"
|
---|
[5b4806a] | 36 | xpointer="xpointer(//*[@os='b'])"/>
|
---|
[ad36f39] | 37 |
|
---|
| 38 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
[7926af1] | 39 | href="../common/variables.xml"
|
---|
[5b4806a] | 40 | xpointer="xpointer(//*[@os='c'])"/>
|
---|
[ad36f39] | 41 |
|
---|
[a9bbc46] | 42 | <screen os="d"><userinput>export CLFS_ARCH=arm
|
---|
[29ca400] | 43 | export CLFS_ENDIAN="<replaceable>[endianess]</replaceable>"</userinput></screen>
|
---|
[6533111] | 44 |
|
---|
[b220338] | 45 | <para os="e">Choose the ARM architecture (see table below) and mode of
|
---|
| 46 | your CPU:</para>
|
---|
| 47 |
|
---|
| 48 | <screen os="f"><userinput>export CLFS_ARM_ARCH="<replaceable>[architecture]</replaceable>"
|
---|
| 49 | export CLFS_ARM_MODE="<replaceable>[arm or thumb]</replaceable>"</userinput></screen>
|
---|
| 50 |
|
---|
[a5cbaf25] | 51 | <para os="f1">If your target CPU has hardware floating point support (not all
|
---|
| 52 | ARM CPUs do), then set the following CLFS_FLOAT variable to either "hard" or
|
---|
| 53 | "softfp". Use "softfp" if you need to integrate binaries compiled with
|
---|
| 54 | "soft". Use "hard" if you don't. If your target CPU does not have hard
|
---|
| 55 | floating point support, set the following CLFS_FLOAT vairable to
|
---|
| 56 | "soft".</para>
|
---|
[b220338] | 57 |
|
---|
| 58 | <screen os="f2"><userinput>export CLFS_FLOAT="<replaceable>[hard, softfp, or soft]"</replaceable></userinput></screen>
|
---|
| 59 |
|
---|
| 60 | <para os="f3">If you chose either "hard" or "softfp" for CLFS_FLOAT, you now
|
---|
| 61 | need to set which floating point hardware is actually included (see table below)
|
---|
| 62 | with your ARM CPU:</para>
|
---|
| 63 |
|
---|
| 64 | <screen os="f4"><userinput>export CLFS_FPU="<replaceable>[fpu version]</replaceable>"</userinput></screen>
|
---|
| 65 |
|
---|
[5b4806a] | 66 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
|
---|
[7926af1] | 67 | href="../common/variables.xml"
|
---|
[0dad5b9] | 68 | xpointer="xpointer(//*[@os='g'])"/>
|
---|
[6533111] | 69 |
|
---|
[b220338] | 70 | <screen os="h"><userinput>echo export CLFS_HOST=\""${CLFS_HOST}\"" >> ~/.bashrc
|
---|
| 71 | echo export CLFS_TARGET=\""${CLFS_TARGET}\"" >> ~/.bashrc
|
---|
| 72 | echo export CLFS_ARCH=\""${CLFS_ARCH}\"" >> ~/.bashrc
|
---|
| 73 | echo export CLFS_ENDIAN=\""${CLFS_ENDIAN}\"" >> ~/.bashrc
|
---|
| 74 | echo export CLFS_ARM_ARCH=\""${CLFS_ARM_ARCH}\"" >> ~/.bashrc
|
---|
| 75 | echo export CLFS_ARM_MODE=\""${CLFS_ARM_MODE}\"" >> ~/.bashrc
|
---|
| 76 | echo export CLFS_FLOAT=\""${CLFS_FLOAT}\"" >> ~/.bashrc
|
---|
| 77 | echo export CLFS_FPU=\""${CLFS_FPU}\"" >> ~/.bashrc</userinput></screen>
|
---|
[ad36f39] | 78 |
|
---|
[0dad5b9] | 79 | <table os="i">
|
---|
[b220338] | 80 | <title>Example Processor Type, ABI, and Target Triplets</title>
|
---|
[d44503cc] | 81 | <?dbfo table-width="7in" ?>
|
---|
[3ca2208] | 82 |
|
---|
[5c58544] | 83 | <tgroup cols="4">
|
---|
[3ca2208] | 84 |
|
---|
| 85 | <colspec colnum="1" colwidth="2.5in" colname="Processor"/>
|
---|
[29ca400] | 86 | <colspec colnum="2" colwidth="1in" colname="Endianess"/>
|
---|
[d44503cc] | 87 | <colspec colnum="3" colwidth="1in" colname="ABI"/>
|
---|
| 88 | <colspec colnum="4" colwidth="2.5in" colname="Triplet"/>
|
---|
[3ca2208] | 89 |
|
---|
[ad36f39] | 90 | <thead>
|
---|
| 91 | <row>
|
---|
| 92 | <entry>Processor</entry>
|
---|
[29ca400] | 93 | <entry>Endianess</entry>
|
---|
[d44503cc] | 94 | <entry>ABI</entry>
|
---|
[ad36f39] | 95 | <entry>Target Triplet</entry>
|
---|
| 96 | </row>
|
---|
| 97 | </thead>
|
---|
[3ca2208] | 98 |
|
---|
[ad36f39] | 99 | <tbody>
|
---|
[ff29c76] | 100 | <row>
|
---|
| 101 | <entry>Generic arm, version 5</entry>
|
---|
| 102 | <entry>little</entry>
|
---|
| 103 | <entry>EABI</entry>
|
---|
[885ee0e] | 104 | <entry>armv5l-unknown-linux-uclibceabi</entry>
|
---|
[ad36f39] | 105 | </row>
|
---|
| 106 | <row>
|
---|
[a9bbc46] | 107 | <entry>Generic arm, version 5</entry>
|
---|
| 108 | <entry>big</entry>
|
---|
[ff29c76] | 109 | <entry>EABI</entry>
|
---|
[885ee0e] | 110 | <entry>armv5b-unknown-linux-uclibceabi</entry>
|
---|
[ad36f39] | 111 | </row>
|
---|
[d44503cc] | 112 | <row>
|
---|
| 113 | <entry>Generic arm</entry>
|
---|
| 114 | <entry>little</entry>
|
---|
| 115 | <entry>EABI</entry>
|
---|
[885ee0e] | 116 | <entry>arm-unknown-linux-uclibceabi</entry>
|
---|
[d44503cc] | 117 | </row>
|
---|
[ff29c76] | 118 | <row>
|
---|
| 119 | <entry>Generic arm, version 7-a </entry>
|
---|
| 120 | <entry>little</entry>
|
---|
| 121 | <entry>EABI</entry>
|
---|
[885ee0e] | 122 | <entry>armv7a-unknown-linux-uclibceabi</entry>
|
---|
[ff29c76] | 123 | </row>
|
---|
[ad36f39] | 124 | </tbody>
|
---|
[3ca2208] | 125 |
|
---|
[ad36f39] | 126 | </tgroup>
|
---|
[3ca2208] | 127 |
|
---|
[ad36f39] | 128 | </table>
|
---|
| 129 |
|
---|
[b220338] | 130 | <table os="j">
|
---|
| 131 | <title>ARM Archiecture Choices</title>
|
---|
| 132 | <?dbfo table-width="4in" ?>
|
---|
| 133 |
|
---|
[5c58544] | 134 | <tgroup cols="4">
|
---|
[b220338] | 135 |
|
---|
| 136 | <colspec colnum="1" colwidth="1in" colname="Arch Choice"/>
|
---|
| 137 | <colspec colnum="2" colwidth="1in" colname="Arch Choice"/>
|
---|
| 138 | <colspec colnum="3" colwidth="1in" colname="Arch Choice"/>
|
---|
| 139 | <colspec colnum="4" colwidth="1in" colname="Arch Choice"/>
|
---|
| 140 |
|
---|
| 141 | <tbody>
|
---|
| 142 | <row>
|
---|
| 143 | <entry>armv4t</entry>
|
---|
| 144 | <entry>armv5</entry>
|
---|
| 145 | <entry>armv5t</entry>
|
---|
[90309a2] | 146 | <entry>armv5te</entry>
|
---|
[b220338] | 147 | </row>
|
---|
| 148 | <row>
|
---|
| 149 | <entry>armv6</entry>
|
---|
| 150 | <entry>armv6j</entry>
|
---|
| 151 | <entry>armv6t2</entry>
|
---|
[90309a2] | 152 | <entry>armv6z</entry>
|
---|
[b220338] | 153 | </row>
|
---|
| 154 | <row>
|
---|
| 155 | <entry>armv6zk</entry>
|
---|
| 156 | <entry>armv6-m</entry>
|
---|
| 157 | <entry>armv7</entry>
|
---|
[90309a2] | 158 | <entry>armv7-a</entry>
|
---|
[b220338] | 159 | </row>
|
---|
| 160 | <row>
|
---|
| 161 | <entry>armv7-r</entry>
|
---|
| 162 | <entry>armv7-m</entry>
|
---|
| 163 | </row>
|
---|
| 164 | </tbody>
|
---|
| 165 | </tgroup>
|
---|
| 166 | </table>
|
---|
| 167 |
|
---|
| 168 | <table os="j">
|
---|
| 169 | <title>ARM Hard Floating Point Versions</title>
|
---|
| 170 | <?dbfo table-width="4in" ?>
|
---|
| 171 |
|
---|
[5c58544] | 172 | <tgroup cols="4">
|
---|
[b220338] | 173 |
|
---|
| 174 | <colspec colnum="1" colwidth="1in" colname="FPU Choice"/>
|
---|
| 175 | <colspec colnum="2" colwidth="1in" colname="FPU Choice"/>
|
---|
| 176 | <colspec colnum="3" colwidth="1in" colname="FPU Choice"/>
|
---|
| 177 | <colspec colnum="4" colwidth="1in" colname="FPU Choice"/>
|
---|
| 178 |
|
---|
| 179 | <tbody>
|
---|
| 180 | <row>
|
---|
| 181 | <entry>fpa</entry>
|
---|
| 182 | <entry>fpe2</entry>
|
---|
| 183 | <entry>fpe3</entry>
|
---|
| 184 | <entry>maverick</entry>
|
---|
| 185 | </row>
|
---|
| 186 | <row>
|
---|
| 187 | <entry>vfp</entry>
|
---|
| 188 | <entry>vfpv3</entry>
|
---|
| 189 | <entry>vfpv3-fp16</entry>
|
---|
| 190 | <entry>vfpv3-d16</entry>
|
---|
| 191 | </row>
|
---|
| 192 | <row>
|
---|
| 193 | <entry>vfpv3-d16-fp16</entry>
|
---|
| 194 | <entry>vfpv3xd</entry>
|
---|
| 195 | <entry>vfpv3xd-fp16</entry>
|
---|
| 196 | <entry>neon</entry>
|
---|
| 197 | </row>
|
---|
| 198 | <row>
|
---|
| 199 | <entry>neon-fp16</entry>
|
---|
| 200 | <entry>vfpv4</entry>
|
---|
| 201 | <entry>vfpv4-d16</entry>
|
---|
| 202 | <entry>fpv4-sp-d16</entry>
|
---|
| 203 | </row>
|
---|
| 204 | <row>
|
---|
| 205 | <entry>neon-vfpv4</entry>
|
---|
| 206 | </row>
|
---|
| 207 | </tbody>
|
---|
| 208 | </tgroup>
|
---|
| 209 | </table>
|
---|
| 210 |
|
---|
[ad36f39] | 211 | </sect1>
|
---|