Andrew Geissler | f034379 | 2020-11-18 10:42:21 -0600 | [diff] [blame] | 1 | .. SPDX-License-Identifier: CC-BY-SA-2.0-UK |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 2 | |
| 3 | ********************** |
| 4 | Using the Standard SDK |
| 5 | ********************** |
| 6 | |
| 7 | This chapter describes the standard SDK and how to install it. |
| 8 | Information includes unique installation and setup aspects for the |
| 9 | standard SDK. |
| 10 | |
| 11 | .. note:: |
| 12 | |
| 13 | For a side-by-side comparison of main features supported for a |
| 14 | standard SDK as compared to an extensible SDK, see the " |
| 15 | Introduction |
| 16 | " section. |
| 17 | |
| 18 | You can use a standard SDK to work on Makefile and Autotools-based |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 19 | projects. See the |
| 20 | ":ref:`sdk-manual/working-projects:using the sdk toolchain directly`" chapter |
| 21 | for more information. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 22 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 23 | Why use the Standard SDK and What is in It? |
| 24 | =========================================== |
| 25 | |
| 26 | The Standard SDK provides a cross-development toolchain and libraries |
| 27 | tailored to the contents of a specific image. You would use the Standard |
| 28 | SDK if you want a more traditional toolchain experience as compared to |
| 29 | the extensible SDK, which provides an internal build system and the |
| 30 | ``devtool`` functionality. |
| 31 | |
| 32 | The installed Standard SDK consists of several files and directories. |
| 33 | Basically, it contains an SDK environment setup script, some |
| 34 | configuration files, and host and target root filesystems to support |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 35 | usage. You can see the directory structure in the |
| 36 | ":ref:`sdk-manual/appendix-obtain:installed standard sdk directory structure`" |
| 37 | section. |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 38 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 39 | Installing the SDK |
| 40 | ================== |
| 41 | |
| 42 | The first thing you need to do is install the SDK on your :term:`Build |
| 43 | Host` by running the ``*.sh`` installation script. |
| 44 | |
| 45 | You can download a tarball installer, which includes the pre-built |
| 46 | toolchain, the ``runqemu`` script, and support files from the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 47 | appropriate :yocto_dl:`toolchain </releases/yocto/yocto-&DISTRO;/toolchain/>` directory within |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 48 | the Index of Releases. Toolchains are available for several 32-bit and |
| 49 | 64-bit architectures with the ``x86_64`` directories, respectively. The |
| 50 | toolchains the Yocto Project provides are based off the |
| 51 | ``core-image-sato`` and ``core-image-minimal`` images and contain |
| 52 | libraries appropriate for developing against that image. |
| 53 | |
| 54 | The names of the tarball installer scripts are such that a string |
| 55 | representing the host system appears first in the filename and then is |
| 56 | immediately followed by a string representing the target architecture. |
| 57 | :: |
| 58 | |
| 59 | poky-glibc-host_system-image_type-arch-toolchain-release_version.sh |
| 60 | |
| 61 | Where: |
| 62 | host_system is a string representing your development system: |
| 63 | |
| 64 | i686 or x86_64. |
| 65 | |
| 66 | image_type is the image for which the SDK was built: |
| 67 | |
| 68 | core-image-minimal or core-image-sato. |
| 69 | |
| 70 | arch is a string representing the tuned target architecture: |
| 71 | |
| 72 | aarch64, armv5e, core2-64, i586, mips32r2, mips64, ppc7400, or cortexa8hf-neon. |
| 73 | |
| 74 | release_version is a string representing the release number of the Yocto Project: |
| 75 | |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 76 | &DISTRO;, &DISTRO;+snapshot |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 77 | |
| 78 | For example, the following SDK installer is for a 64-bit |
| 79 | development host system and a i586-tuned target architecture based off |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame^] | 80 | the SDK for ``core-image-sato`` and using the current DISTRO snapshot:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 81 | |
| 82 | poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh |
| 83 | |
| 84 | .. note:: |
| 85 | |
| 86 | As an alternative to downloading an SDK, you can build the SDK |
| 87 | installer. For information on building the installer, see the " |
| 88 | Building an SDK Installer |
| 89 | " section. |
| 90 | |
| 91 | The SDK and toolchains are self-contained and by default are installed |
| 92 | into the ``poky_sdk`` folder in your home directory. You can choose to |
| 93 | install the extensible SDK in any location when you run the installer. |
| 94 | However, because files need to be written under that directory during |
| 95 | the normal course of operation, the location you choose for installation |
| 96 | must be writable for whichever users need to use the SDK. |
| 97 | |
| 98 | The following command shows how to run the installer given a toolchain |
| 99 | tarball for a 64-bit x86 development host system and a 64-bit x86 target |
| 100 | architecture. The example assumes the SDK installer is located in |
| 101 | ``~/Downloads/`` and has execution rights. |
| 102 | |
| 103 | .. note:: |
| 104 | |
| 105 | If you do not have write permissions for the directory into which you |
| 106 | are installing the SDK, the installer notifies you and exits. For |
| 107 | that case, set up the proper permissions in the directory and run the |
| 108 | installer again. |
| 109 | |
| 110 | :: |
| 111 | |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 112 | $ ./Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh |
| 113 | Poky (Yocto Project Reference Distro) SDK installer version &DISTRO; |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 114 | =============================================================== |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 115 | Enter target directory for SDK (default: /opt/poky/&DISTRO;): |
| 116 | You are about to install the SDK to "/opt/poky/&DISTRO;". Proceed [Y/n]? Y |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 117 | Extracting SDK........................................ ..............................done |
| 118 | Setting it up...done |
| 119 | SDK has been successfully set up and is ready to be used. |
| 120 | Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g. |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 121 | $ . /opt/poky/&DISTRO;/environment-setup-i586-poky-linux |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 122 | |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 123 | Again, reference the |
| 124 | ":ref:`sdk-manual/appendix-obtain:installed standard sdk directory structure`" |
| 125 | section for more details on the resulting directory structure of the installed |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 126 | SDK. |
| 127 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 128 | Running the SDK Environment Setup Script |
| 129 | ======================================== |
| 130 | |
| 131 | Once you have the SDK installed, you must run the SDK environment setup |
| 132 | script before you can actually use the SDK. This setup script resides in |
| 133 | the directory you chose when you installed the SDK, which is either the |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 134 | default ``/opt/poky/&DISTRO;`` directory or the directory you chose during |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 135 | installation. |
| 136 | |
| 137 | Before running the script, be sure it is the one that matches the |
| 138 | architecture for which you are developing. Environment setup scripts |
| 139 | begin with the string "``environment-setup``" and include as part of |
| 140 | their name the tuned target architecture. As an example, the following |
| 141 | commands set the working directory to where the SDK was installed and |
| 142 | then source the environment setup script. In this example, the setup |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame^] | 143 | script is for an IA-based target machine using i586 tuning:: |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 144 | |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 145 | $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 146 | |
| 147 | When you run the |
| 148 | setup script, the same environment variables are defined as are when you |
Andrew Geissler | 3b8a17c | 2021-04-15 15:55:55 -0500 | [diff] [blame] | 149 | run the setup script for an extensible SDK. See the |
| 150 | ":ref:`sdk-manual/appendix-obtain:installed extensible sdk directory structure`" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 151 | section for more information. |