sdk-using.rst 6.3 KB

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