Closed simonjwright closed 11 months ago
my understanding is that the linker crash has been fixed and will hopefully be in the next dot release.
I'll take a look at why we're getting the duplicate library warning (we might well be intentionally placing libgcc twice on the command line, since libraries are usually positional in terms of search order). I know that ld (ld64 as well as the new one) will re-visit libraries to satisfy dependencies, but I am not sure that means the order is no longer relevant. I take it that this is an inconvenience, not a show-stopper?
The duplicate library warning is definitely not a showstopper!
The duplicate library warning is definitely not a showstopper!
I think I've a fix for this tho - and I do have a recipe for building Ada with a bootstrap compiler that was built against 14.3 but then using XC15 ld-classic for the new compiler. Although, given that we expect a fixed XC15.x, I would suggest just leaving 14.3 in place (or putting it back and just using the XC15 Somoma SDK) until there's a working 15
I think staying with/reverting to 14.3 is the best option (I hope that'll stop Software Update pestering me to upgrade!)
For info. The listings below are for GCC 13.1.0/aarch64, but the same behaviour happens with 12.2.0/x86_64 and 13.1.0/x86_64 (under Rosetta, I don't have an x86_64 machine that can run Ventura/CLT15.0)
Linking a C program doesn't crash; these are the ld
switches:
/usr/bin/ld \
-syslibroot \
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/ \
-dynamic \
-arch \
arm64 \
-macosx_version_min \
13.0.0 \
-o \
a.out \
-L/opt/homebrew/lib \
-L/opt/gcc-13.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/13.1.0 \
-L/opt/gcc-13.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/13.1.0/../../.. \
/var/folders/ch/k_zwspdx3qsfbt1_x21zld6m0000gn/T//ccto2eQX.o \
-v \
-lemutls_w \
-lgcc \
-lSystem \
-lgcc \
-no_compact_unwind
Linking an Ada program against the static Ada runtime (the default, -bargs -static
) crashes:
/usr/bin/ld \
-syslibroot \
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/ \
-dynamic \
-arch \
arm64 \
-macosx_version_min \
13.0.0 \
-o \
hello \
-L./ \
-L/opt/gcc-13.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/13.1.0/adalib/ \
-L/opt/homebrew/lib \
-L/opt/gcc-13.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/13.1.0 \
-L/opt/gcc-13.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/13.1.0/../../.. \
b~hello.o \
./hello.o \
-v \
/opt/gcc-13.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/13.1.0/adalib/libgnat.a \
-lemutls_w \
-lgcc \
-lSystem \
-lgcc \
-no_compact_unwind
Linking an Ada program against the shared Ada runtime (-bargs -shared
) succeeds!
/usr/bin/ld \
-syslibroot \
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/ \
-dynamic \
-arch \
arm64 \
-macosx_version_min \
13.0.0 \
-o \
hello \
-L./ \
-L/opt/gcc-13.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/13.1.0/adalib/ \
-L/opt/homebrew/lib \
-L/opt/gcc-13.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/13.1.0 \
-L/opt/gcc-13.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/13.1.0/../../.. \
b~hello.o \
./hello.o \
-v \
-rpath \
/opt/gcc-13.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/13.1.0/adalib/ \
-rpath \
/opt/gcc-13.1.0-aarch64/lib \
-lgnat-13 \
-lemutls_w \
-lgcc \
-lSystem \
-lgcc \
-no_compact_unwind
Oh dear, it looks as though any static library triggers the crash.
I'm not entirely sure what the second part of this is reporting - i.e. is it something new or another manifestation of the xc15 linker's issues (I believe HB have reported more issues than the original crash)
So I just pushed a rebase that should fix the duplicate library issue, and the linker issue is not actually "our bug", so the question is can you identify what you are reporting in the other crash (and with which tools?)
I'm not entirely sure what the second part of this is reporting - i.e. is it something new or another manifestation of the xc15 linker's issues (I believe HB have reported more issues than the original crash)
I’m sorry, it’s just a more detailed report of the same 15.0 linker issues.
I was hoping that using the shared GNAT runtime would be a (temporary) fix for users, but no, it seems that any static library triggers the issue.
OK - so, as far as this issue goes;
the linker bug is not fixable by us - but there's a work-around (which should allow Ada to work 'normally' - if not then please report). IFF you need to use an older gnatmake which was built against 14.3, I do have a horrible configure line that allows for this (but you need to re-install the 14.3 Xcode CLT somewhere to use it).
I have pushed a fix for the duplicate library warning.
So, unless there's any remaining fallout from (1) we should be done here?
Agreed, thanks
See GCC PR 111481.
We no longer (at least since gcc version 14.0.0 20230820) have the
-macosx_version_min
issue. We do have the ld crash with Ada (the-Wl,-ld_classic
workaround works).For both C and Ada, we now get
ld: warning: ignoring duplicate libraries: '-lgcc'
, as below:What's the best approach for reporting the ld crash to Apple? (if they don't know about it already). I'd imagine they'd appreciate a set of binary objects to feed into ld?
If there's no timely response, we could update the specs?