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.
Actually it’s probably not empty, it’s just that the order of operations is wrong. SDKROOT=… is setting the variable after ${SDKROOT} has already been expanded. Observe how a command like FOO=hello echo $FOO prints nothing.
If you plan to type gnatmake commands a lot, you could make a wrapper script that adds the syslibroot stuff for you. For example, save the following as a new text file:
chmod a+x that file and run that file instead of gnatmake. The fact that gnatmake doesn’t seem to know to use the standard macOS SDK path automatically feels like a bug to me, but this should allow you to work around it.
This is a gcc bug. It computes the default deployment target from the Darwin version. You’re on Darwin 25 and it erroneously thinks that’s macOS 16. The version of gcc you’re using was released before it was known that Apple would change the version numbering scheme and that Darwin 25 would actually be called macOS 26.
If I interpret the message correctly, clang (perhaps being invoked as the linker?) is letting you know it was asked to use the deployment target 16.0 and it has changed it to 26.0 for you. When you specify -mmacosx-version-min=26.0 you’re overriding gcc’s erroneous default and specifying 26.0 directly, which eliminates the warning but otherwise changes nothing.
Also, thanks for correcting my incorrect usage when trying to implement the advice given earlier in this thread. That’s useful general knowledge, thanks…
What is not clear to me but reading between the lines is that a new release of the GNAT tool chain will be required for me to be able to proceed with the linkage; is that a correct conclusion? If not, what is the action that I can take? I don’t have an executable created, so it’s more than a warning to me, it’s a failure. Turning off the warning(s) when the problem is not resolved is like driving in really bad weather, ignoring the travel advisories and putting on a blindfold, and hoping for the best.