Closed wiremoons closed 2 years ago
This is because of issue #2 -- you’ll see the giveaway x86_64
in your comments.
I’m so sorry to have put you to this trouble.
I guess you’d prefer to wait for a proper release, but for the moment you could build with the added switches
-largs -L$(xcrun --show-sdk-path)/usr/lib
to pick up the Command Line Tools version of the system libraries.
When I do make the proper release, it’ll automatically recognise when you have the CLTs installed and not just the full Xcode.
Hi @simonjwright
Thanks for getting back to me.
This is because of issue #2 -- you’ll see the giveaway
x86_64
in your comments.
Well spotted - I missed that! I assume it is the Target: x86_64-apple-darwin15
part of the output from the gcc -v
command you have noticed?
I’m so sorry to have put you to this trouble.
It is no trouble at all - I am grateful you have put this together, so anything I can help with is the least I can do.
I guess you’d prefer to wait for a proper release, but for the moment you could build with the added switches
-largs -L$(xcrun --show-sdk-path)/usr/lib
Thanks for the fix for the linker part 👍 I have now re-run with the command:
% gnatmake -g hello_world.adb -largs -L$(xcrun --show-sdk-path)/usr/lib
gcc -c -g hello_world.adb
gnatbind -x hello_world.ali
gnatlink hello_world.ali -g -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
and that works well, and the program compiles and runs too now.
As you have pointed out is it is building x86:
% otool -L ./hello_world
./hello_world:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
% file hello_world
hello_world: Mach-O 64-bit executable x86_64
When I do make the proper release, it’ll automatically recognise when you have the CLTs installed and not just the full Xcode.
For the release you have made, it is clearly designated as 'pre-release' so this is a good time to iron out any issues that can be found, so is worth it I think to do some test installs, get feedback, etc.
If you want me to test anything else just let me know. I was considering trying to do a build using your Github scripts — but I expect I would be getting way ahead of myself knowledge and experience wise, as it all looks quite involved! I guess the hardest part is getting the first native GNAT version for arm64 (Apple Silicon), to build everything that follows!
Anyway - thanks again, just let me know if you want me to check anything else that would help to test things out.
Cheers
Simon
Hi @simonjwright
Just to let you know I have installed the new pre-release aarch64-apple-darwin21-2 and it works fine now 👍
Install is to the stated installer directory, and it alls works fine still if you change it to a new directory name (only if needed of course).
I have recompiled the same code as above, and it produces native arm64
binary files, and no linker issues either:
% gnatmake -g hello_world.adb
gcc -c -g hello_world.adb
gnatbind -x hello_world.ali
gnatlink hello_world.ali -g
% ./hello_world
Hello World!
It's a wonderful day
% file hello_world
hello_world: Mach-O 64-bit executable arm64
% otool -L hello_world
hello_world:
@rpath/libgcc_s.1.1.dylib (compatibility version 1.0.0, current version 1.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
Thank you again for your help, and for building this native Apple Silicon version!
Simon
Thanks very much for the feedback!
I guess the hardest part is getting the first native GNAT version for arm64 (Apple Silicon), to build everything that follows!
Yes. I’m going to write it up (RSN). You can see some of the saga here.
Fixed in b9b013b.
Hi @simonjwright
I have installed gcc-11.2.0-x86_64-apple-darwin15.pkg from your Releases page.
This completes ok, and I have updated my path too ensure the installed GNAT compiler and tools are the found first.
When I try to compile a simple Ada program with the command:
gnatmake -g hello_world.adb
such as:I am getting the following error:
The computer is a Mac mini M1 with the versions shown below installed. I have the Xcode Command Line Tools installed (ie not the full XCode suite) - just in case that makes a difference with the linker and the provided GNAT/gcc compiler perhaps?
Let me know if you need any further outputs to help debug the issue.
Thanks
Simon