blob: b6925fa266d776648e7a02fd5497b5ffa1c52700 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3[<!ENTITY % poky SYSTEM "../poky.ent"> %poky; ] >
4
5<chapter id='sdk-intro'>
6<title>Introduction</title>
7
8<section id='sdk-manual-intro'>
9 <title>Introduction</title>
10
11 <para>
Brad Bishopd7bf8c12018-02-25 22:55:05 -050012 Welcome to the Yocto Project Application Development and the
13 Extensible Software Development Kit (eSDK) manual.
Patrick Williamsc0f7c042017-02-23 20:41:17 -060014 This manual provides information that explains how to use both the
15 Yocto Project extensible and standard SDKs to develop
16 applications and images.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050017 Additionally, the manual also provides information on how to use
18 the popular <trademark class='trade'>Eclipse</trademark> IDE as part
Patrick Williamsc0f7c042017-02-23 20:41:17 -060019 of your application development workflow within the SDK environment.
20 <note>
21 Prior to the 2.0 Release of the Yocto Project, application
22 development was primarily accomplished through the use of the
23 Application Development Toolkit (ADT) and the availability
24 of stand-alone cross-development toolchains and other tools.
25 With the 2.1 Release of the Yocto Project, application development
26 has transitioned to within a tool-rich extensible SDK and the more
27 traditional standard SDK.
28 </note>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050029 </para>
30
31 <para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060032 All SDKs consist of the following:
33 <itemizedlist>
34 <listitem><para><emphasis>Cross-Development Toolchain</emphasis>:
35 This toolchain contains a compiler, debugger, and various
36 miscellaneous tools.
37 </para></listitem>
38 <listitem><para><emphasis>Libraries, Headers, and Symbols</emphasis>:
39 The libraries, headers, and symbols are specific to the image
40 (i.e. they match the image).
41 </para></listitem>
42 <listitem><para><emphasis>Environment Setup Script</emphasis>:
43 This <filename>*.sh</filename> file, once run, sets up the
44 cross-development environment by defining variables and
45 preparing for SDK use.
46 </para></listitem>
47 </itemizedlist>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050048 </para>
49
50 <para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060051 Additionally an extensible SDK has tools that allow you to easily add
52 new applications and libraries to an image, modify the source of an
53 existing component, test changes on the target hardware, and easily
54 integrate an application into the
Brad Bishopd7bf8c12018-02-25 22:55:05 -050055 <ulink url='&YOCTO_DOCS_REF_URL;#build-system-term'>OpenEmbedded build system</ulink>.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050056 </para>
57
58 <para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060059 You can use an SDK to independently develop and test code
60 that is destined to run on some target machine.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050061 SDKs are completely self-contained.
62 The binaries are linked against their own copy of
63 <filename>libc</filename>, which results in no dependencies
64 on the target system.
65 To achieve this, the pointer to the dynamic loader is
66 configured at install time since that path cannot be dynamically
67 altered.
68 This is the reason for a wrapper around the
69 <filename>populate_sdk</filename> and
70 <filename>populate_sdk_ext</filename> archives.
71 </para>
72
73 <para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060074 Another feature for the SDKs is that only one set of cross-compiler
75 toolchain binaries are produced for any given architecture.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050076 This feature takes advantage of the fact that the target hardware can
77 be passed to <filename>gcc</filename> as a set of compiler options.
78 Those options are set up by the environment script and contained in
79 variables such as
80 <ulink url='&YOCTO_DOCS_REF_URL;#var-CC'><filename>CC</filename></ulink>
81 and
82 <ulink url='&YOCTO_DOCS_REF_URL;#var-LD'><filename>LD</filename></ulink>.
83 This reduces the space needed for the tools.
84 Understand, however, that a sysroot is still needed for every target
85 since those binaries are target-specific.
86 </para>
87
88 <para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060089 The SDK development environment consists of the following:
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050090 <itemizedlist>
Patrick Williamsc0f7c042017-02-23 20:41:17 -060091 <listitem><para>The self-contained SDK, which is an
92 architecture-specific cross-toolchain and
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050093 matching sysroots (target and native) all built by the
Patrick Williamsc0f7c042017-02-23 20:41:17 -060094 OpenEmbedded build system (e.g. the SDK).
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050095 The toolchain and sysroots are based on a
Brad Bishopd7bf8c12018-02-25 22:55:05 -050096 <ulink url='&YOCTO_DOCS_REF_URL;#metadata'>Metadata</ulink>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050097 configuration and extensions,
98 which allows you to cross-develop on the host machine for the
99 target hardware.
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600100 Additionally, the extensible SDK contains the
101 <filename>devtool</filename> functionality.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500102 </para></listitem>
103 <listitem><para>The Quick EMUlator (QEMU), which lets you simulate
104 target hardware.
105 QEMU is not literally part of the SDK.
106 You must build and include this emulator separately.
107 However, QEMU plays an important role in the development
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600108 process that revolves around use of the SDK.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500109 </para></listitem>
110 <listitem><para>The Eclipse IDE Yocto Plug-in.
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600111 This plug-in is available for you if you are an Eclipse
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500112 user.
113 In the same manner as QEMU, the plug-in is not literally part
114 of the SDK but is rather available for use as part of the
115 development process.
116 </para></listitem>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600117 <listitem><para>Various performance-related
118 <ulink url='http://www.eclipse.org/linuxtools/index.php'>tools</ulink>
119 that can enhance your development experience.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500120 These tools are also separate from the actual SDK but can be
121 independently obtained and used in the development process.
122 </para></listitem>
123 </itemizedlist>
124 </para>
125
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600126 <para>
127 In summary, the extensible and standard SDK share many features.
128 However, the extensible SDK has powerful development tools to help you
129 more quickly develop applications.
130 Following is a table that summarizes the primary differences between
131 the standard and extensible SDK types when considering which to
132 build:
133 <informaltable frame='none'>
134 <tgroup cols='3' align='left' colsep='1' rowsep='1'>
135 <colspec colname='c1' colwidth='1*'/>
136 <colspec colname='c2' colwidth='1*'/>
137 <colspec colname='c3' colwidth='1*'/>
138 <thead>
139 <row>
140 <entry align="left"><emphasis>Feature</emphasis></entry>
141 <entry align="left"><emphasis>Standard SDK</emphasis></entry>
142 <entry align="left"><emphasis>Extensible SDK</emphasis></entry>
143 </row>
144 </thead>
145 <tbody>
146 <row>
147 <entry align="left">Toolchain</entry>
148 <entry align="left">Yes</entry>
149 <entry align="left">Yes*</entry>
150 </row>
151 <row>
152 <entry align="left">Debugger</entry>
153 <entry align="left">Yes</entry>
154 <entry align="left">Yes*</entry>
155 </row>
156 <row>
157 <entry align="left">Size</entry>
158 <entry align="left">100+ MBytes</entry>
159 <entry align="left">1+ GBytes (or 300+ MBytes for minimal w/toolchain)</entry>
160 </row>
161 <row>
162 <entry align="left"><filename>devtool</filename></entry>
163 <entry align="left">No</entry>
164 <entry align="left">Yes</entry>
165 </row>
166 <row>
167 <entry align="left">Build Images</entry>
168 <entry align="left">No</entry>
169 <entry align="left">Yes</entry>
170 </row>
171 <row>
172 <entry align="left">Updateable</entry>
173 <entry align="left">No</entry>
174 <entry align="left">Yes</entry>
175 </row>
176 <row>
177 <entry align="left">Managed Sysroot**</entry>
178 <entry align="left">No</entry>
179 <entry align="left">Yes</entry>
180 </row>
181 <row>
182 <entry align="left">Installed Packages</entry>
183 <entry align="left">No***</entry>
184 <entry align="left">Yes****</entry>
185 </row>
186 <row>
187 <entry align="left">Construction</entry>
188 <entry align="left">Packages</entry>
189 <entry align="left">Shared State</entry>
190 </row>
191 </tbody>
192 </tgroup>
193 </informaltable>
194 <literallayout class='monospaced'>
195 * Extensible SDK will contain the toolchain and debugger if <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_EXT_TYPE'><filename>SDK_EXT_TYPE</filename></ulink> is "full" or <ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_INCLUDE_TOOLCHAIN'><filename>SDK_INCLUDE_TOOLCHAIN</filename></ulink> is "1", which is the default.
196
197 ** Sysroot is managed through use of <filename>devtool</filename>. Thus, it is less likely that you will corrupt your SDK sysroot when you try to add additional libraries.
198
199 *** Runtime package management can be added to the standard SDK but it is not supported by default.
200
201 **** You must build and make the shared state available to extensible SDK users for "packages" you want to enable users to install.
202 </literallayout>
203 </para>
204
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500205 <section id='the-cross-development-toolchain'>
206 <title>The Cross-Development Toolchain</title>
207
208 <para>
209 The
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500210 <ulink url='&YOCTO_DOCS_REF_URL;#cross-development-toolchain'>Cross-Development Toolchain</ulink>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500211 consists of a cross-compiler, cross-linker, and cross-debugger
212 that are used to develop user-space applications for targeted
213 hardware.
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600214 Additionally, for an extensible SDK, the toolchain also has
215 built-in <filename>devtool</filename> functionality.
216 This toolchain is created by running a SDK installer script
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500217 or through a
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500218 <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500219 that is based on your Metadata configuration or extension for
220 your targeted device.
221 The cross-toolchain works with a matching target sysroot.
222 </para>
223 </section>
224
225 <section id='sysroot'>
226 <title>Sysroots</title>
227
228 <para>
229 The native and target sysroots contain needed headers and libraries
230 for generating binaries that run on the target architecture.
231 The target sysroot is based on the target root filesystem image
232 that is built by the OpenEmbedded build system and uses the same
233 Metadata configuration used to build the cross-toolchain.
234 </para>
235 </section>
236
237 <section id='the-qemu-emulator'>
238 <title>The QEMU Emulator</title>
239
240 <para>
241 The QEMU emulator allows you to simulate your hardware while
242 running your application or image.
243 QEMU is not part of the SDK but is made available a number of ways:
244 <itemizedlist>
245 <listitem><para>
246 If you have cloned the <filename>poky</filename> Git
247 repository to create a
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500248 <ulink url='&YOCTO_DOCS_REF_URL;#source-directory'>Source Directory</ulink>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500249 and you have sourced the environment setup script, QEMU is
250 installed and automatically available.
251 </para></listitem>
252 <listitem><para>
253 If you have downloaded a Yocto Project release and unpacked
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500254 it to create a Source Directory and you have sourced the
255 environment setup script, QEMU is installed and
256 automatically available.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500257 </para></listitem>
258 <listitem><para>
259 If you have installed the cross-toolchain tarball and you
260 have sourced the toolchain's setup environment script, QEMU
261 is also installed and automatically available.
262 </para></listitem>
263 </itemizedlist>
264 </para>
265 </section>
266
267 <section id='eclipse-overview'>
268 <title>Eclipse Yocto Plug-in</title>
269
270 <para>
271 The Eclipse IDE is a popular development environment and it fully
272 supports development using the Yocto Project.
273 When you install and configure the Eclipse Yocto Project Plug-in
274 into the Eclipse IDE, you maximize your Yocto Project experience.
275 Installing and configuring the Plug-in results in an environment
276 that has extensions specifically designed to let you more easily
277 develop software.
278 These extensions allow for cross-compilation, deployment, and
279 execution of your output into a QEMU emulation session.
280 You can also perform cross-debugging and profiling.
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600281 The environment also supports many performance-related
282 <ulink url='http://www.eclipse.org/linuxtools/index.php'>tools</ulink>
283 that enhance your development experience.
284 <note>
285 Previous releases of the Eclipse Yocto Plug-in supported
286 "user-space tools" (i.e. LatencyTOP, PowerTOP, Perf, SystemTap,
287 and Lttng-ust) that also added to the development experience.
288 These tools have been deprecated beginning with this release
289 of the plug-in.
290 </note>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500291 </para>
292
293 <para>
294 For information about the application development workflow that
295 uses the Eclipse IDE and for a detailed example of how to install
296 and configure the Eclipse Yocto Project Plug-in, see the
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500297 "<link linkend='sdk-eclipse-project'>Developing Applications Using <trademark class='trade'>Eclipse</trademark></link>"
298 Chapter.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500299 </para>
300 </section>
301
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600302 <section id='performance-enhancing-tools'>
303 <title>Performance Enhancing Tools</title>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500304
305 <para>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600306 Supported performance enhancing tools are available that let you
307 profile, debug, and perform tracing on your projects developed
308 using Eclipse.
309 For information on these tools see
310 <ulink url='http://www.eclipse.org/linuxtools/'>http://www.eclipse.org/linuxtools/</ulink>.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500311 </para>
312 </section>
313</section>
314
315<section id='sdk-development-model'>
316 <title>SDK Development Model</title>
317
318 <para>
319 Fundamentally, the SDK fits into the development process as follows:
320 <imagedata fileref="figures/sdk-environment.png" align="center" width="6in" depth="5in" scalefit="100" />
321 The SDK is installed on any machine and can be used to develop
322 applications, images, and kernels.
323 An SDK can even be used by a QA Engineer or Release Engineer.
324 The fundamental concept is that the machine that has the SDK installed
325 does not have to be associated with the machine that has the
326 Yocto Project installed.
327 A developer can independently compile and test an object on their
328 machine and then, when the object is ready for integration into an
329 image, they can simply make it available to the machine that has the
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600330 Yocto Project.
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500331 Once the object is available, the image can be rebuilt using the
332 Yocto Project to produce the modified image.
333 </para>
334
335 <para>
336 You just need to follow these general steps:
337 <orderedlist>
338 <listitem><para><emphasis>Install the SDK for your target hardware:</emphasis>
339 For information on how to install the SDK, see the
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600340 "<link linkend='sdk-installing-the-sdk'>Installing the SDK</link>"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500341 section.</para></listitem>
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600342 <listitem><para><emphasis>Download or Build the Target Image:</emphasis>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500343 The Yocto Project supports several target architectures
344 and has many pre-built kernel images and root filesystem
345 images.</para>
346 <para>If you are going to develop your application on
347 hardware, go to the
348 <ulink url='&YOCTO_MACHINES_DL_URL;'><filename>machines</filename></ulink>
349 download area and choose a target machine area
350 from which to download the kernel image and root filesystem.
351 This download area could have several files in it that
352 support development using actual hardware.
353 For example, the area might contain
354 <filename>.hddimg</filename> files that combine the
355 kernel image with the filesystem, boot loaders, and
356 so forth.
357 Be sure to get the files you need for your particular
358 development process.</para>
359 <para>If you are going to develop your application and
360 then run and test it using the QEMU emulator, go to the
361 <ulink url='&YOCTO_QEMU_DL_URL;'><filename>machines/qemu</filename></ulink>
362 download area.
363 From this area, go down into the directory for your
364 target architecture (e.g. <filename>qemux86_64</filename>
365 for an <trademark class='registered'>Intel</trademark>-based
366 64-bit architecture).
367 Download kernel, root filesystem, and any other files you
368 need for your process.
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600369 <note>
370 To use the root filesystem in QEMU, you
371 need to extract it.
372 See the
373 "<link linkend='sdk-extracting-the-root-filesystem'>Extracting the Root Filesystem</link>"
374 section for information on how to extract the root
375 filesystem.
376 </note>
377 </para></listitem>
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500378 <listitem><para><emphasis>Develop and Test your
379 Application:</emphasis> At this point, you have the tools
380 to develop your application.
381 If you need to separately install and use the QEMU
382 emulator, you can go to
383 <ulink url='http://wiki.qemu.org/Main_Page'>QEMU Home Page</ulink>
384 to download and learn about the emulator.
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600385 See the
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500386 "<ulink url='&YOCTO_DOCS_DEV_URL;#dev-manual-qemu'>Using the Quick EMUlator (QEMU)</ulink>"
Brad Bishopd7bf8c12018-02-25 22:55:05 -0500387 chapter in the Yocto Project Development Tasks Manual
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500388 for information on using QEMU within the Yocto
389 Project.</para></listitem>
390 </orderedlist>
391 </para>
392
393 <para>
394 The remainder of this manual describes how to use both the standard
395 SDK and the extensible SDK.
396 Information also exists in appendix form that describes how you can
397 build, install, and modify an SDK.
398 </para>
399</section>
400
401</chapter>
402<!--
403vim: expandtab tw=80 ts=4
404-->