1 | <?xml version="1.0" encoding="ISO-8859-1"?> |
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ |
---|
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 | |
---|
15 | <para os="a">During the building of the cross-compile tools, you will need to |
---|
16 | set a few variables that will be dependent on your particular needs. |
---|
17 | You will need to select the target triplet for the target architecture, |
---|
18 | the CPU architecture, 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 as a reference.</para> |
---|
22 | |
---|
23 | <para os="a1">If your processor is an ARM9, good choices include: triplet of |
---|
24 | armv5l-unknown-linux-uclibeabi, ARM arch of armv5t, and float of soft. ARM9 |
---|
25 | processors do not usually have hardware floating point abilities. If your |
---|
26 | processor is a Cortex-A series, which often have hardware floating point |
---|
27 | capability, good choices include: triplet of |
---|
28 | armv7a-unknown-linux-musleabi, ARM arch of armv7-a, float of hard, and fpu |
---|
29 | of vfpv3-d16.</para> |
---|
30 | |
---|
31 | <para os="a2">First, set the host and target triplets:</para> |
---|
32 | |
---|
33 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" |
---|
34 | href="../common/variables.xml" |
---|
35 | xpointer="xpointer(//*[@os='b'])"/> |
---|
36 | |
---|
37 | <table os="i"> |
---|
38 | <title>Example Processor Type, ABI, and Target Triplets</title> |
---|
39 | <?dbfo table-width="7in" ?> |
---|
40 | |
---|
41 | <tgroup cols="3"> |
---|
42 | |
---|
43 | <colspec colnum="1" colwidth="2.5in" colname="Processor"/> |
---|
44 | <colspec colnum="2" colwidth="1in" colname="ABI"/> |
---|
45 | <colspec colnum="3" colwidth="2.5in" colname="Triplet"/> |
---|
46 | |
---|
47 | <thead> |
---|
48 | <row> |
---|
49 | <entry>Processor</entry> |
---|
50 | <entry>ABI</entry> |
---|
51 | <entry>Target Triplet</entry> |
---|
52 | </row> |
---|
53 | </thead> |
---|
54 | |
---|
55 | <tbody> |
---|
56 | <row> |
---|
57 | <entry>Generic arm, version 5</entry> |
---|
58 | <entry>EABI</entry> |
---|
59 | <entry>armv5l-unknown-linux-musleabi</entry> |
---|
60 | </row> |
---|
61 | <row> |
---|
62 | <entry>Generic arm</entry> |
---|
63 | <entry>EABI</entry> |
---|
64 | <entry>arm-unknown-linux-musleabi</entry> |
---|
65 | </row> |
---|
66 | <row> |
---|
67 | <entry>Generic arm, version 7-a </entry> |
---|
68 | <entry>EABI</entry> |
---|
69 | <entry>armv7a-unknown-linux-musleabi</entry> |
---|
70 | </row> |
---|
71 | </tbody> |
---|
72 | |
---|
73 | </tgroup> |
---|
74 | |
---|
75 | </table> |
---|
76 | |
---|
77 | <para os="c">Now set the architecture of the CPU:</para> |
---|
78 | |
---|
79 | <screen os="d"><userinput>export CLFS_ARCH=arm</userinput></screen> |
---|
80 | |
---|
81 | <para os="e">Choose the ARM architecture (see table below):</para> |
---|
82 | |
---|
83 | <screen os="f"><userinput>export CLFS_ARM_ARCH="<replaceable>[architecture]</replaceable>"</userinput></screen> |
---|
84 | |
---|
85 | <table os="j"> |
---|
86 | <title>ARM Archiecture Choices</title> |
---|
87 | <?dbfo table-width="4in" ?> |
---|
88 | |
---|
89 | <tgroup cols="4"> |
---|
90 | |
---|
91 | <colspec colnum="1" colwidth="1in" colname="Arch Choice"/> |
---|
92 | <colspec colnum="2" colwidth="1in" colname="Arch Choice"/> |
---|
93 | <colspec colnum="3" colwidth="1in" colname="Arch Choice"/> |
---|
94 | <colspec colnum="4" colwidth="1in" colname="Arch Choice"/> |
---|
95 | |
---|
96 | <tbody> |
---|
97 | <row> |
---|
98 | <entry>armv4t</entry> |
---|
99 | <entry>armv5</entry> |
---|
100 | <entry>armv5t</entry> |
---|
101 | <entry>armv5te</entry> |
---|
102 | </row> |
---|
103 | <row> |
---|
104 | <entry>armv6</entry> |
---|
105 | <entry>armv6j</entry> |
---|
106 | <entry>armv6t2</entry> |
---|
107 | <entry>armv6z</entry> |
---|
108 | </row> |
---|
109 | <row> |
---|
110 | <entry>armv6zk</entry> |
---|
111 | <entry>armv6-m</entry> |
---|
112 | <entry>armv7</entry> |
---|
113 | <entry>armv7-a</entry> |
---|
114 | </row> |
---|
115 | <row> |
---|
116 | <entry>armv7-r</entry> |
---|
117 | <entry>armv7-m</entry> |
---|
118 | </row> |
---|
119 | </tbody> |
---|
120 | </tgroup> |
---|
121 | </table> |
---|
122 | |
---|
123 | <para os="f1">If your target CPU has hardware floating point support (not all |
---|
124 | ARM CPUs do), then set the following CLFS_FLOAT variable to either "hard" or |
---|
125 | "softfp". Use "softfp" if you need to integrate binaries compiled with |
---|
126 | "soft". Use "hard" if you don't. If your target CPU does not have hard |
---|
127 | floating point support, set the following CLFS_FLOAT vairable to |
---|
128 | "soft".</para> |
---|
129 | |
---|
130 | <screen os="f2"><userinput>export CLFS_FLOAT="<replaceable>[hard, softfp, or soft]"</replaceable></userinput></screen> |
---|
131 | |
---|
132 | <para os="f3">If you chose either "hard" or "softfp" for CLFS_FLOAT, you now |
---|
133 | need to set which floating point hardware is actually included (see table below) |
---|
134 | with your ARM CPU:</para> |
---|
135 | |
---|
136 | <screen os="f4"><userinput>export CLFS_FPU="<replaceable>[fpu version]</replaceable>"</userinput></screen> |
---|
137 | |
---|
138 | <table os="j"> |
---|
139 | <title>ARM Hard Floating Point Versions</title> |
---|
140 | <?dbfo table-width="4in" ?> |
---|
141 | |
---|
142 | <tgroup cols="4"> |
---|
143 | |
---|
144 | <colspec colnum="1" colwidth="1in" colname="FPU Choice"/> |
---|
145 | <colspec colnum="2" colwidth="1in" colname="FPU Choice"/> |
---|
146 | <colspec colnum="3" colwidth="1in" colname="FPU Choice"/> |
---|
147 | <colspec colnum="4" colwidth="1in" colname="FPU Choice"/> |
---|
148 | |
---|
149 | <tbody> |
---|
150 | <row> |
---|
151 | <entry>fpa</entry> |
---|
152 | <entry>fpe2</entry> |
---|
153 | <entry>fpe3</entry> |
---|
154 | <entry>maverick</entry> |
---|
155 | </row> |
---|
156 | <row> |
---|
157 | <entry>vfp</entry> |
---|
158 | <entry>vfpv3</entry> |
---|
159 | <entry>vfpv3-fp16</entry> |
---|
160 | <entry>vfpv3-d16</entry> |
---|
161 | </row> |
---|
162 | <row> |
---|
163 | <entry>vfpv3-d16-fp16</entry> |
---|
164 | <entry>vfpv3xd</entry> |
---|
165 | <entry>vfpv3xd-fp16</entry> |
---|
166 | <entry>neon</entry> |
---|
167 | </row> |
---|
168 | <row> |
---|
169 | <entry>neon-fp16</entry> |
---|
170 | <entry>vfpv4</entry> |
---|
171 | <entry>vfpv4-d16</entry> |
---|
172 | <entry>fpv4-sp-d16</entry> |
---|
173 | </row> |
---|
174 | <row> |
---|
175 | <entry>neon-vfpv4</entry> |
---|
176 | </row> |
---|
177 | </tbody> |
---|
178 | </tgroup> |
---|
179 | </table> |
---|
180 | |
---|
181 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" |
---|
182 | href="../common/variables.xml" |
---|
183 | xpointer="xpointer(//*[@os='g'])"/> |
---|
184 | |
---|
185 | <screen os="h"><userinput>echo export CLFS_HOST=\""${CLFS_HOST}\"" >> ~/.bashrc |
---|
186 | echo export CLFS_TARGET=\""${CLFS_TARGET}\"" >> ~/.bashrc |
---|
187 | echo export CLFS_ARCH=\""${CLFS_ARCH}\"" >> ~/.bashrc |
---|
188 | echo export CLFS_ARM_ARCH=\""${CLFS_ARM_ARCH}\"" >> ~/.bashrc |
---|
189 | echo export CLFS_FLOAT=\""${CLFS_FLOAT}\"" >> ~/.bashrc |
---|
190 | echo export CLFS_FPU=\""${CLFS_FPU}\"" >> ~/.bashrc</userinput></screen> |
---|
191 | |
---|
192 | </sect1> |
---|