diff options
Diffstat (limited to 'documentation/getting-started/eclipse/html/getting-started/cross-development-toolchain-generation.html')
-rw-r--r-- | documentation/getting-started/eclipse/html/getting-started/cross-development-toolchain-generation.html | 241 |
1 files changed, 241 insertions, 0 deletions
diff --git a/documentation/getting-started/eclipse/html/getting-started/cross-development-toolchain-generation.html b/documentation/getting-started/eclipse/html/getting-started/cross-development-toolchain-generation.html new file mode 100644 index 0000000000..a1aef9119d --- /dev/null +++ b/documentation/getting-started/eclipse/html/getting-started/cross-development-toolchain-generation.html | |||
@@ -0,0 +1,241 @@ | |||
1 | <html> | ||
2 | <head> | ||
3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | ||
4 | <title>3.2. Cross-Development Toolchain Generation</title> | ||
5 | <link rel="stylesheet" type="text/css" href="../book.css"> | ||
6 | <meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> | ||
7 | <link rel="home" href="index.html" title="Getting Started With Yocto Project"> | ||
8 | <link rel="up" href="overview-concepts.html" title="Chapter 3. Yocto Project Concepts"> | ||
9 | <link rel="prev" href="usingpoky-components-configuration.html" title="3.1.5. Configuration"> | ||
10 | <link rel="next" href="shared-state-cache.html" title="3.3. Shared State Cache"> | ||
11 | </head> | ||
12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="3.2. Cross-Development Toolchain Generation"> | ||
13 | <div class="titlepage"><div><div><h2 class="title" style="clear: both"> | ||
14 | <a name="cross-development-toolchain-generation"></a>3.2. Cross-Development Toolchain Generation</h2></div></div></div> | ||
15 | <p> | ||
16 | The Yocto Project does most of the work for you when it comes to | ||
17 | creating | ||
18 | <a class="link" href="../ref-manual/cross-development-toolchain.html" target="_self">cross-development toolchains</a>. | ||
19 | This section provides some technical background on how | ||
20 | cross-development toolchains are created and used. | ||
21 | For more information on toolchains, you can also see the | ||
22 | <a class="link" href="../sdk-manual/index.html" target="_self">Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</a> | ||
23 | manual. | ||
24 | </p> | ||
25 | <p> | ||
26 | In the Yocto Project development environment, cross-development | ||
27 | toolchains are used to build the image and applications that run | ||
28 | on the target hardware. | ||
29 | With just a few commands, the OpenEmbedded build system creates | ||
30 | these necessary toolchains for you. | ||
31 | </p> | ||
32 | <p> | ||
33 | The following figure shows a high-level build environment regarding | ||
34 | toolchain construction and use. | ||
35 | </p> | ||
36 | <p> | ||
37 | </p> | ||
38 | <table border="0" summary="manufactured viewport for HTML img" cellspacing="0" cellpadding="0" width="720"><tr style="height: 540px"><td align="center"><img src="figures/cross-development-toolchains.png" align="middle" width="720"></td></tr></table> | ||
39 | <p> | ||
40 | </p> | ||
41 | <p> | ||
42 | Most of the work occurs on the Build Host. | ||
43 | This is the machine used to build images and generally work within the | ||
44 | the Yocto Project environment. | ||
45 | When you run BitBake to create an image, the OpenEmbedded build system | ||
46 | uses the host <code class="filename">gcc</code> compiler to bootstrap a | ||
47 | cross-compiler named <code class="filename">gcc-cross</code>. | ||
48 | The <code class="filename">gcc-cross</code> compiler is what BitBake uses to | ||
49 | compile source files when creating the target image. | ||
50 | You can think of <code class="filename">gcc-cross</code> simply as an | ||
51 | automatically generated cross-compiler that is used internally within | ||
52 | BitBake only. | ||
53 | </p> | ||
54 | <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"> | ||
55 | <h3 class="title">Note</h3> | ||
56 | The extensible SDK does not use | ||
57 | <code class="filename">gcc-cross-canadian</code> since this SDK | ||
58 | ships a copy of the OpenEmbedded build system and the sysroot | ||
59 | within it contains <code class="filename">gcc-cross</code>. | ||
60 | </div> | ||
61 | <p> | ||
62 | </p> | ||
63 | <p> | ||
64 | The chain of events that occurs when <code class="filename">gcc-cross</code> is | ||
65 | bootstrapped is as follows: | ||
66 | </p> | ||
67 | <pre class="literallayout"> | ||
68 | gcc -> binutils-cross -> gcc-cross-initial -> linux-libc-headers -> glibc-initial -> glibc -> gcc-cross -> gcc-runtime | ||
69 | </pre> | ||
70 | <p> | ||
71 | </p> | ||
72 | <div class="itemizedlist"><ul class="itemizedlist" type="disc"> | ||
73 | <li class="listitem"><p> | ||
74 | <code class="filename">gcc</code>: | ||
75 | The build host's GNU Compiler Collection (GCC). | ||
76 | </p></li> | ||
77 | <li class="listitem"><p> | ||
78 | <code class="filename">binutils-cross</code>: | ||
79 | The bare minimum binary utilities needed in order to run | ||
80 | the <code class="filename">gcc-cross-initial</code> phase of the | ||
81 | bootstrap operation. | ||
82 | </p></li> | ||
83 | <li class="listitem"><p> | ||
84 | <code class="filename">gcc-cross-initial</code>: | ||
85 | An early stage of the bootstrap process for creating | ||
86 | the cross-compiler. | ||
87 | This stage builds enough of the <code class="filename">gcc-cross</code>, | ||
88 | the C library, and other pieces needed to finish building the | ||
89 | final cross-compiler in later stages. | ||
90 | This tool is a "native" package (i.e. it is designed to run on | ||
91 | the build host). | ||
92 | </p></li> | ||
93 | <li class="listitem"><p> | ||
94 | <code class="filename">linux-libc-headers</code>: | ||
95 | Headers needed for the cross-compiler. | ||
96 | </p></li> | ||
97 | <li class="listitem"><p> | ||
98 | <code class="filename">glibc-initial</code>: | ||
99 | An initial version of the Embedded GLIBC needed to bootstrap | ||
100 | <code class="filename">glibc</code>. | ||
101 | </p></li> | ||
102 | <li class="listitem"> | ||
103 | <p> | ||
104 | <code class="filename">gcc-cross</code>: | ||
105 | The final stage of the bootstrap process for the | ||
106 | cross-compiler. | ||
107 | This stage results in the actual cross-compiler that | ||
108 | BitBake uses when it builds an image for a targeted | ||
109 | device. | ||
110 | </p> | ||
111 | <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"> | ||
112 | <h3 class="title">Note</h3> | ||
113 | If you are replacing this cross compiler toolchain | ||
114 | with a custom version, you must replace | ||
115 | <code class="filename">gcc-cross</code>. | ||
116 | </div> | ||
117 | <p> | ||
118 | This tool is also a "native" package (i.e. it is | ||
119 | designed to run on the build host). | ||
120 | </p> | ||
121 | </li> | ||
122 | <li class="listitem"><p> | ||
123 | <code class="filename">gcc-runtime</code>: | ||
124 | Runtime libraries resulting from the toolchain bootstrapping | ||
125 | process. | ||
126 | This tool produces a binary that consists of the | ||
127 | runtime libraries need for the targeted device. | ||
128 | </p></li> | ||
129 | </ul></div> | ||
130 | <p> | ||
131 | </p> | ||
132 | <p> | ||
133 | You can use the OpenEmbedded build system to build an installer for | ||
134 | the relocatable SDK used to develop applications. | ||
135 | When you run the installer, it installs the toolchain, which contains | ||
136 | the development tools (e.g., the | ||
137 | <code class="filename">gcc-cross-canadian</code>), | ||
138 | <code class="filename">binutils-cross-canadian</code>, and other | ||
139 | <code class="filename">nativesdk-*</code> tools, | ||
140 | which are tools native to the SDK (i.e. native to | ||
141 | <a class="link" href="../ref-manual/var-SDK_ARCH.html" target="_self"><code class="filename">SDK_ARCH</code></a>), | ||
142 | you need to cross-compile and test your software. | ||
143 | The figure shows the commands you use to easily build out this | ||
144 | toolchain. | ||
145 | This cross-development toolchain is built to execute on the | ||
146 | <a class="link" href="../ref-manual/var-SDKMACHINE.html" target="_self"><code class="filename">SDKMACHINE</code></a>, | ||
147 | which might or might not be the same | ||
148 | machine as the Build Host. | ||
149 | </p> | ||
150 | <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"> | ||
151 | <h3 class="title">Note</h3> | ||
152 | If your target architecture is supported by the Yocto Project, | ||
153 | you can take advantage of pre-built images that ship with the | ||
154 | Yocto Project and already contain cross-development toolchain | ||
155 | installers. | ||
156 | </div> | ||
157 | <p> | ||
158 | </p> | ||
159 | <p> | ||
160 | Here is the bootstrap process for the relocatable toolchain: | ||
161 | </p> | ||
162 | <pre class="literallayout"> | ||
163 | gcc -> binutils-crosssdk -> gcc-crosssdk-initial -> linux-libc-headers -> | ||
164 | glibc-initial -> nativesdk-glibc -> gcc-crosssdk -> gcc-cross-canadian | ||
165 | </pre> | ||
166 | <p> | ||
167 | </p> | ||
168 | <div class="itemizedlist"><ul class="itemizedlist" type="disc"> | ||
169 | <li class="listitem"><p> | ||
170 | <code class="filename">gcc</code>: | ||
171 | The build host's GNU Compiler Collection (GCC). | ||
172 | </p></li> | ||
173 | <li class="listitem"><p> | ||
174 | <code class="filename">binutils-crosssdk</code>: | ||
175 | The bare minimum binary utilities needed in order to run | ||
176 | the <code class="filename">gcc-crosssdk-initial</code> phase of the | ||
177 | bootstrap operation. | ||
178 | </p></li> | ||
179 | <li class="listitem"><p> | ||
180 | <code class="filename">gcc-crosssdk-initial</code>: | ||
181 | An early stage of the bootstrap process for creating | ||
182 | the cross-compiler. | ||
183 | This stage builds enough of the | ||
184 | <code class="filename">gcc-crosssdk</code> and supporting pieces so that | ||
185 | the final stage of the bootstrap process can produce the | ||
186 | finished cross-compiler. | ||
187 | This tool is a "native" binary that runs on the build host. | ||
188 | </p></li> | ||
189 | <li class="listitem"><p> | ||
190 | <code class="filename">linux-libc-headers</code>: | ||
191 | Headers needed for the cross-compiler. | ||
192 | </p></li> | ||
193 | <li class="listitem"><p> | ||
194 | <code class="filename">glibc-initial</code>: | ||
195 | An initial version of the Embedded GLIBC needed to bootstrap | ||
196 | <code class="filename">nativesdk-glibc</code>. | ||
197 | </p></li> | ||
198 | <li class="listitem"><p> | ||
199 | <code class="filename">nativesdk-glibc</code>: | ||
200 | The Embedded GLIBC needed to bootstrap the | ||
201 | <code class="filename">gcc-crosssdk</code>. | ||
202 | </p></li> | ||
203 | <li class="listitem"><p> | ||
204 | <code class="filename">gcc-crosssdk</code>: | ||
205 | The final stage of the bootstrap process for the | ||
206 | relocatable cross-compiler. | ||
207 | The <code class="filename">gcc-crosssdk</code> is a transitory compiler | ||
208 | and never leaves the build host. | ||
209 | Its purpose is to help in the bootstrap process to create the | ||
210 | eventual relocatable <code class="filename">gcc-cross-canadian</code> | ||
211 | compiler, which is relocatable. | ||
212 | This tool is also a "native" package (i.e. it is | ||
213 | designed to run on the build host). | ||
214 | </p></li> | ||
215 | <li class="listitem"><p> | ||
216 | <code class="filename">gcc-cross-canadian</code>: | ||
217 | The final relocatable cross-compiler. | ||
218 | When run on the | ||
219 | <a class="link" href="../ref-manual/var-SDKMACHINE.html" target="_self"><code class="filename">SDKMACHINE</code></a>, | ||
220 | this tool | ||
221 | produces executable code that runs on the target device. | ||
222 | Only one cross-canadian compiler is produced per architecture | ||
223 | since they can be targeted at different processor optimizations | ||
224 | using configurations passed to the compiler through the | ||
225 | compile commands. | ||
226 | This circumvents the need for multiple compilers and thus | ||
227 | reduces the size of the toolchains. | ||
228 | </p></li> | ||
229 | </ul></div> | ||
230 | <p> | ||
231 | </p> | ||
232 | <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"> | ||
233 | <h3 class="title">Note</h3> | ||
234 | For information on advantages gained when building a | ||
235 | cross-development toolchain installer, see the | ||
236 | "<a class="link" href="../sdk-manual/sdk-building-an-sdk-installer.html" target="_self">Building an SDK Installer</a>" | ||
237 | section in the Yocto Project Application Development and the | ||
238 | Extensible Software Development Kit (eSDK) manual. | ||
239 | </div> | ||
240 | </div></body> | ||
241 | </html> | ||