omitting all compatibility interfaces from the build
Florian Weimer
fweimer@redhat.com
Fri Feb 7 11:02:00 GMT 2020
* Rasmus Villemoes:
> When doing a complete BSP build for an embedded target, there are and
> will not be any old existing binaries that have been linked against an
> older libc. Hence there is no need for any version of any symbol other
> than the currently exposed ones. So would it be possible to add a
> configure knob for omitting all the code for the unused/unneeded interfaces?
>
> I looked into shlib-compat.h, and it seems doing
>
> -#ifdef SHARED
> +#if defined(SHARED) && !defined(OMIT_COMPAT_VERSIONS)
>
> would be a simple first step, but I assume it can't be that simple - I'm
> guessing some later steps in the build process would need tweaking as well.
If you do not need ABI compatibility, you could create a new port that
has a different ABI baseline, e.g.,
DEFAULT GLIBC_2.31
in shlib-versions. This will drop more code, but binaries linked
against such a library will not run anywhere else. It has the advantage
that this should work today. There will likely be a few isolated
problems, but the patches should be upstreamable.
Thanks,
Florian
More information about the Libc-alpha
mailing list