diff options
| author | Antonin Godard <antonin.godard@bootlin.com> | 2025-10-06 15:03:05 +0200 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-11-03 07:17:02 -0800 |
| commit | 059f795ebea9d919db50b3fd675d055f92d45c16 (patch) | |
| tree | 890028d6267292ae49477f0d33683baf764d28d6 /documentation/ref-manual | |
| parent | 9019056557fe7639578db61d5792a4dfea12ece1 (diff) | |
| download | poky-059f795ebea9d919db50b3fd675d055f92d45c16.tar.gz | |
ref-manual/classes.rst: extend the uninative class documentation
Extend the documentation of the uninative class based on [1].
[1]: https://lore.kernel.org/r/061e6150ce177221f7b6ee8754b03a20347a92c3.camel@linuxfoundation.org
Co-developed-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(From yocto-docs rev: 0193bfa7966f301e46253e25eaa0482aeb21d9d4)
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
(cherry picked from commit 68996f0f3bf882714e8d96a0aa7b2492fe16d0c3)
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'documentation/ref-manual')
| -rw-r--r-- | documentation/ref-manual/classes.rst | 61 |
1 files changed, 45 insertions, 16 deletions
diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst index 2d560bd7ee..e238575a15 100644 --- a/documentation/ref-manual/classes.rst +++ b/documentation/ref-manual/classes.rst | |||
| @@ -3363,22 +3363,51 @@ imitates. | |||
| 3363 | ``uninative`` | 3363 | ``uninative`` |
| 3364 | ============= | 3364 | ============= |
| 3365 | 3365 | ||
| 3366 | Attempts to isolate the build system from the host distribution's C | 3366 | The :ref:`ref-classes-uninative` class allows binaries to run on systems with |
| 3367 | library in order to make re-use of native shared state artifacts across | 3367 | older or newer :wikipedia:`Glibc <Glibc>` versions. This means |
| 3368 | different host distributions practical. With this class enabled, a | 3368 | :ref:`ref-classes-native` recipe :ref:`overview-manual/concepts:shared state |
| 3369 | tarball containing a pre-built C library is downloaded at the start of | 3369 | cache` can be shared among different host distributions of different versions, |
| 3370 | the build. In the Poky reference distribution this is enabled by default | 3370 | i.e. the :ref:`overview-manual/concepts:shared state cache` is "universal". |
| 3371 | through ``meta/conf/distro/include/yocto-uninative.inc``. Other | 3371 | |
| 3372 | distributions that do not derive from poky can also | 3372 | To allow this to work, the dynamic loader is changed to our own :manpage:`ld.so |
| 3373 | "``require conf/distro/include/yocto-uninative.inc``" to use this. | 3373 | <ld.so.8>` when binaries are compiled using the |
| 3374 | Alternatively if you prefer, you can build the uninative-tarball recipe | 3374 | ``--dynamic-linker`` option. This means when the binary is executed, it finds |
| 3375 | yourself, publish the resulting tarball (e.g. via HTTP) and set | 3375 | our own :manpage:`ld.so <ld.so.8>` and that loader has a modified search path |
| 3376 | ``UNINATIVE_URL`` and ``UNINATIVE_CHECKSUM`` appropriately. For an | 3376 | which finds a newer Glibc version. |
| 3377 | example, see the ``meta/conf/distro/include/yocto-uninative.inc``. | 3377 | |
| 3378 | 3378 | The linking of the binaries is not changed at link time since the | |
| 3379 | The :ref:`ref-classes-uninative` class is also used unconditionally by the extensible | 3379 | headers on the system wouldn't match the newer Glibc and this causes |
| 3380 | SDK. When building the extensible SDK, ``uninative-tarball`` is built | 3380 | obtuse failures. Changing the loader is effectively the same as if the |
| 3381 | and the resulting tarball is included within the SDK. | 3381 | system had a Glibc upgrade after the binary was compiled, so it is a |
| 3382 | mechanism supported by upstream. | ||
| 3383 | |||
| 3384 | One caveat to this approach is that the uninative Glibc binary must be | ||
| 3385 | equal to or newer in version to the versions on all the systems using | ||
| 3386 | the common :ref:`overview-manual/concepts:shared state cache`. This is why | ||
| 3387 | :ref:`ref-classes-uninative` is regularly changed on the development and stable | ||
| 3388 | branches. | ||
| 3389 | |||
| 3390 | Another potential issue is static linking: static libraries created on | ||
| 3391 | a system with a new Glibc version may have symbols not present in older | ||
| 3392 | versions, which would then fail during linking on older systems. This | ||
| 3393 | is one reason we don't use static linking for our :ref:`ref-classes-native` | ||
| 3394 | binaries. | ||
| 3395 | |||
| 3396 | With this class enabled, a tarball containing a pre-built C library is | ||
| 3397 | downloaded at the start of the build. In the Poky reference distribution this is | ||
| 3398 | enabled by default through :oe_git:`meta/conf/distro/include/yocto-uninative.inc | ||
| 3399 | </openembedded-core/tree/meta/conf/distro/include/yocto-uninative.inc>`. Other distributions that do | ||
| 3400 | not derive from Poky can also "``require conf/distro/include/yocto-uninative.inc``" | ||
| 3401 | to use this. Alternatively if you prefer, you can build the uninative-tarball | ||
| 3402 | recipe yourself, publish the resulting tarball (e.g. via HTTP) and set | ||
| 3403 | :term:`UNINATIVE_URL` and :term:`UNINATIVE_CHECKSUM` appropriately. For an | ||
| 3404 | example, see :oe_git:`meta/conf/distro/include/yocto-uninative.inc | ||
| 3405 | </openembedded-core/tree/meta/conf/distro/include/yocto-uninative.inc>`. | ||
| 3406 | |||
| 3407 | The :ref:`ref-classes-uninative` class is also used unconditionally by the | ||
| 3408 | :doc:`extensible SDK </sdk-manual/extensible>`. When building the extensible | ||
| 3409 | SDK, ``uninative-tarball`` is built and the resulting tarball is included within | ||
| 3410 | the SDK. | ||
| 3382 | 3411 | ||
| 3383 | .. _ref-classes-update-alternatives: | 3412 | .. _ref-classes-update-alternatives: |
| 3384 | 3413 | ||
