Notes for uninative.bbclass doc enhancement
I was asked some questions about uninative, I've tried to write something to enhance the class documentation on it:
"""
Uninative allows binaries to run on systems with older or newer glibc versions. This means native recipe sstate can be shared among different distros of different versions, i.e. the sstate cache is 'universal'.
To allow this to work, we change the dynamic loader to our own ld.so when binaries are compiled using the --dynamic-linker option. This means when the binary is executed, it finds our own ld.so and that loader has a modified search path which finds a newer glibc version.
We don't change the linking of the binaries 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 sstate cache. This is why we upgrade uninative regularly and on our stable branches too.
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 native binaries. """
I'm hoping this is useful info and simple to extend
https://docs.yoctoproject.org/ref-manual/classes.html#uninative with.
Cheers,
Richard