blob: f1ff0c76caa0dc3a2168a10662a428fb3bc1d099 [file] [log] [blame]
Andrew Geisslerf0343792020-11-18 10:42:21 -06001.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002
3**********************
4Using the Standard SDK
5**********************
6
7This chapter describes the standard SDK and how to install it.
8Information includes unique installation and setup aspects for the
9standard SDK.
10
11.. note::
12
13 For a side-by-side comparison of main features supported for a
William A. Kennington IIIac69b482021-06-02 12:28:27 -070014 standard SDK as compared to an extensible SDK, see the
15 ":ref:`sdk-manual/intro:introduction`" section.
Andrew Geisslerc9f78652020-09-18 14:11:35 -050016
17You can use a standard SDK to work on Makefile and Autotools-based
Andrew Geissler3b8a17c2021-04-15 15:55:55 -050018projects. See the
19":ref:`sdk-manual/working-projects:using the sdk toolchain directly`" chapter
20for more information.
Andrew Geisslerc9f78652020-09-18 14:11:35 -050021
Andrew Geisslerc9f78652020-09-18 14:11:35 -050022Why use the Standard SDK and What is in It?
23===========================================
24
25The Standard SDK provides a cross-development toolchain and libraries
26tailored to the contents of a specific image. You would use the Standard
27SDK if you want a more traditional toolchain experience as compared to
28the extensible SDK, which provides an internal build system and the
29``devtool`` functionality.
30
31The installed Standard SDK consists of several files and directories.
32Basically, it contains an SDK environment setup script, some
33configuration files, and host and target root filesystems to support
Andrew Geissler3b8a17c2021-04-15 15:55:55 -050034usage. You can see the directory structure in the
35":ref:`sdk-manual/appendix-obtain:installed standard sdk directory structure`"
36section.
Andrew Geisslerc9f78652020-09-18 14:11:35 -050037
Andrew Geisslerc9f78652020-09-18 14:11:35 -050038Installing the SDK
39==================
40
41The first thing you need to do is install the SDK on your :term:`Build
42Host` by running the ``*.sh`` installation script.
43
44You can download a tarball installer, which includes the pre-built
45toolchain, the ``runqemu`` script, and support files from the
Andrew Geissler09209ee2020-12-13 08:44:15 -060046appropriate :yocto_dl:`toolchain </releases/yocto/yocto-&DISTRO;/toolchain/>` directory within
Andrew Geisslerc9f78652020-09-18 14:11:35 -050047the Index of Releases. Toolchains are available for several 32-bit and
4864-bit architectures with the ``x86_64`` directories, respectively. The
49toolchains the Yocto Project provides are based off the
50``core-image-sato`` and ``core-image-minimal`` images and contain
William A. Kennington IIIac69b482021-06-02 12:28:27 -070051libraries appropriate for developing against the corresponding image.
Andrew Geisslerc9f78652020-09-18 14:11:35 -050052
53The names of the tarball installer scripts are such that a string
54representing the host system appears first in the filename and then is
Andrew Geissler517393d2023-01-13 08:55:19 -060055immediately followed by a string representing the target architecture::
Andrew Geisslerc9f78652020-09-18 14:11:35 -050056
57 poky-glibc-host_system-image_type-arch-toolchain-release_version.sh
58
59 Where:
60 host_system is a string representing your development system:
61
62 i686 or x86_64.
63
64 image_type is the image for which the SDK was built:
65
66 core-image-minimal or core-image-sato.
67
68 arch is a string representing the tuned target architecture:
69
70 aarch64, armv5e, core2-64, i586, mips32r2, mips64, ppc7400, or cortexa8hf-neon.
71
72 release_version is a string representing the release number of the Yocto Project:
73
Andrew Geissler09209ee2020-12-13 08:44:15 -060074 &DISTRO;, &DISTRO;+snapshot
Andrew Geisslerc9f78652020-09-18 14:11:35 -050075
76For example, the following SDK installer is for a 64-bit
77development host system and a i586-tuned target architecture based off
Andrew Geisslerc926e172021-05-07 16:11:35 -050078the SDK for ``core-image-sato`` and using the current DISTRO snapshot::
Andrew Geisslerc9f78652020-09-18 14:11:35 -050079
80 poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
81
82.. note::
83
84 As an alternative to downloading an SDK, you can build the SDK
William A. Kennington IIIac69b482021-06-02 12:28:27 -070085 installer. For information on building the installer, see the
86 ":ref:`sdk-manual/appendix-obtain:building an sdk installer`"
87 section.
Andrew Geisslerc9f78652020-09-18 14:11:35 -050088
89The SDK and toolchains are self-contained and by default are installed
90into the ``poky_sdk`` folder in your home directory. You can choose to
91install the extensible SDK in any location when you run the installer.
92However, because files need to be written under that directory during
93the normal course of operation, the location you choose for installation
94must be writable for whichever users need to use the SDK.
95
96The following command shows how to run the installer given a toolchain
97tarball for a 64-bit x86 development host system and a 64-bit x86 target
98architecture. The example assumes the SDK installer is located in
Andrew Geissler517393d2023-01-13 08:55:19 -060099``~/Downloads/`` and has execution rights::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500100
Andrew Geissler09209ee2020-12-13 08:44:15 -0600101 $ ./Downloads/poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh
102 Poky (Yocto Project Reference Distro) SDK installer version &DISTRO;
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500103 ===============================================================
Andrew Geissler09209ee2020-12-13 08:44:15 -0600104 Enter target directory for SDK (default: /opt/poky/&DISTRO;):
105 You are about to install the SDK to "/opt/poky/&DISTRO;". Proceed [Y/n]? Y
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500106 Extracting SDK........................................ ..............................done
107 Setting it up...done
108 SDK has been successfully set up and is ready to be used.
109 Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
Andrew Geissler09209ee2020-12-13 08:44:15 -0600110 $ . /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500111
Andrew Geissler517393d2023-01-13 08:55:19 -0600112.. note::
113
114 If you do not have write permissions for the directory into which you
115 are installing the SDK, the installer notifies you and exits. For
116 that case, set up the proper permissions in the directory and run the
117 installer again.
118
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500119Again, reference the
120":ref:`sdk-manual/appendix-obtain:installed standard sdk directory structure`"
121section for more details on the resulting directory structure of the installed
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500122SDK.
123
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500124Running the SDK Environment Setup Script
125========================================
126
127Once you have the SDK installed, you must run the SDK environment setup
128script before you can actually use the SDK. This setup script resides in
129the directory you chose when you installed the SDK, which is either the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600130default ``/opt/poky/&DISTRO;`` directory or the directory you chose during
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500131installation.
132
133Before running the script, be sure it is the one that matches the
134architecture for which you are developing. Environment setup scripts
135begin with the string "``environment-setup``" and include as part of
136their name the tuned target architecture. As an example, the following
137commands set the working directory to where the SDK was installed and
138then source the environment setup script. In this example, the setup
Andrew Geisslerc926e172021-05-07 16:11:35 -0500139script is for an IA-based target machine using i586 tuning::
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500140
Andrew Geissler09209ee2020-12-13 08:44:15 -0600141 $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500142
143When you run the
144setup script, the same environment variables are defined as are when you
Andrew Geissler3b8a17c2021-04-15 15:55:55 -0500145run the setup script for an extensible SDK. See the
146":ref:`sdk-manual/appendix-obtain:installed extensible sdk directory structure`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500147section for more information.