Musl requires gcc to be built with 64-bit long doubles as it does
not support the quad precision long double format, which is
implemented in software using two doubles.
This was already being patched, but it turns out libgcc is forcibly
being built with 128-bit long doubles because of several glibc
specific APIs it exposes. This wasn't causing any practical
runtime issue, but it was causing problems when using e.g.
the ld.gold linker to link, because it explicitly checks the
ABI tag and libgcc was tagged as 128-bit long double.
This extra patch solves the problem by conditionally compiling
libgcc with 64-bit long doubles (only on musl) and disabling
the APIs that would have been affected (as they are for glibc
only).
[ci skip]
The build is broken otherwise (meson pulls in python3, which
is registered first in alternatives, but the gobject bindings
were installed for python2 and they couldn't be found afterwards).
Python 2 is getting phased out anyway, so switch.
This commit fixes several things.
1) It enables usage of vendor crates, making our patches actually
do something (those for the vendor/ subdirectory anyway)
2) By extension, it enables dynamic linking of musl, which was not
being done at all.
3) Removes the ugly LDFLAGS hack, which was causing miscompilation
in cross environments, as it didn't pass the cross sysroot to
search for libs in when linking. This resulted in a particularly
bad miscompilation when cross-compiling from glibc to musl on
the same architecture, as it would link against glibc's libc.a
instead of musl's libc.a (not libc.so because the musl dynamic
link patch was not being used), resulting in failures when
actually compiling various projects. This hack is now replaced
with properly patching the lzma-sys crate instead, which was
the culprit previously when it comes to failures.
[ci skip]
Without this patch, the Helm client will think it is
&version.Version{SemVer:"v2.13", GitCommit:"", GitTreeState:""}
and install the Tiller image gcr.io/kubernetes-helm/tiller:v2.13 which
does not exist.
Adapted from https://github.com/NixOS/nixpkgs/pull/50918/