I think that there is a problem with the current GNAT tool chain for MacOS arm64:
gnatmake -v ./shift_left.adb
GNATMAKE 15.0.1 20250418 (prerelease)
Copyright (C) 1992-2025, Free Software Foundation, Inc.
“shift_left.ali” being checked …
→ “shift_left.ali” missing.
gcc -c -I./ -I- ./shift_left.adb
clang: warning: overriding deployment version from ‘16.0’ to ‘26.0’ [-Woverriding-deployment-version]
End of compilation
gnatbind -x shift_left.ali
gnatlink shift_left.ali
clang: warning: overriding deployment version from ‘16.0’ to ‘26.0’ [-Woverriding-deployment-version]
ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
gnatlink: error when calling /opt/gnat-aarch64-darwin-15.1.0-2/bin/gcc
gnatmake: *** link failed.
Same here. I haven’t even upgraded Mac OS to 26 - I’ve just updated to 15.7 (from 15.6.1) and this has caused the Alr (2.1.0) build to fail with similar message. To keep it brief, this appears to be the key content:
ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
Thanks for any help
Darce
And, I should have mentioned - I’m on an Intel Mac
Please provide more details on how to translate this to a form that I can use with gnatmake. I’ve not had much sucess with my attempts. Later, I’ll be gratefully using this in the form originally presented, but not yet.
SDKROOT="$(xcrun --sdk macosx --show-sdk-path)" gnatmake -v ./shift_left.adb -largs -Wl,-syslibroot,${SDKROOT}
GNATMAKE 15.0.1 20250418 (prerelease)
Copyright (C) 1992-2025, Free Software Foundation, Inc.
"shift_left.ali" being checked ...
-> "shift_left.ali" missing.
gcc -c -I./ -I- ./shift_left.adb
clang: warning: overriding deployment version from '16.0' to '26.0' [-Woverriding-deployment-version]
End of compilation
gnatbind -x shift_left.ali
gnatlink shift_left.ali -Wl,-syslibroot,
clang: warning: overriding deployment version from '16.0' to '26.0' [-Woverriding-deployment-version]
ld: -syslibroot missing argument
collect2: error: ld returned 1 exit status
gnatlink: error when calling /opt/gnat-aarch64-darwin-15.1.0-2/bin/gcc
gnatmake: *** link failed.
The SDKROOT="$(xcrun --sdk macosx --show-sdk-path)" line is returning an empty variable. Do you have Xcode or the Apple developer tools installed (I am no Apple user, so I do not know the correct terminology or setups to get a toolchain running). The command xcrun has to return the requested value, not an empty string.
Also, this line GNATMAKE 15.0.1 20250418 (prerelease) indicates that you are running a beta version of the compiler. Please, update your Ada toolchain to the latest GCC, which is currently v15.2. That may also help.
I have not tried the most recent version that has an arm64 MacOS entry.
However, I received the same complaint from MacOS when trying to link a compiled C program on MacOS Tahoe. So, I used Gemini AI (if I had not received useful answers, I would have used ChatGPT) and the clue was a clang option that forces version 26: “-mmacosx-version-min=26.0“. This solved the exact same complaint I was getting when trying to link the Ada object code. So now I just have to figure out how to get gnatmake to force this option through. I hope that I don’t have to do gpr things (yet) to get this to work.
I tried using “gnat compile” and “gnat link” separately and with verbose and I am still having the same problem. I do not think that updating my gnat tool chain will solve the problem since this is something that came up with the Tahoe release of MacOS, which definitely happened after the most recent release of the gnat tool chain.
The hint from Gemini AI had zero effect on the linking problem from the Ada object code while it solved the linking problem from the C object code.