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 set the target triplet for the target architecture, the MIPS |
---|
18 | level, and CPU endianess. If you do not know what triplet or level you want, |
---|
19 | you can use the table at the bottom of this page as a reference. Set |
---|
20 | the command using the method listed below:</para> |
---|
21 | |
---|
22 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" |
---|
23 | href="../common/variables.xml" |
---|
24 | xpointer="xpointer(//*[@os='b'])"/> |
---|
25 | |
---|
26 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" |
---|
27 | href="../common/variables.xml" |
---|
28 | xpointer="xpointer(//*[@os='c'])"/> |
---|
29 | |
---|
30 | <screen os="d"><userinput>export CLFS_ARCH=$(echo ${CLFS_TARGET} | sed -e 's/\(mips\)\(64\)\?\(el\)\?-.*/\1\3/') |
---|
31 | export CLFS_ENDIAN=$(echo ${CLFS_ARCH} | sed -e 's/mipsel/little/' -e 's/mips/big/')</userinput></screen> |
---|
32 | |
---|
33 | <para os="m1">Now you will need to set the MIPS LEVEL. This determines how your |
---|
34 | GCC and uClibc are built. There are currently 5 MIPS ISA Levels. To keep things |
---|
35 | simple we are only using two. For more information, see |
---|
36 | <ulink url="http://www.linux-mips.org/wiki/Instruction_Set_Architecture"/></para> |
---|
37 | |
---|
38 | <screen os="m2"><userinput>export CLFS_MIPS_LEVEL="<replaceable>[mips level]</replaceable>"</userinput></screen> |
---|
39 | |
---|
40 | <para os="m3">We also need to select the floating point capability of the CPU. |
---|
41 | If the CPU has built-in hardware for performing floating point calculations, |
---|
42 | choose "hard", otherwise choose "soft":</para> |
---|
43 | |
---|
44 | <screen os="m4"><userinput>export CLFS_FLOAT="<replaceable>[hard or soft]</replaceable>"</userinput></screen> |
---|
45 | |
---|
46 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" |
---|
47 | href="../common/variables.xml" |
---|
48 | xpointer="xpointer(//*[@os='g'])"/> |
---|
49 | |
---|
50 | <screen os="h"><userinput>echo export CLFS_HOST=\""${CLFS_HOST}\"" >> ~/.bashrc |
---|
51 | echo export CLFS_TARGET=\""${CLFS_TARGET}\"" >> ~/.bashrc |
---|
52 | echo export CLFS_ARCH=\""${CLFS_ARCH}\"" >> ~/.bashrc |
---|
53 | echo export CLFS_ENDIAN=\""${CLFS_ENDIAN}\"" >> ~/.bashrc |
---|
54 | echo export CLFS_MIPS_LEVEL=\""${CLFS_MIPS_LEVEL}\"" >> ~/.bashrc |
---|
55 | echo export CLFS_FLOAT=\""${CLFS_FLOAT}\"" >> ~/.bashrc</userinput></screen> |
---|
56 | |
---|
57 | <table os="i"> |
---|
58 | <title>Processor Type and Target Triplets</title> |
---|
59 | <?dbfo table-width="5.5in" ?> |
---|
60 | |
---|
61 | <tgroup cols="2"> |
---|
62 | |
---|
63 | <colspec colnum="1" colwidth="2in" colname="Processor"/> |
---|
64 | <colspec colnum="2" colwidth="2.5in" colname="Triplet"/> |
---|
65 | <colspec colnum="3" colwidth="1in" colname="MIPS Level"/> |
---|
66 | |
---|
67 | <thead> |
---|
68 | <row> |
---|
69 | <entry>Processor</entry> |
---|
70 | <entry>Target Triplet</entry> |
---|
71 | <entry>MIPS Level</entry> |
---|
72 | </row> |
---|
73 | </thead> |
---|
74 | |
---|
75 | <tbody> |
---|
76 | <row> |
---|
77 | <entry>MIPS 32 bits Little Endian</entry> |
---|
78 | <entry>mipsel-unknown-linux-uclibc</entry> |
---|
79 | <entry>1</entry> |
---|
80 | </row> |
---|
81 | <row> |
---|
82 | <entry>MIPS 32 bits Big Endian</entry> |
---|
83 | <entry>mips-unknown-linux-uclibc</entry> |
---|
84 | <entry>1</entry> |
---|
85 | </row> |
---|
86 | <row> |
---|
87 | <entry>MIPS 64 bits Little Endian</entry> |
---|
88 | <entry>mips64el-unknown-linux-uclibc</entry> |
---|
89 | <entry>3</entry> |
---|
90 | </row> |
---|
91 | <row> |
---|
92 | <entry>MIPS 64 bits Big Endian</entry> |
---|
93 | <entry>mips64-unknown-linux-uclibc</entry> |
---|
94 | <entry>3</entry> |
---|
95 | </row> |
---|
96 | </tbody> |
---|
97 | |
---|
98 | </tgroup> |
---|
99 | |
---|
100 | </table> |
---|
101 | |
---|
102 | </sect1> |
---|