ref-manual, overview-manual, Makefile: Moved toolchain concepts

Fixes [YOCTO #12370]

Moved the "Cross-Development Toolchain Generation" section from the
ref-manual to the overview-manual into the concepts chapter.  This
information is conceptual and now needs to live in the concepts
chapter of the new overview-manual.  Moving the section caused a
few links to have to be fixed in the ref-manual.  There was also a
figure in the section.  So, I had to move the figure from the ref-manual
to the overview-manual "figures" folder and update the Makefile for
the TARFILE generation.

(From yocto-docs rev: 1f3ee5ab308cbe6bd7194086026db397b67ca7c4)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Scott Rifenbark 2018-01-10 13:01:25 -08:00 committed by Richard Purdie
parent 707224b57a
commit 6bf7b263ff
8 changed files with 235 additions and 219 deletions

View File

@ -94,7 +94,7 @@ TARFILES = overview-style.css overview-manual.html figures/overview-title.png \
figures/source-fetching.png figures/patching.png figures/configuration-compile-autoreconf.png \
figures/analysis-for-package-splitting.png figures/image-generation.png \
figures/sdk-generation.png figures/images.png figures/sdk.png \
figures/YP-flow-diagram.png \
figures/YP-flow-diagram.png figures/cross-development-toolchains.png \
eclipse
MANUALS = $(DOC)/$(DOC).html $(DOC)/eclipse
FIGURES = figures
@ -282,7 +282,6 @@ XSLTOPTS = --xinclude
ALLPREQ = html eclipse tarball
TARFILES = ref-manual.html ref-style.css figures/poky-title.png \
figures/buildhistory.png figures/buildhistory-web.png \
figures/cross-development-toolchains.png \
figures/building-an-image.png \
figures/build-workspace-directory.png \
eclipse

View File

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -255,6 +255,222 @@
</section>
</section>
<section id="cross-development-toolchain-generation">
<title>Cross-Development Toolchain Generation</title>
<para>
The Yocto Project does most of the work for you when it comes to
creating
<ulink url='&YOCTO_DOCS_REF_URL;#cross-development-toolchain'>cross-development toolchains</ulink>.
This section provides some technical background on how
cross-development toolchains are created and used.
For more information on toolchains, you can also see the
<ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
manual.
</para>
<para>
In the Yocto Project development environment, cross-development
toolchains are used to build the image and applications that run
on the target hardware.
With just a few commands, the OpenEmbedded build system creates
these necessary toolchains for you.
</para>
<para>
The following figure shows a high-level build environment regarding
toolchain construction and use.
</para>
<para>
<imagedata fileref="figures/cross-development-toolchains.png" width="8in" depth="6in" align="center" />
</para>
<para>
Most of the work occurs on the Build Host.
This is the machine used to build images and generally work within the
the Yocto Project environment.
When you run BitBake to create an image, the OpenEmbedded build system
uses the host <filename>gcc</filename> compiler to bootstrap a
cross-compiler named <filename>gcc-cross</filename>.
The <filename>gcc-cross</filename> compiler is what BitBake uses to
compile source files when creating the target image.
You can think of <filename>gcc-cross</filename> simply as an
automatically generated cross-compiler that is used internally within
BitBake only.
<note>
The extensible SDK does not use
<filename>gcc-cross-canadian</filename> since this SDK
ships a copy of the OpenEmbedded build system and the sysroot
within it contains <filename>gcc-cross</filename>.
</note>
</para>
<para>
The chain of events that occurs when <filename>gcc-cross</filename> is
bootstrapped is as follows:
<literallayout class='monospaced'>
gcc -> binutils-cross -> gcc-cross-initial -> linux-libc-headers -> glibc-initial -> glibc -> gcc-cross -> gcc-runtime
</literallayout>
<itemizedlist>
<listitem><para>
<filename>gcc</filename>:
The build host's GNU Compiler Collection (GCC).
</para></listitem>
<listitem><para>
<filename>binutils-cross</filename>:
The bare minimum binary utilities needed in order to run
the <filename>gcc-cross-initial</filename> phase of the
bootstrap operation.
</para></listitem>
<listitem><para>
<filename>gcc-cross-initial</filename>:
An early stage of the bootstrap process for creating
the cross-compiler.
This stage builds enough of the <filename>gcc-cross</filename>,
the C library, and other pieces needed to finish building the
final cross-compiler in later stages.
This tool is a "native" package (i.e. it is designed to run on
the build host).
</para></listitem>
<listitem><para>
<filename>linux-libc-headers</filename>:
Headers needed for the cross-compiler.
</para></listitem>
<listitem><para>
<filename>glibc-initial</filename>:
An initial version of the Embedded GLIBC needed to bootstrap
<filename>glibc</filename>.
</para></listitem>
<listitem><para>
<filename>gcc-cross</filename>:
The final stage of the bootstrap process for the
cross-compiler.
This stage results in the actual cross-compiler that
BitBake uses when it builds an image for a targeted
device.
<note>
If you are replacing this cross compiler toolchain
with a custom version, you must replace
<filename>gcc-cross</filename>.
</note>
This tool is also a "native" package (i.e. it is
designed to run on the build host).
</para></listitem>
<listitem><para>
<filename>gcc-runtime</filename>:
Runtime libraries resulting from the toolchain bootstrapping
process.
This tool produces a binary that consists of the
runtime libraries need for the targeted device.
</para></listitem>
</itemizedlist>
</para>
<para>
You can use the OpenEmbedded build system to build an installer for
the relocatable SDK used to develop applications.
When you run the installer, it installs the toolchain, which contains
the development tools (e.g., the
<filename>gcc-cross-canadian</filename>),
<filename>binutils-cross-canadian</filename>, and other
<filename>nativesdk-*</filename> tools,
which are tools native to the SDK (i.e. native to
<ulink url='&YOCTO_DOCS_REF_URL;#var-SDK_ARCH'><filename>SDK_ARCH</filename></ulink>),
you need to cross-compile and test your software.
The figure shows the commands you use to easily build out this
toolchain.
This cross-development toolchain is built to execute on the
<ulink url='&YOCTO_DOCS_REF_URL;#var-SDKMACHINE'><filename>SDKMACHINE</filename></ulink>,
which might or might not be the same
machine as the Build Host.
<note>
If your target architecture is supported by the Yocto Project,
you can take advantage of pre-built images that ship with the
Yocto Project and already contain cross-development toolchain
installers.
</note>
</para>
<para>
Here is the bootstrap process for the relocatable toolchain:
<literallayout class='monospaced'>
gcc -> binutils-crosssdk -> gcc-crosssdk-initial -> linux-libc-headers ->
glibc-initial -> nativesdk-glibc -> gcc-crosssdk -> gcc-cross-canadian
</literallayout>
<itemizedlist>
<listitem><para>
<filename>gcc</filename>:
The build host's GNU Compiler Collection (GCC).
</para></listitem>
<listitem><para>
<filename>binutils-crosssdk</filename>:
The bare minimum binary utilities needed in order to run
the <filename>gcc-crosssdk-initial</filename> phase of the
bootstrap operation.
</para></listitem>
<listitem><para>
<filename>gcc-crosssdk-initial</filename>:
An early stage of the bootstrap process for creating
the cross-compiler.
This stage builds enough of the
<filename>gcc-crosssdk</filename> and supporting pieces so that
the final stage of the bootstrap process can produce the
finished cross-compiler.
This tool is a "native" binary that runs on the build host.
</para></listitem>
<listitem><para>
<filename>linux-libc-headers</filename>:
Headers needed for the cross-compiler.
</para></listitem>
<listitem><para>
<filename>glibc-initial</filename>:
An initial version of the Embedded GLIBC needed to bootstrap
<filename>nativesdk-glibc</filename>.
</para></listitem>
<listitem><para>
<filename>nativesdk-glibc</filename>:
The Embedded GLIBC needed to bootstrap the
<filename>gcc-crosssdk</filename>.
</para></listitem>
<listitem><para>
<filename>gcc-crosssdk</filename>:
The final stage of the bootstrap process for the
relocatable cross-compiler.
The <filename>gcc-crosssdk</filename> is a transitory compiler
and never leaves the build host.
Its purpose is to help in the bootstrap process to create the
eventual relocatable <filename>gcc-cross-canadian</filename>
compiler, which is relocatable.
This tool is also a "native" package (i.e. it is
designed to run on the build host).
</para></listitem>
<listitem><para>
<filename>gcc-cross-canadian</filename>:
The final relocatable cross-compiler.
When run on the
<ulink url='&YOCTO_DOCS_REF_URL;#var-SDKMACHINE'><filename>SDKMACHINE</filename></ulink>,
this tool
produces executable code that runs on the target device.
Only one cross-canadian compiler is produced per architecture
since they can be targeted at different processor optimizations
using configurations passed to the compiler through the
compile commands.
This circumvents the need for multiple compilers and thus
reduces the size of the toolchains.
</para></listitem>
</itemizedlist>
</para>
<note>
For information on advantages gained when building a
cross-development toolchain installer, see the
"<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-building-an-sdk-installer'>Building an SDK Installer</ulink>"
section in the Yocto Project Application Development and the
Extensible Software Development Kit (eSDK) manual.
</note>
</section>
<section id='x32'>
<title>x32 psABI</title>

View File

@ -2426,8 +2426,8 @@
<note>
For more information on the cross-development toolchain
generation, see the
"<ulink url='&YOCTO_DOCS_REF_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>"
section in the Yocto Project Reference Manual.
"<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
section.
For information on advantages gained when building a
cross-development toolchain using the
<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-populate_sdk'><filename>do_populate_sdk</filename></ulink>
@ -2792,8 +2792,8 @@
<listitem><para>
For background information on cross-development toolchains
in the Yocto Project development environment, see the
"<ulink url='&YOCTO_DOCS_REF_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>"
section in the Yocto Project Reference Manual.
"<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
section.
</para></listitem>
<listitem><para>
For information on setting up a cross-development

View File

@ -568,8 +568,9 @@
provides support for the recipes that build the Canadian
Cross-compilation tools for SDKs.
See the
"<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
section for more discussion on these cross-compilation tools.
"<ulink url='&YOCTO_DOCS_OVERVIEW_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>"
section in the Yocto Project Overview Manual for more discussion on
these cross-compilation tools.
</para>
</section>
@ -581,8 +582,9 @@
provides support for the recipes that build the cross-compilation
tools used for building SDKs.
See the
"<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
section for more discussion on these cross-compilation tools.
"<ulink url='&YOCTO_DOCS_OVERVIEW_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>"
section in the Yocto Project Overview Manual for more discussion on
these cross-compilation tools.
</para>
</section>
@ -2720,8 +2722,8 @@ This check was removed for YP 2.3 release
<para>
For more information on the cross-development toolchain
generation, see the
"<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
section.
"<ulink url='&YOCTO_DOCS_OVERVIEW_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>"
section in the Yocto Project Overview Manual.
For information on advantages gained when building a
cross-development toolchain using the
<link linkend='ref-tasks-populate_sdk'><filename>do_populate_sdk</filename></link>

View File

@ -181,8 +181,8 @@
<para>Creation of these toolchains is simple and automated.
For information on toolchain concepts as they apply to the
Yocto Project, see the
"<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
section.
"<ulink url='&YOCTO_DOCS_OVERVIEW_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>"
section in the Yocto Project Overview Manual.
You can also find more information on using the
relocatable toolchain in the
<ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>

View File

@ -15183,8 +15183,8 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
<para>
For background information on cross-development toolchains
in the Yocto Project development environment, see the
"<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
section.
"<ulink url='&YOCTO_DOCS_OVERVIEW_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>"
section in the Yocto Project Overview Manual.
For information on setting up a cross-development
environment, see the
<ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
@ -15242,8 +15242,8 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
<para>
For background information on cross-development toolchains
in the Yocto Project development environment, see the
"<link linkend='cross-development-toolchain-generation'>Cross-Development Toolchain Generation</link>"
section.
"<ulink url='&YOCTO_DOCS_OVERVIEW_URL;#cross-development-toolchain-generation'>Cross-Development Toolchain Generation</ulink>"
section in the Yocto Project Overview Manual.
For information on setting up a cross-development
environment, see the
<ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>

View File

@ -13,207 +13,6 @@
x32, Wayland support, and Licenses.
</para>
<section id="cross-development-toolchain-generation">
<title>Cross-Development Toolchain Generation</title>
<para>
The Yocto Project does most of the work for you when it comes to
creating
<link linkend='cross-development-toolchain'>cross-development toolchains</link>.
This section provides some technical background on how
cross-development toolchains are created and used.
For more information on toolchains, you can also see the
<ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Application Development and the Extensible Software Development Kit (eSDK)</ulink>
manual.
</para>
<para>
In the Yocto Project development environment, cross-development
toolchains are used to build the image and applications that run on the
target hardware.
With just a few commands, the OpenEmbedded build system creates
these necessary toolchains for you.
</para>
<para>
The following figure shows a high-level build environment regarding
toolchain construction and use.
</para>
<para>
<imagedata fileref="figures/cross-development-toolchains.png" width="8in" depth="6in" align="center" />
</para>
<para>
Most of the work occurs on the Build Host.
This is the machine used to build images and generally work within the
the Yocto Project environment.
When you run BitBake to create an image, the OpenEmbedded build system
uses the host <filename>gcc</filename> compiler to bootstrap a
cross-compiler named <filename>gcc-cross</filename>.
The <filename>gcc-cross</filename> compiler is what BitBake uses to
compile source files when creating the target image.
You can think of <filename>gcc-cross</filename> simply as an
automatically generated cross-compiler that is used internally within
BitBake only.
<note>
The extensible SDK does not use
<filename>gcc-cross-canadian</filename> since this SDK
ships a copy of the OpenEmbedded build system and the sysroot
within it contains <filename>gcc-cross</filename>.
</note>
</para>
<para>
The chain of events that occurs when <filename>gcc-cross</filename> is
bootstrapped is as follows:
<literallayout class='monospaced'>
gcc -> binutils-cross -> gcc-cross-initial -> linux-libc-headers -> glibc-initial -> glibc -> gcc-cross -> gcc-runtime
</literallayout>
<itemizedlist>
<listitem><para><filename>gcc</filename>:
The build host's GNU Compiler Collection (GCC).
</para></listitem>
<listitem><para><filename>binutils-cross</filename>:
The bare minimum binary utilities needed in order to run
the <filename>gcc-cross-initial</filename> phase of the
bootstrap operation.
</para></listitem>
<listitem><para><filename>gcc-cross-initial</filename>:
An early stage of the bootstrap process for creating
the cross-compiler.
This stage builds enough of the <filename>gcc-cross</filename>,
the C library, and other pieces needed to finish building the
final cross-compiler in later stages.
This tool is a "native" package (i.e. it is designed to run on
the build host).
</para></listitem>
<listitem><para><filename>linux-libc-headers</filename>:
Headers needed for the cross-compiler.
</para></listitem>
<listitem><para><filename>glibc-initial</filename>:
An initial version of the Embedded GLIBC needed to bootstrap
<filename>glibc</filename>.
</para></listitem>
<listitem><para><filename>gcc-cross</filename>:
The final stage of the bootstrap process for the
cross-compiler.
This stage results in the actual cross-compiler that
BitBake uses when it builds an image for a targeted
device.
<note>
If you are replacing this cross compiler toolchain
with a custom version, you must replace
<filename>gcc-cross</filename>.
</note>
This tool is also a "native" package (i.e. it is
designed to run on the build host).
</para></listitem>
<listitem><para><filename>gcc-runtime</filename>:
Runtime libraries resulting from the toolchain bootstrapping
process.
This tool produces a binary that consists of the
runtime libraries need for the targeted device.
</para></listitem>
</itemizedlist>
</para>
<para>
You can use the OpenEmbedded build system to build an installer for
the relocatable SDK used to develop applications.
When you run the installer, it installs the toolchain, which contains
the development tools (e.g., the
<filename>gcc-cross-canadian</filename>),
<filename>binutils-cross-canadian</filename>, and other
<filename>nativesdk-*</filename> tools,
which are tools native to the SDK (i.e. native to
<link linkend='var-SDK_ARCH'><filename>SDK_ARCH</filename></link>),
you need to cross-compile and test your software.
The figure shows the commands you use to easily build out this
toolchain.
This cross-development toolchain is built to execute on the
<link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>,
which might or might not be the same
machine as the Build Host.
<note>
If your target architecture is supported by the Yocto Project,
you can take advantage of pre-built images that ship with the
Yocto Project and already contain cross-development toolchain
installers.
</note>
</para>
<para>
Here is the bootstrap process for the relocatable toolchain:
<literallayout class='monospaced'>
gcc -> binutils-crosssdk -> gcc-crosssdk-initial -> linux-libc-headers ->
glibc-initial -> nativesdk-glibc -> gcc-crosssdk -> gcc-cross-canadian
</literallayout>
<itemizedlist>
<listitem><para><filename>gcc</filename>:
The build host's GNU Compiler Collection (GCC).
</para></listitem>
<listitem><para><filename>binutils-crosssdk</filename>:
The bare minimum binary utilities needed in order to run
the <filename>gcc-crosssdk-initial</filename> phase of the
bootstrap operation.
</para></listitem>
<listitem><para><filename>gcc-crosssdk-initial</filename>:
An early stage of the bootstrap process for creating
the cross-compiler.
This stage builds enough of the
<filename>gcc-crosssdk</filename> and supporting pieces so that
the final stage of the bootstrap process can produce the
finished cross-compiler.
This tool is a "native" binary that runs on the build host.
</para></listitem>
<listitem><para><filename>linux-libc-headers</filename>:
Headers needed for the cross-compiler.
</para></listitem>
<listitem><para><filename>glibc-initial</filename>:
An initial version of the Embedded GLIBC needed to bootstrap
<filename>nativesdk-glibc</filename>.
</para></listitem>
<listitem><para><filename>nativesdk-glibc</filename>:
The Embedded GLIBC needed to bootstrap the
<filename>gcc-crosssdk</filename>.
</para></listitem>
<listitem><para><filename>gcc-crosssdk</filename>:
The final stage of the bootstrap process for the
relocatable cross-compiler.
The <filename>gcc-crosssdk</filename> is a transitory compiler
and never leaves the build host.
Its purpose is to help in the bootstrap process to create the
eventual relocatable <filename>gcc-cross-canadian</filename>
compiler, which is relocatable.
This tool is also a "native" package (i.e. it is
designed to run on the build host).
</para></listitem>
<listitem><para><filename>gcc-cross-canadian</filename>:
The final relocatable cross-compiler.
When run on the
<link linkend='var-SDKMACHINE'><filename>SDKMACHINE</filename></link>,
this tool
produces executable code that runs on the target device.
Only one cross-canadian compiler is produced per architecture
since they can be targeted at different processor optimizations
using configurations passed to the compiler through the
compile commands.
This circumvents the need for multiple compilers and thus
reduces the size of the toolchains.
</para></listitem>
</itemizedlist>
</para>
<note>
For information on advantages gained when building a
cross-development toolchain installer, see the
"<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-building-an-sdk-installer'>Building an SDK Installer</ulink>"
section in the Yocto Project Application Development and the
Extensible Software Development Kit (eSDK) manual.
</note>
</section>
<section id="shared-state-cache">
<title>Shared State Cache</title>