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

Add scripts for MacOS X for ARM compiler #61

Merged
merged 6 commits into from
Mar 14, 2024

Conversation

reznikmm
Copy link
Contributor

This PR builds gnat-aarch64-darwin-13.2.0-x.tar.gz for MacOS X ARM.

I've dropped gprbuild part, because I can't build it. Version 24.0 fails (even on x86_64) because the script calls gcc -static while linking gprbuild executable and MacOS X doesn't support static linking. To be investigated.

Cross should work for arm and riscv when gprbuild is ready. But avrlib fails fails with machine aarch64-apple' not recognized. However cross archives have name collision: both x86_64 and arm64 have name gnat-riscv64-elf-darwin-13.2.0-1.tar.gz`

SPARK depends on gnatcoll/gprbuild also.

XRef: alire-project/alire#1492

This is to fix gprbuild 24 on Mac OS. The error is

> ld: library not found for -lcrt0.o

The gprbuild call `gcc -static ...` during linking a main, but
MacOS X was never able to do [static linking][1].

The gprbuild reads `-static` option from `*.bexch` file.
The `*.bexch` file is created by `gprbind` by reading
`b__<main>.adb` generated by `gnatbind`.
The `gnatbind` writes `-static` to `b__<main>.adb` for ages,
but gprbuild 22 filtered this option.
The filtering was removed in [the commit][2].

[1]: https://stackoverflow.com/questions/3801011/ld-library-not-found-for-lcrt0-o-on-osx-10-6-with-gcc-clang-static-flag
[2]: AdaCore/gprbuild@48ea3c1
@reznikmm reznikmm force-pushed the topic/macos_14 branch 2 times, most recently from 8801c49 to ee03679 Compare March 13, 2024 10:16
@reznikmm
Copy link
Contributor Author

I've found the reason why gprbuild 24 doesn't build on MacOS and I have a patch for this.

@reznikmm reznikmm marked this pull request as draft March 13, 2024 10:44
to have support for aarch64-apple-darwin
as a workaround of missing -Lgmp/iconv in gnatcoll-binding linker options.
@reznikmm reznikmm marked this pull request as ready for review March 13, 2024 20:24
@Fabien-Chouteau Fabien-Chouteau merged commit 37708df into alire-project:main Mar 14, 2024
17 of 22 checks passed
@reznikmm reznikmm deleted the topic/macos_14 branch March 14, 2024 11:18
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.

2 participants