Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preliminary Ada support #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Preliminary Ada support #134

wants to merge 1 commit into from

Conversation

1ma
Copy link

@1ma 1ma commented Aug 21, 2021

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

@1ma
Copy link
Author

1ma commented Aug 22, 2021

I now tried bootstrapping MCM from the first toolchain and rebuilding the projects I mentioned in #133, everything still works :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant