Open vcsjones opened 5 days ago
Tagging subscribers to this area: @mangod9 See info in area-owners.md if you want to be subscribed.
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas See info in area-owners.md if you want to be subscribed.
I may take a look. Was it Xcode 16 beta 1 or 2?
I may take a look. Was it Xcode 16 beta 1 or 2?
Beta 2. 16A5171r.
Beta 2. 16A5171r.
That explains it. I run it earlier with Beta 1 and that still builds on my machine (cannot completely rule out that Cmake cache still forced some other Xcode version)... I'll switch to Beta 2 soon.
I can reproduce. At first sight, it seems that using .alt_entry
should be possible (https://github.com/llvm/llvm-project/pull/82268):
--- a/src/coreclr/nativeaot/Runtime/unix/unixasmmacrosarm64.inc
+++ b/src/coreclr/nativeaot/Runtime/unix/unixasmmacrosarm64.inc
@@ -24,9 +24,11 @@ C_FUNC(\Name):
.endm
.macro ALTERNATE_ENTRY Name
- .global C_FUNC(\Name)
#if !defined(__APPLE__)
+ .global C_FUNC(\Name)
.hidden C_FUNC(\Name)
+#else
+ .alt_entry C_FUNC(\Name)
#endif
C_FUNC(\Name):
.endm
It still fails with the following errors:
[ 37%] Building ASM object nativeaot/Runtime/Full/CMakeFiles/Runtime.ServerGC.dir/__/arm64/PInvoke.S.o
<instantiation>:2:9: error: invalid CFI advance_loc expression
.cfi_restore fp
^
<instantiation>:2:9: error: invalid CFI advance_loc expression
.cfi_restore fp
^
<instantiation>:2:9: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset -0x60
^
<instantiation>:2:9: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset -0x40
^
make[3]: *** [nativeaot/Runtime/Full/CMakeFiles/Runtime.WorkstationGC.dir/__/arm64/UniversalTransition.S.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [nativeaot/Runtime/Full/CMakeFiles/Runtime.WorkstationGC.dir/__/arm64/ExceptionHandling.S.o] Error 1
<instantiation>:2:9: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset -0x60
^
<instantiation>:2:9: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset -0x40
^
[ 37%] Building ASM object nativeaot/Runtime/Full/CMakeFiles/Runtime.ServerGC.dir/__/arm64/InteropThunksHelpers.S.o
[ 37%] Building ASM object nativeaot/Runtime/Full/CMakeFiles/Runtime.ServerGC.dir/__/arm64/UniversalTransition.S.o
make[3]: *** [nativeaot/Runtime/Full/CMakeFiles/Runtime.ServerGC.dir/__/arm64/ExceptionHandling.S.o] Error 1
make[3]: *** Waiting for unfinished jobs....
[ 37%] Building ASM object nativeaot/Runtime/Full/CMakeFiles/Runtime.ServerGC.dir/__/arm64/StubDispatch.S.o
[ 37%] Building ASM object nativeaot/Runtime/Full/CMakeFiles/Runtime.ServerGC.dir/__/arm64/WriteBarriers.S.o
[ 37%] Building ASM object nativeaot/Runtime/Full/CMakeFiles/Runtime.ServerGC.dir/__/arm64/ThunkPoolThunks.S.o
make[2]: *** [nativeaot/Runtime/Full/CMakeFiles/Runtime.WorkstationGC.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
<instantiation>:2:9: error: invalid CFI advance_loc expression
.cfi_restore fp
^
<instantiation>:2:9: error: invalid CFI advance_loc expression
.cfi_restore fp
^
Hopefully it will be relatively easy to figure it out and the linker won't complain about the .alt_entry
.
So, on the upside... the .alt_entry
seems to do the trick for the first error, and links. On the downside, the "invalid CFI advance_loc expression" error could be a compiler bug from a change that was supposed to detect the same condition as the other error (https://github.com/llvm/llvm-project/commit/0b0672773e8b2ed01ad3fce103f4d84becfdd1ed).
This doesn't compile either:
.section __TEXT,__text
.globl _foo
_foo:
.cfi_startproc
sub sp, sp, 8
.cfi_adjust_cfa_offset 8
.alt_entry _bar
_bar:
add sp, sp, 8
.cfi_adjust_cfa_offset -8
ret
.cfi_endproc
with the error
src/test.S:10:3: error: invalid CFI advance_loc expression
.cfi_adjust_cfa_offset -8
I'll have to sleep on it, and read more about the .alt_entry
semantics.
Filed as LLVM issue: https://github.com/llvm/llvm-project/issues/97116
We will still need to switch to using .alt_entry
, and we may need to do that in ObjWriter as well (FYI @ivanpovazan).
I was doing a little bit of scouting on macOS 16 / Xcode 16 and ran in to a compiler error on Xcode 16.
The gist of the error is
Repeated many times. The full build log is available at https://gist.github.com/vcsjones/1649f2fb8b19ab86428582b6884229c0
Note this does not require a beta of macOS, only the developer tools.