Skip to contentSkip to conversation

ref-manual: add description for the "sysroot" term

PATCH In review [email protected] 2 participants 4 messages Jun 13, 2022 – Jun 14, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ref-manual: add description for the "sysroot" term

From: Michael Opdenacker <[email protected]>

This term is used throughout the manual but is not properly introduced anywhere.

---
 documentation/ref-manual/terms.rst | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
documentation/ref-manual/terms.rst +25 -0
index cba514c345..76f3fb0d08 100644
@@ -383,6 +383,31 @@ universal, the list includes them just in case:
      ":ref:`overview-manual/development-environment:repositories, tags, and branches`"
      section in the Yocto Project Overview and Concepts Manual.
 
+   :term:`Sysroot`
+
+      A directory considered as the root directory for locating
+      header and library files needed to generate binaries for a target
+      processor architecture.
+
+      In the context of cross-compiling toolchains, a *sysroot*
+      typically contains C library and kernel headers, plus the
+      compiled binaries for the C library. A *multilib toolchain*
+      can contain multiple variants of the C library binaries,
+      each compiled for a target instruction set (such as ``armv5``,
+      ``armv7`` and ``armv8``), and possibly optimized for a specific CPU core.
+
+      In the more specific context of the OpenEmbedded build System and
+      of the Yocto Project, each recipe has two *sysroots*:
+
+      -  A *target sysroot* contains all the **target** libraries and headers
+         needed to build the recipe.
+
+      -  A *native sysroot* contains all the **host** files and executables
+         needed to build the recipe.
+
+      See the :term:`SYSROOT_* <SYSROOT_DESTDIR>` variables controlling
+      how sysroots are created and stored.
+
    :term:`Task`
       A per-recipe unit of execution for BitBake (e.g.
       :ref:`ref-tasks-compile`,
Signature · 1 line
2.34.1
#1 lore raw
Quoted 15 lines · Michael Opdenacker via lists.yoctoproject.org

From: Michael Opdenacker <[email protected]>

This term is used throughout the manual but is not properly introduced anywhere.

---
 documentation/ref-manual/terms.rst | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
documentation/ref-manual/terms.rst +0 -0
index cba514c345..76f3fb0d08 100644

documentation/ref-manual/terms.rst universal, the list includes them just in case: · line 387

Quoted 5 lines
documentation/ref-manual/terms.rst +2 -0
@@ -383,6 +383,31 @@ universal, the list includes them just in case:
      ":ref:`overview-manual/development-environment:repositories, tags, and branches`"
      section in the Yocto Project Overview and Concepts Manual.
 
+   :term:`Sysroot`
+

How about:

"""
When cross compiling, the target file system may be differently laid out and contain different things to the of the host system. The concept of a sysroot is directory which looks like the target filesystem and can be used to cross compile against.
"""

then go on and explain target vs. native.

Cheers,

Richard

#2 lore raw

PATCH 1/1 ref-manual: add description for the "sysroot" term

From: Michael Opdenacker <[email protected]>

This term is used throughout the manual but is not properly introduced anywhere.

---

Changes in V2:
* Replace the introductory paragraph by the one proposed by Richard Purdie

---
 documentation/ref-manual/terms.rst | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
documentation/ref-manual/terms.rst +25 -0
index cba514c345..512032a67e 100644
@@ -383,6 +383,31 @@ universal, the list includes them just in case:
      ":ref:`overview-manual/development-environment:repositories, tags, and branches`"
      section in the Yocto Project Overview and Concepts Manual.
 
+   :term:`Sysroot`
+      When cross-compiling, the target file system may be differently laid
+      out and contain different things compared to the host system. The concept
+      of a *sysroot* is directory which looks like the target filesystem and
+      can be used to cross-compile against.
+
+      In the context of cross-compiling toolchains, a *sysroot*
+      typically contains C library and kernel headers, plus the
+      compiled binaries for the C library. A *multilib toolchain*
+      can contain multiple variants of the C library binaries,
+      each compiled for a target instruction set (such as ``armv5``,
+      ``armv7`` and ``armv8``), and possibly optimized for a specific CPU core.
+
+      In the more specific context of the OpenEmbedded build System and
+      of the Yocto Project, each recipe has two sysroots:
+
+      -  A *target sysroot* contains all the **target** libraries and headers
+         needed to build the recipe.
+
+      -  A *native sysroot* contains all the **host** files and executables
+         needed to build the recipe.
+
+      See the :term:`SYSROOT_* <SYSROOT_DESTDIR>` variables controlling
+      how sysroots are created and stored.
+
    :term:`Task`
       A per-recipe unit of execution for BitBake (e.g.
       :ref:`ref-tasks-compile`,
Signature · 1 line
2.34.1
#3 lore raw
In reply to Richard Purdie

Hi Richard,

Quoted 24 lines · Richard Purdie
Quoted 15 lines · Michael Opdenacker via lists.yoctoproject.org

From: Michael Opdenacker <[email protected]>

This term is used throughout the manual but is not properly introduced anywhere.

---
  documentation/ref-manual/terms.rst | 25 +++++++++++++++++++++++++
  1 file changed, 25 insertions(+)
documentation/ref-manual/terms.rst +0 -0
index cba514c345..76f3fb0d08 100644

documentation/ref-manual/terms.rst universal, the list includes them just in case: · line 387

Quoted 5 lines
documentation/ref-manual/terms.rst +2 -0
@@ -383,6 +383,31 @@ universal, the list includes them just in case:
       ":ref:`overview-manual/development-environment:repositories, tags, and branches`"
       section in the Yocto Project Overview and Concepts Manual.
 
+   :term:`Sysroot`
+

How about:

Quoted 8 lines

"""
When cross compiling, the target file system may be differently laid out and contain different things to the of the host system. The concept of a sysroot is directory which looks like the target filesystem and can be used to cross compile against.
"""

then go on and explain target vs. native.

Thanks for the better description! I sent a new version with it, though I forgot to call it "v2". Were you suggesting to drop the description of what a sysroot is in the context of a cross-compiling toolchain?

Thanks again for the review
Michael.

Signature · 3 lines
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com