From 0bb6e48a334d8ab7bedb7da9444a3a1b812ef996 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Wed, 2 Mar 2016 08:48:50 -0800 Subject: sdk-manual: WIP on the book. (From yocto-docs rev: 140577dd1f91c096152354e711709efe64bbcd0e) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- documentation/sdk-manual/sdk-appendix-obtain.xml | 256 +++++++++- documentation/sdk-manual/sdk-extensible.xml | 566 +++++++++++++++++++++-- documentation/sdk-manual/sdk-using.xml | 297 +++++++++--- 3 files changed, 998 insertions(+), 121 deletions(-) (limited to 'documentation') diff --git a/documentation/sdk-manual/sdk-appendix-obtain.xml b/documentation/sdk-manual/sdk-appendix-obtain.xml index eada4cc8ed..8b245615c9 100644 --- a/documentation/sdk-manual/sdk-appendix-obtain.xml +++ b/documentation/sdk-manual/sdk-appendix-obtain.xml @@ -6,26 +6,210 @@ Obtaining the SDK -
- Manual Development Notes for Scott and Paul +
+ Locating Pre-Built SDK Installers - - This chapter is going to cover details about the installed SDK and perhaps - stuff on locating it (e.g. the naming scheme used to identify the - .sh installation script. + + You can use existing, pre-built toolchains by locating and running + an SDK installer script that ships with the Yocto Project. + Using this method, you select and download an architecture-specific + toolchain installer and then run the script to hand-install the + toolchain. + + + + You can find SDK installers here: + + Standard SDK Installers + Go to + and find the folder that matches your host development system + (i.e. i686 for 32-bit machines or + x86_64 for 64-bit machines). + + Go into that folder and download the toolchain installer + whose name includes the appropriate target architecture. + The toolchains provided by the Yocto Project are based off of + the core-image-sato image and contain + libraries appropriate for developing against that image. + For example, if your host development system is a 64-bit x86 + system and you are going to use your cross-toolchain for a + 32-bit x86 target, go into the x86_64 + folder and download the following installer: + + poky-glibc-x86_64-core-image-sato-i586-toolchain-&DISTRO;.sh + + + Extensible SDK Installers + Installers for the extensible SDK are in + . + + + +
+ +
+ Optionally Building a Toolchain Installer + + + As an alternative to locating and downloading a toolchain installer, + you can build the toolchain installer if you have a + Build Directory. + + Although not the preferred method, it is also possible to use + bitbake meta-toolchain to build the toolchain + installer. + If you do use this method, you must separately install and extract + the target sysroot. + For information on how to install the sysroot, see the + "Extracting the Root Filesystem" + section. + + + + + To build the toolchain installer for a standard SDK and populate + the SDK image, use the following command: + + $ bitbake image -c populate_sdk + + You can do the same for the extensible SDK using this command: + + $ bitbake image -c populate_sdk_ext + + These commands result in a toolchain installer that contains the sysroot + that matches your target root filesystem. + + + + Another powerful feature is that the toolchain is completely + self-contained. + The binaries are linked against their own copy of + libc, which results in no dependencies + on the target system. + To achieve this, the pointer to the dynamic loader is + configured at install time since that path cannot be dynamically + altered. + This is the reason for a wrapper around the + populate_sdk and + populate_sdk_ext archives. - - The idea here is to gather all the current information in the regular - YP doc set that describes how to locate, download, or build out the SDK. + + Another feature is that only one set of cross-canadian toolchain + binaries are produced per architecture. + This feature takes advantage of the fact that the target hardware can + be passed to gcc as a set of compiler options. + Those options are set up by the environment script and contained in + variables such as + CC + and + LD. + This reduces the space needed for the tools. + Understand, however, that a sysroot is still needed for every target + since those binaries are target-specific. + + + + Remember, before using any BitBake command, you + must source the build environment setup script + (i.e. + &OE_INIT_FILE; + or + oe-init-build-env-memres) + located in the Source Directory and you must make sure your + conf/local.conf variables are correct. + In particular, you need to be sure the + MACHINE + variable matches the architecture for which you are building and that + the + SDKMACHINE + variable is correctly set if you are building a toolchain designed to + run on an architecture that differs from your current development host + machine (i.e. the build machine). - - One thing that needs discussed is any differences between getting the - standard SDK as compared to the extended SDK. - Do we have pre-build extensible SDKs laying around? - Where do we get any pre-built SDKs from? - Show the methods by which the user builds out the SDK? + + When the bitbake command completes, the toolchain + installer will be in + tmp/deploy/sdk in the Build Directory. + + By default, this toolchain does not build static binaries. + If you want to use the toolchain to build these types of libraries, + you need to be sure your image has the appropriate static + development libraries. + Use the + IMAGE_INSTALL + variable inside your local.conf file to + install the appropriate library packages. + Following is an example using glibc static + development libraries: + + IMAGE_INSTALL_append = " glibc-staticdev" + + + +
+ +
+ Extracting the Root Filesystem + + + After installing the toolchain or building it using BitBake, + you need a root filesystem, which you need to separately extract. + + + + Here are some cases where you need to extract the root filesystem: + + You want to boot the image using NFS. + + You want to use the root filesystem as the + target sysroot. + For example, the Eclipse IDE environment with the Eclipse + Yocto Plug-in installed allows you to use QEMU to boot + under NFS. + You want to develop your target application + using the root filesystem as the target sysroot. + + + + + + To extract the root filesystem, first source + the cross-development environment setup script to establish + necessary environment variables. + If you built the toolchain in the Build Directory, you will find + the toolchain environment script in the + tmp directory. + If you installed the toolchain by hand, the environment setup + script is located in /opt/poky/&DISTRO;. + + + + After sourcing the environment script, use the + runqemu-extract-sdk command and provide the + filesystem image. + + + + Following is an example. + The second command sets up the environment. + In this case, the setup script is located in the + /opt/poky/&DISTRO; directory. + The third command extracts the root filesystem from a previously + built filesystem that is located in the + ~/Downloads directory. + Furthermore, this command extracts the root filesystem into the + qemux86-sato directory: + + $ cd ~ + $ source /opt/poky/&DISTRO;/environment-setup-i586-poky-linux + $ runqemu-extract-sdk \ + ~/Downloads/core-image-sato-sdk-qemux86-2011091411831.rootfs.tar.bz2 \ + $HOME/qemux86-sato + + You could now point to the target sysroot at + qemux86-sato.
@@ -70,6 +254,48 @@
+
+ Installed Extensible SDK Directory Structure + + + The following figure shows the resulting directory structure after + you install the Extensible SDK by running the .sh + SDK installation script: + + + + + + + + The installed directory structure for the extensible SDK is quite + different than the installed structure for the standard SDK. + The extensible SDK does not separate host and target parts in the + same manner as does the standard SDK. + The extensible SDK uses an embedded copy of the build system, which + has its own sysroots. + + + + Of note in the directory structure are an environment setup script + for the SDK, a configuration file for the target, a version file for + the target, and a log file for the build system preparation script run + by the installer. + + + + Within the figure, italicized text is used to indicate replaceable + portions of the file or directory name. + For example, + install_dir is the directory where the SDK + is installed, which is poky_sdk by default. + target represents the target + architecture (e.g. i586) and + host represents the development system's + architecture (e.g. x86_64). + +
+