musl-cross-make
musl-cross-make copied to clipboard
Preliminary Ada support
Before I forget, here is the rationale for each change. They've been gathered from several places but I haven't copied the patches verbatim, only what I seemed to need.
With this patch I've been able to build GNAT 9.4.0 targeting x86_64-linux-musl on Alpine Linux 3.12 with just the build-base
and gcc-gnat
packages as prerequisites.
Removed calloc
from pragma GCC poison
This is actually the only thing that prevented GCC from building, the other patches fix runtime errors. I found the cure in an old email thread from the musl mailing list
Prevent compilation of s-tsmona__linux.adb
Origin: https://gitlab.alpinelinux.org/alpine/aports/-/blob/fbd708d54ad9ec01f3927e760ef241f3a436b6fb/main/gcc/0027-ada-musl-support-fixes.patch
This fixes an undefined reference to the _r_debug
symbol that happens at runtime when executing even the simplest hello world Ada program.
Remove bindings to pthread_mutexattr_setprioceiling
and pthread_rwlockattr_setkind_np
Origin: https://gitlab.alpinelinux.org/alpine/aports/-/blob/fbd708d54ad9ec01f3927e760ef241f3a436b6fb/main/gcc/0026-ada-libgnarl-compatibility-for-musl.patch
pthread_rwlockattr_setkind_np
is not defined in musl and pthread_mutexattr_setprioceiling
hasn't exactly the same layout as glibc or something. I got undefined references to these symbols at link time while attempting to build GPRBuild. The original patch was precisely created for GPRBuild
I now tried bootstrapping MCM from the first toolchain and rebuilding the projects I mentioned in #133, everything still works :)