Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | <!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; ] > |
Andrew Geissler | d25ed32 | 2020-06-27 00:28:28 -0500 | [diff] [blame] | 4 | <!--SPDX-License-Identifier: CC-BY-2.0-UK--> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 5 | |
| 6 | <chapter id='sdk-using-the-standard-sdk'> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 7 | <title>Using the Standard SDK</title> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 8 | |
| 9 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 10 | This chapter describes the standard SDK and how to install it. |
| 11 | Information includes unique installation and setup aspects for the |
| 12 | standard SDK. |
| 13 | <note> |
| 14 | For a side-by-side comparison of main features supported for a |
| 15 | standard SDK as compared to an extensible SDK, see the |
| 16 | "<link linkend='sdk-manual-intro'>Introduction</link>" |
| 17 | section. |
| 18 | </note> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 19 | </para> |
| 20 | |
| 21 | <para> |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 22 | You can use a standard SDK to work on Makefile and Autotools-based |
| 23 | projects. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 24 | See the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 25 | "<link linkend='sdk-working-projects'>Using the SDK Toolchain Directly</link>" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 26 | chapter for more information. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 27 | </para> |
| 28 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 29 | <section id='sdk-standard-sdk-intro'> |
| 30 | <title>Why use the Standard SDK and What is in It?</title> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 31 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 32 | <para> |
| 33 | The Standard SDK provides a cross-development toolchain and |
| 34 | libraries tailored to the contents of a specific image. |
| 35 | You would use the Standard SDK if you want a more traditional |
| 36 | toolchain experience as compared to the extensible SDK, which |
| 37 | provides an internal build system and the |
| 38 | <filename>devtool</filename> functionality. |
| 39 | </para> |
| 40 | |
| 41 | <para> |
| 42 | The installed Standard SDK consists of several files and |
| 43 | directories. |
| 44 | Basically, it contains an SDK environment setup script, some |
| 45 | configuration files, and host and target root filesystems to |
| 46 | support usage. |
| 47 | You can see the directory structure in the |
| 48 | "<link linkend='sdk-installed-standard-sdk-directory-structure'>Installed Standard SDK Directory Structure</link>" |
| 49 | section. |
| 50 | </para> |
| 51 | </section> |
| 52 | |
| 53 | <section id='sdk-installing-the-sdk'> |
| 54 | <title>Installing the SDK</title> |
| 55 | |
| 56 | <para> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 57 | The first thing you need to do is install the SDK on your |
| 58 | <ulink url='&YOCTO_DOCS_REF_URL;#hardware-build-system-term'>Build Host</ulink> |
| 59 | by running the <filename>*.sh</filename> installation script. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 60 | </para> |
| 61 | |
| 62 | <para> |
| 63 | You can download a tarball installer, which includes the |
| 64 | pre-built toolchain, the <filename>runqemu</filename> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 65 | script, and support files from the appropriate |
| 66 | <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'>toolchain</ulink> |
| 67 | directory within the Index of Releases. |
| 68 | Toolchains are available for several 32-bit and 64-bit |
| 69 | architectures with the <filename>x86_64</filename> directories, |
| 70 | respectively. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 71 | The toolchains the Yocto Project provides are based off the |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 72 | <filename>core-image-sato</filename> and |
| 73 | <filename>core-image-minimal</filename> images and contain |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 74 | libraries appropriate for developing against that image. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 75 | </para> |
| 76 | |
| 77 | <para> |
| 78 | The names of the tarball installer scripts are such that a |
| 79 | string representing the host system appears first in the |
| 80 | filename and then is immediately followed by a string |
| 81 | representing the target architecture. |
| 82 | <literallayout class='monospaced'> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 83 | poky-glibc-<replaceable>host_system</replaceable>-<replaceable>image_type</replaceable>-<replaceable>arch</replaceable>-toolchain-<replaceable>release_version</replaceable>.sh |
| 84 | |
| 85 | Where: |
| 86 | <replaceable>host_system</replaceable> is a string representing your development system: |
| 87 | |
| 88 | i686 or x86_64. |
| 89 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 90 | <replaceable>image_type</replaceable> is the image for which the SDK was built: |
| 91 | |
| 92 | core-image-minimal or core-image-sato. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 93 | |
| 94 | <replaceable>arch</replaceable> is a string representing the tuned target architecture: |
| 95 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 96 | aarch64, armv5e, core2-64, i586, mips32r2, mips64, ppc7400, or cortexa8hf-neon. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 97 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 98 | <replaceable>release_version</replaceable> is a string representing the release number of the Yocto Project: |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 99 | |
| 100 | &DISTRO;, &DISTRO;+snapshot |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 101 | </literallayout> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 102 | For example, the following SDK installer is for a 64-bit |
| 103 | development host system and a i586-tuned target architecture |
| 104 | based off the SDK for <filename>core-image-sato</filename> and |
| 105 | using the current &DISTRO; snapshot: |
| 106 | <literallayout class='monospaced'> |
| 107 | poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh |
| 108 | </literallayout> |
| 109 | <note> |
| 110 | As an alternative to downloading an SDK, you can build the |
| 111 | SDK installer. |
| 112 | For information on building the installer, see the |
| 113 | "<link linkend='sdk-building-an-sdk-installer'>Building an SDK Installer</link>" |
| 114 | section. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 115 | </note> |
| 116 | </para> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 117 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 118 | <para> |
| 119 | The SDK and toolchains are self-contained and by default are |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 120 | installed into the <filename>poky_sdk</filename> folder in your |
| 121 | home directory. |
| 122 | You can choose to install the extensible SDK in any location when |
| 123 | you run the installer. |
| 124 | However, because files need to be written under that directory |
| 125 | during the normal course of operation, the location you choose |
| 126 | for installation must be writable for whichever |
| 127 | users need to use the SDK. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 128 | </para> |
| 129 | |
| 130 | <para> |
| 131 | The following command shows how to run the installer given a |
| 132 | toolchain tarball for a 64-bit x86 development host system and |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 133 | a 64-bit x86 target architecture. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 134 | The example assumes the SDK installer is located in |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 135 | <filename>~/Downloads/</filename> and has execution rights. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 136 | <note> |
| 137 | If you do not have write permissions for the directory |
| 138 | into which you are installing the SDK, the installer |
| 139 | notifies you and exits. |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 140 | For that case, set up the proper permissions in the directory |
| 141 | and run the installer again. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 142 | </note> |
| 143 | <literallayout class='monospaced'> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 144 | $ ./Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 145 | Poky (Yocto Project Reference Distro) SDK installer version &DISTRO; |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 146 | =============================================================== |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 147 | Enter target directory for SDK (default: /opt/poky/&DISTRO;): |
Brad Bishop | d89cb5f | 2019-04-10 09:02:41 -0400 | [diff] [blame] | 148 | You are about to install the SDK to "/opt/poky/&DISTRO;". Proceed [Y/n]? Y |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 149 | Extracting SDK........................................ ..............................done |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 150 | Setting it up...done |
| 151 | SDK has been successfully set up and is ready to be used. |
| 152 | Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 153 | $ . /opt/poky/&DISTRO;/environment-setup-i586-poky-linux |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 154 | </literallayout> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 155 | </para> |
| 156 | |
| 157 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 158 | Again, reference the |
| 159 | "<link linkend='sdk-installed-standard-sdk-directory-structure'>Installed Standard SDK Directory Structure</link>" |
| 160 | section for more details on the resulting directory structure of |
| 161 | the installed SDK. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 162 | </para> |
| 163 | </section> |
| 164 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 165 | <section id='sdk-running-the-sdk-environment-setup-script'> |
| 166 | <title>Running the SDK Environment Setup Script</title> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 167 | |
| 168 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 169 | Once you have the SDK installed, you must run the SDK environment |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 170 | setup script before you can actually use the SDK. |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 171 | This setup script resides in the directory you chose when you |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 172 | installed the SDK, which is either the default |
| 173 | <filename>/opt/poky/&DISTRO;</filename> directory or the directory |
| 174 | you chose during installation. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 175 | </para> |
| 176 | |
| 177 | <para> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 178 | Before running the script, be sure it is the one that matches the |
| 179 | architecture for which you are developing. |
| 180 | Environment setup scripts begin with the string |
| 181 | "<filename>environment-setup</filename>" and include as part of |
| 182 | their name the tuned target architecture. |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 183 | As an example, the following commands set the working directory |
| 184 | to where the SDK was installed and then source the environment |
| 185 | setup script. |
| 186 | In this example, the setup script is for an IA-based |
| 187 | target machine using i586 tuning: |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 188 | <literallayout class='monospaced'> |
| 189 | $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux |
| 190 | </literallayout> |
| 191 | When you run the setup script, the same environment variables are |
| 192 | defined as are when you run the setup script for an extensible SDK. |
| 193 | See the |
| 194 | "<link linkend='sdk-running-the-extensible-sdk-environment-setup-script'>Running the Extensible SDK Environment Setup Script</link>" |
| 195 | section for more information. |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 196 | </para> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 197 | </section> |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 198 | </chapter> |
| 199 | <!-- |
| 200 | vim: expandtab tw=80 ts=4 |
| 201 | --> |