Improve uninative class/variables
cover Improve uninative class/variables
After https://lore.kernel.org/r/061e6150ce177221f7b6ee8754b03a20347a92c3.camel@linuxfoundation.org.
---
Antonin Godard (2):
ref-manual/variables.rst: document UNINATIVE_URL/CHECKSUM ref-manual/classes.rst: extend the uninative class documentation
documentation/ref-manual/classes.rst | 61 +++++++++++++++++++++++++--------- documentation/ref-manual/variables.rst | 16 +++++++++ 2 files changed, 61 insertions(+), 16 deletions(-)
---
base-commit: 09c7800333b17b21e50d2a089a3ae1b123697243
change-id: 20251006-uninative-class-extend-0beeb73c91b1
Best regards,
Signature · 1 line
Antonin Godard <[email protected]>
PATCH 1/2 ref-manual/variables.rst: document UNINATIVE_URL/CHECKSUM
Document the UNINATIVE_URL and UNINATIVE_CHECKSUM variables.
--- documentation/ref-manual/variables.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
documentation/ref-manual/variables.rst +16 -0
@@ -10909,6 +10909,22 @@ system and gives an overview of their function and contents. `Unified Kernel Image (UKI) <https://uapi-group.org/specifications/specs/unified_kernel_image/>`__. Defaults to ``ukify build``. + :term:`UNINATIVE_CHECKSUM` + When inheriting the :ref:`ref-classes-uninative` class, the + :term:`UNINATIVE_CHECKSUM` variable flags contain the checksums of the + uninative tarball as specified by the :term:`UNINATIVE_URL` variable. + There should be one checksum per tarballs published at + :term:`UNINATIVE_URL`, which match architectures. For example:: + + UNINATIVE_CHECKSUM[aarch64] ?= "812045d826b7fda88944055e8526b95a5a9440bfef608d5b53fd52faab49bf85" + UNINATIVE_CHECKSUM[i686] ?= "5cc28efd0c15a75de4bcb147c6cce65f1c1c9d442173a220f08427f40a3ffa09" + UNINATIVE_CHECKSUM[x86_64] ?= "4c03d1ed2b7b4e823aca4a1a23d8f2e322f1770fc10e859adcede5777aff4f3a" + + :term:`UNINATIVE_URL` + When inheriting the :ref:`ref-classes-uninative` class, the + :term:`UNINATIVE_URL` variable contains the URL where the uninative + tarballs are published. + :term:`UNKNOWN_CONFIGURE_OPT_IGNORE` Specifies a list of options that, if reported by the configure script as being invalid, should not generate a warning during the
Signature · 1 line
2.51.0
PATCH 2/2 ref-manual/classes.rst: extend the uninative class documentation
In reply to Antonin GodardExtend the documentation of the uninative class based on [1].
[1]: https://lore.kernel.org/r/061e6150ce177221f7b6ee8754b03a20347a92c3.camel@linuxfoundation.org
--- documentation/ref-manual/classes.rst | 61 ++++++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 16 deletions(-)
documentation/ref-manual/classes.rst +45 -16
@@ -3293,22 +3293,51 @@ buildtime via :term:`UKI_FILENAME`. ``uninative`` ============= -Attempts to isolate the build system from the host distribution's C -library in order to make re-use of native shared state artifacts across -different host distributions practical. With this class enabled, a -tarball containing a pre-built C library is downloaded at the start of -the build. In the Poky reference distribution this is enabled by default -through ``meta/conf/distro/include/yocto-uninative.inc``. Other -distributions that do not derive from poky can also -"``require conf/distro/include/yocto-uninative.inc``" to use this. -Alternatively if you prefer, you can build the uninative-tarball recipe -yourself, publish the resulting tarball (e.g. via HTTP) and set -``UNINATIVE_URL`` and ``UNINATIVE_CHECKSUM`` appropriately. For an -example, see the ``meta/conf/distro/include/yocto-uninative.inc``. - -The :ref:`ref-classes-uninative` class is also used unconditionally by the extensible -SDK. When building the extensible SDK, ``uninative-tarball`` is built -and the resulting tarball is included within the SDK. +The :ref:`ref-classes-uninative` class allows binaries to run on systems with +older or newer :wikipedia:`Glibc <Glibc>` versions. This means +:ref:`ref-classes-native` recipe :ref:`overview-manual/concepts:shared state +cache` can be shared among different host distributions of different versions, +i.e. the :ref:`overview-manual/concepts:shared state cache` is "universal". + +To allow this to work, the dynamic loader is changed to our own :manpage:`ld.so +<ld.so.8>` when binaries are compiled using the +``--dynamic-linker`` option. This means when the binary is executed, it finds +our own :manpage:`ld.so <ld.so.8>` and that loader has a modified search path +which finds a newer Glibc version. + +The linking of the binaries is not changed at link time since the +headers on the system wouldn't match the newer Glibc and this causes +obtuse failures. Changing the loader is effectively the same as if the +system had a Glibc upgrade after the binary was compiled, so it is a +mechanism supported by upstream. + +One caveat to this approach is that the uninative Glibc binary must be +equal to or newer in version to the versions on all the systems using +the common :ref:`overview-manual/concepts:shared state cache`. This is why +:ref:`ref-classes-uninative` is regularly changed on the development and stable +branches. + +Another potential issue is static linking: static libraries created on +a system with a new Glibc version may have symbols not present in older +versions, which would then fail during linking on older systems. This +is one reason we don't use static linking for our :ref:`ref-classes-native` +binaries. + +With this class enabled, a tarball containing a pre-built C library is +downloaded at the start of the build. In the Poky reference distribution this is +enabled by default through :oe_git:`meta/conf/distro/include/yocto-uninative.inc +</openembedded-core/tree/meta/conf/distro/include/yocto-uninative.inc>`. Other distributions that do +not derive from Poky can also "``require conf/distro/include/yocto-uninative.inc``" +to use this. Alternatively if you prefer, you can build the uninative-tarball +recipe yourself, publish the resulting tarball (e.g. via HTTP) and set +:term:`UNINATIVE_URL` and :term:`UNINATIVE_CHECKSUM` appropriately. For an +example, see :oe_git:`meta/conf/distro/include/yocto-uninative.inc +</openembedded-core/tree/meta/conf/distro/include/yocto-uninative.inc>`. + +The :ref:`ref-classes-uninative` class is also used unconditionally by the +:doc:`extensible SDK </sdk-manual/extensible>`. When building the extensible +SDK, ``uninative-tarball`` is built and the resulting tarball is included within +the SDK. .. _ref-classes-update-alternatives:
Signature · 1 line
2.51.0
Antonin Godard
AppliedQuoted 3 lines · Antonin Godard
After https://lore.kernel.org/r/061e6150ce177221f7b6ee8754b03a20347a92c3.camel@linuxfoundation.org.
Applied, thanks!
[1/2] ref-manual/variables.rst: document UNINATIVE_URL/CHECKSUM
commit: 974fe4e1c5db65b462a382e089e016326e7b3f26
[2/2] ref-manual/classes.rst: extend the uninative class documentation
commit: 68996f0f3bf882714e8d96a0aa7b2492fe16d0c3Best regards,
Signature · 1 line
Antonin Godard <[email protected]>