Uh oh!
There was an error while loading. Please reload this page.
Clean up JIT<->EE relocations - #121920
Conversation
Introduce a `CorInfoReloc` enum and use it exclusively to communicate relocation types between the EE and JIT. Translate it in crossgen2/ILC to the file-format relocation type when necessary.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
kg
commented
Nov 24, 2025
LGTM |
am11
commented
Nov 24, 2025
@jakobbotsch, I added a smoke test in #121895 to see whether or not it works on community platforms. I tried merging this PR branch and commenting out $ ./build.sh clr+libs
$ src/tests/build.sh -nativeaot -tree:nativeaot -p:TasksConfiguration=Debug -p:LibrariesConfiguration=Debug -keepnativesymbols
Illegal text-relocations:
text-relocation in'_S_P_CoreLib_System_Threading_Tasks_Task__<AsyncCallable>S_P_CoreLib_System_Threading_Tasks_Task__get_CompletedTask'+0x180 (/Users/adeel/projects/runtime5/artifacts/tests/coreclr/obj/osx.arm64.Debug/Managed/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests.o) to '_S_P_CoreLib_System_Threading_Tasks_Task__<AsyncCallable>S_P_CoreLib_System_Threading_Tasks_Task__get_CompletedTask'
text-relocation in'_S_P_CoreLib_System_Threading_Tasks_Task__<AsyncCallable>S_P_CoreLib_System_Threading_Tasks_Task__get_CompletedTask'+0x178 (/Users/adeel/projects/runtime5/artifacts/tests/coreclr/obj/osx.arm64.Debug/Managed/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests.o) to '_Internal_CompilerGenerated__Module___<Resume>S_P_CoreLib_System_Threading_Tasks_Task__<AsyncCallable>S_P_CoreLib_System_Threading_Tasks_Task__get_CompletedTask'
text-relocation in'_fram1_UnitTests_TaskReturningAsyncTest__<AsyncCallable>UnitTests_TaskReturningAsyncTest__SimpleAsyncMethod'+0x34 (/Users/adeel/projects/runtime5/artifacts/tests/coreclr/obj/osx.arm64.Debug/Managed/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests.o) to '_UnitTests_TaskReturningAsyncTest__<AsyncCallable>UnitTests_TaskReturningAsyncTest__SimpleAsyncMethod'
text-relocation in'_fram1_UnitTests_TaskReturningAsyncTest__<AsyncCallable>UnitTests_TaskReturningAsyncTest__SimpleAsyncMethod'+0x2C (/Users/adeel/projects/runtime5/artifacts/tests/coreclr/obj/osx.arm64.Debug/Managed/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests.o) to '_Internal_CompilerGenerated__Module___<Resume>UnitTests_TaskReturningAsyncTest__<AsyncCallable>UnitTests_TaskReturningAsyncTest__SimpleAsyncMethod'
text-relocation in'_fram1_UnitTests_ValueTaskReturningAsyncTest__<AsyncCallable>UnitTests_ValueTaskReturningAsyncTest__SimpleValueTaskAsync'+0x34 (/Users/adeel/projects/runtime5/artifacts/tests/coreclr/obj/osx.arm64.Debug/Managed/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests.o) to '_UnitTests_ValueTaskReturningAsyncTest__<AsyncCallable>UnitTests_ValueTaskReturningAsyncTest__SimpleValueTaskAsync'
text-relocation in'_fram1_UnitTests_ValueTaskReturningAsyncTest__<AsyncCallable>UnitTests_ValueTaskReturningAsyncTest__SimpleValueTaskAsync'+0x2C (/Users/adeel/projects/runtime5/artifacts/tests/coreclr/obj/osx.arm64.Debug/Managed/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests.o) to '_Internal_CompilerGenerated__Module___<Resume>UnitTests_ValueTaskReturningAsyncTest__<AsyncCallable>UnitTests_ValueTaskReturningAsyncTest__SimpleValueTaskAsync'
text-relocation in'_fram1_UnitTests_TaskWithResultTest__<AsyncCallable>UnitTests_TaskWithResultTest__ComputeAsync'+0x34 (/Users/adeel/projects/runtime5/artifacts/tests/coreclr/obj/osx.arm64.Debug/Managed/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests.o) to '_UnitTests_TaskWithResultTest__<AsyncCallable>UnitTests_TaskWithResultTest__ComputeAsync'
text-relocation in'_fram1_UnitTests_TaskWithResultTest__<AsyncCallable>UnitTests_TaskWithResultTest__ComputeAsync'+0x2C (/Users/adeel/projects/runtime5/artifacts/tests/coreclr/obj/osx.arm64.Debug/Managed/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests.o) to '_Internal_CompilerGenerated__Module___<Resume>UnitTests_TaskWithResultTest__<AsyncCallable>UnitTests_TaskWithResultTest__ComputeAsync'
text-relocation in'_fram1_UnitTests_AwaitCompletedTaskTest__<AsyncCallable>UnitTests_AwaitCompletedTaskTest__GetMessageAsync'+0x34 (/Users/adeel/projects/runtime5/artifacts/tests/coreclr/obj/osx.arm64.Debug/Managed/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests.o) to '_UnitTests_AwaitCompletedTaskTest__<AsyncCallable>UnitTests_AwaitCompletedTaskTest__GetMessageAsync'
text-relocation in'_fram1_UnitTests_AwaitCompletedTaskTest__<AsyncCallable>UnitTests_AwaitCompletedTaskTest__GetMessageAsync'+0x2C (/Users/adeel/projects/runtime5/artifacts/tests/coreclr/obj/osx.arm64.Debug/Managed/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests.o) to '_Internal_CompilerGenerated__Module___<Resume>UnitTests_AwaitCompletedTaskTest__<AsyncCallable>UnitTests_AwaitCompletedTaskTest__GetMessageAsync'
text-relocation in'_fram1_UnitTests_AwaitCompletedTaskTest__<AsyncCallable>UnitTests_AwaitCompletedTaskTest__CombineAsync'+0x48 (/Users/adeel/projects/runtime5/artifacts/tests/coreclr/obj/osx.arm64.Debug/Managed/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests.o) to '_UnitTests_AwaitCompletedTaskTest__<AsyncCallable>UnitTests_AwaitCompletedTaskTest__CombineAsync'
text-relocation in'_fram1_UnitTests_AwaitCompletedTaskTest__<AsyncCallable>UnitTests_AwaitCompletedTaskTest__CombineAsync'+0x40 (/Users/adeel/projects/runtime5/artifacts/tests/coreclr/obj/osx.arm64.Debug/Managed/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests.o) to '_Internal_CompilerGenerated__Module___<Resume>UnitTests_AwaitCompletedTaskTest__<AsyncCallable>UnitTests_AwaitCompletedTaskTest__CombineAsync'
text-relocation in'_fram1_UnitTests_AwaitCompletedTaskTest__<AsyncCallable>UnitTests_AwaitCompletedTaskTest__CombineAsync'+0x38 (/Users/adeel/projects/runtime5/artifacts/tests/coreclr/obj/osx.arm64.Debug/Managed/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests.o) to '_UnitTests_AwaitCompletedTaskTest__<AsyncCallable>UnitTests_AwaitCompletedTaskTest__CombineAsync'
text-relocation in'_fram1_UnitTests_AwaitCompletedTaskTest__<AsyncCallable>UnitTests_AwaitCompletedTaskTest__CombineAsync'+0x30 (/Users/adeel/projects/runtime5/artifacts/tests/coreclr/obj/osx.arm64.Debug/Managed/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests.o) to '_Internal_CompilerGenerated__Module___<Resume>UnitTests_AwaitCompletedTaskTest__<AsyncCallable>UnitTests_AwaitCompletedTaskTest__CombineAsync'
ld: Found illegal text-relocations
clang : error : linker command failed with exit code 1 (use -v to see invocation) [/Users/adeel/projects/runtime5/src/tests/build.proj]
/Users/adeel/projects/runtime5/artifacts/bin/coreclr/osx.arm64.Debug/build/Microsoft.NETCore.Native.targets(389,5): error MSB3073: The command ""/usr/bin/clang" "/Users/adeel/projects/runtime5/artifacts/tests/coreclr/obj/osx.arm64.Debug/Managed/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests.o" -o "/Users/adeel/projects/runtime5/artifacts/tests/coreclr/osx.arm64.Debug/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests" -exported_symbols_list "/Users/adeel/projects/runtime5/artifacts/tests/coreclr/obj/osx.arm64.Debug/Managed/nativeaot/SmokeTests/UnitTests/UnitTests/native/UnitTests.exports" -Wl,-dead_strip -Wl,-rpath,'@executable_path/..' -gz=zlib /Users/adeel/projects/runtime5/artifacts/bin/microsoft.netcore.app.runtime.osx-arm64/Debug/runtimes/osx-arm64/native/libSystem.Native.a /Users/adeel/projects/runtime5/artifacts/bin/microsoft.netcore.app.runtime.osx-arm64/Debug/runtimes/osx-arm64/native/libSystem.Globalization.Native.a /Users/adeel/projects/runtime5/artifacts/bin/microsoft.netcore.app.runtime.osx-arm64/Debug/runtimes/osx-arm64/native/libSystem.IO.Compression.Native.a /Users/adeel/projects/runtime5/artifacts/bin/microsoft.netcore.app.runtime.osx-arm64/Debug/runtimes/osx-arm64/native/libSystem.Net.Security.Native.a /Users/adeel/projects/runtime5/artifacts/bin/microsoft.netcore.app.runtime.osx-arm64/Debug/runtimes/osx-arm64/native/libSystem.Security.Cryptography.Native.Apple.a /Users/adeel/projects/runtime5/artifacts/bin/coreclr/osx.arm64.Debug/aotsdk/libbootstrapper.o /Users/adeel/projects/runtime5/artifacts/bin/coreclr/osx.arm64.Debug/aotsdk/libRuntime.WorkstationGC.a /Users/adeel/projects/runtime5/artifacts/bin/coreclr/osx.arm64.Debug/aotsdk/libeventpipe-disabled.a /Users/adeel/projects/runtime5/artifacts/bin/coreclr/osx.arm64.Debug/aotsdk/libRuntime.VxsortDisabled.a /Users/adeel/projects/runtime5/artifacts/bin/coreclr/osx.arm64.Debug/aotsdk/libstandalonegc-disabled.a /Users/adeel/projects/runtime5/artifacts/bin/coreclr/osx.arm64.Debug/aotsdk/libaotminipal.a /Users/adeel/projects/runtime5/artifacts/bin/coreclr/osx.arm64.Debug/aotsdk/libstdc++compat.a /Users/adeel/projects/runtime5/artifacts/bin/microsoft.netcore.app.runtime.osx-arm64/Debug/runtimes/osx-arm64/native/libz.a /Users/adeel/projects/runtime5/artifacts/bin/microsoft.netcore.app.runtime.osx-arm64/Debug/runtimes/osx-arm64/native/libbrotlienc.a /Users/adeel/projects/runtime5/artifacts/bin/microsoft.netcore.app.runtime.osx-arm64/Debug/runtimes/osx-arm64/native/libbrotlidec.a /Users/adeel/projects/runtime5/artifacts/bin/microsoft.netcore.app.runtime.osx-arm64/Debug/runtimes/osx-arm64/native/libbrotlicommon.a --target=arm64-apple-macos12.0 -g -ldl -lobjc -lswiftCore -lswiftFoundation -licucore -lm -L/usr/lib/swift -framework CoreFoundation -framework CryptoKit -framework Foundation -framework Network -framework Security -framework GSS" exited with code 1. [/Users/adeel/projects/runtime5/src/tests/nativeaot/SmokeTests/UnitTests/UnitTests.csproj] [/Users/adeel/projects/runtime5/src/tests/build.proj]without your PR, the error/callstack is same as: #121878 (comment). |
jakobbotsch
commented
Nov 24, 2025
That looks like #121871. It needs a separate change. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jakobbotsch
commented
Nov 24, 2025
PTAL @dotnet/jit-contrib @jkotas |
Uh oh!
There was an error while loading. Please reload this page.
jkotas
left a comment
There was a problem hiding this comment.
LGTM. The additional cleanup can be done in separate PR
Uh oh!
There was an error while loading. Please reload this page.
jakobbotsch
commented
Nov 25, 2025
cc @tomeksowi -- #119203 will need some changes |
Introduce a
CorInfoRelocenum and use it exclusively to communicate relocation types between the EE and JIT. Translate it in crossgen2/ILC to the file-format relocation type when necessary.Fix#121878