Hi;

I'm asking here because I know for certain that many people here are
able to assist :-)

I have a MacOS Tahoe arm64 linking problem.  It might look like an
Ada compiler problem, but I'm quite certain that the compile was
successful but the linking failed.

This is a slightly out-of-date GNAT compiler suite for MacOS arm64,
but I don't think that is the problem.

This problem appeared after I upgraded MacOS to Tahoe.

I posted on the Ada Forum regarding this issue.

I was given a simple workaround which was not simple enough for me to
understand :-)

The first solution provided:
##############################################################################
Remove current xCode CLI tools and install the most current version.
##############################################################################

My response: I'd already done that, same problem.

The second solution provided:
##############################################################################
Adding

package Linker is
for Leading_Switches ("Ada") use ("-Wl,-syslibroot," & external ("SDKROOT",
""));
end Linker;

to the .gpr file and then setting the appropriate SDKROOT via

export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"

seemed to do the trick.
##############################################################################

My response to that is:
Nice, good info for the future, but currently I'm using gnatmake, not gpr...

The problem:
##############################################################################
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.

The Ada code is from Rosetta Code:
"Shift list elements to left by 3"
<https://rosettacode.org/wiki/Shift_list_elements_to_left_by_3#Ada>
##############################################################################

  What is the correct manner to tell the linker what it needs to know?

  I've seen similar stuff when watching stuff being compiled by "sudo
  port -v -s install <package>", but I don't know enough how to apply
  it to my situation.

Thanks,
Ken Wolcott

Reply via email to