-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter out
-static
option on MacOS X
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
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
diff -Naur src/gprbuild-link.adb src/gprbuild-link.adb | ||
--- src/gprbuild-link.adb 2023-10-09 21:31:11.000000000 +0300 | ||
+++ src/gprbuild-link.adb 2024-03-12 23:46:51.766005336 +0200 | ||
@@ -1880,6 +1880,7 @@ | ||
when Resulting_Options => | ||
if not Apply_Bindfile_Option_Substitution | ||
(Line (1 .. Last)) | ||
+ and then Line (1 .. Last) /= "-static" | ||
then | ||
Binding_Options.Append (Line (1 .. Last)); | ||
end if; |