-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-lcrt0.o not found #8
Comments
This is needed for the following sub-package in HAL's body (file src/hal.adb):
For GNAT this is implemented in the file src/hal-non_standard.adb with external references to GNAT's run-time. This method works on Windows and Linux, with the same file. I'm not sure why the linker doesn't find crt0.o on your installation but I remember having seen similar issues discussed on GNAT for Mac for other projects. Perhaps this question has already appeared on comp.lang.ada . |
Thanks, I think I have come across this problem in the distant past but can't recall how I overcame it. Googling indicates that its a long standing problem with Mac OSX. Searching comp.lang.ada indicates using -nostdlib, thanks to Simon Wright, which seems familiar. |
If you want to test HAC, you could, in your copy of HAC, make a bogus body for the procedure in src/hal-non_standard.adb and make the function return '/'. Then you'll have a fully functional HAC, except for Shell_Execute. |
Thanks for your advice but I'm a bit confused. |
Try replacing the contents of src/hal-non_standard.adb with:
Then HAC is completely free of non-Ada dependencies. |
Thanks, but using the replacement I still get: |
Hopefully one of the following will be helpful:
|
gprbuild -P hac zero.adb produced many undefined symbols. gprbuild: failed command was: /opt/gnat/2020/bin/gcc zero.o b__zero.o -nostdlib -g -L/System/Volumes/Data/Ada_Source/hac/obj/debug/ -L/System/Volumes/Data/Ada_Source/hac/obj/debug/ -L/opt/gnat/2020/lib/gcc/x86_64-apple-darwin17.7.0/8.4.1/adalib/ /opt/gnat/2020/lib/gcc/x86_64-apple-darwin17.7.0/8.4.1/adalib/libgnat.a -Wl,-rpath,@executable_path//obj/debug -Wl,-rpath,/opt/gnat/2020/lib/gcc/x86_64-apple-darwin17.7.0/8.4.1/adalib -o /System/Volumes/Data/Ada_Source/hac//zero I tried messing around with a copy of hac.gpr Here's an example: |
That's fine - but "-nostdlib" (or its contrary) is not in hac.gpr. |
I agree. |
If you find a convenient combination of switches (or absence thereof...) that make the build successful (hopefully with the few dependencies to GNAT's run-time discussed previously) and you are confident it will likely work on most Mac setups, I could add a "OS_Kind" switch in hac.gpr, like here: |
Excellent idea. |
hac under Mac OSX High Sierra built without problem after removing "-static" from hac.gpr. |
Next step it the testing part: in the ./test directory: |
All 32 tests passed on Catalina. One test failed on High Sierra: Summary: |
Some preliminary debugging of strings.adb under High Sierra. Hope this is of interest. |
It seems that a string for containing the output in the Image function in HAL is too small. |
How do I get a " trace-back". |
I tracked the problem to HAL.HAC_Image (F : Real) which fails for F: -5.00000000000000000E+20 However, this LAYOUT_ERROR is supposed to be caught by an exception handler which should call Image_with_exponent. I tried a Put_Line from the exception handler I even tried declaring HAL_Exception and I'm wondering if I'm using the wrong GNAT? |
|
I think I've found the problem. |
Great! |
Mac OSX High Sierra GPS created the command: Using terminal: |
Mac OSX 10.15.7
XCode 12.0
GNATMAKE Community 2020 (20200429-84)
Compile and link work well until link fails with library not found for -lcrt0.o using gnatmake, gprbuild and GPS.
The text was updated successfully, but these errors were encountered: