-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Clean up JIT<->EE relocations #121920
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
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 |
|
LGTM |
|
@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). |
|
That looks like #121871. It needs a separate change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 35 out of 35 changed files in this pull request and generated no comments.
|
PTAL @dotnet/jit-contrib @jkotas |
jkotas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The additional cleanup can be done in separate PR
|
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