-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[release/5.0] Re-enable support for using the system libunwind #42853
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We can now build runtime against the system libunwind using: ./build.sh -cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND This allows Linux distributions that already ship a compatible version of libunwind library to use that instead of carrying a duplicate in .NET. This provides some benefits to them, including smaller build sizes, slightly faster builds and fewer places to fix any vulnerabilities This functionality was already supported in .NET Core 3.1 and has regressed since. CoreCLR already handles `-DCLR_CMAKE_USE_SYSTEM_LIBUNWIND`, so no changes are needed there. The libraries build doesn't care about this cmake varibale, but cmake itself fails if the variable is not used: EXEC : CMake error : [runtime/src/libraries/Native/build-native.proj] Manually-specified variables were not used by the project: CLR_CMAKE_USE_SYSTEM_LIBUNWIND So libraries just needs to check and ignore this variable. The singlefilehost needs to link against libunwind too. Otherwise the linker fails to resolve symbols, making the build fail: /usr/bin/ld: runtime/artifacts/bin/coreclr/Linux.x64.Debug//lib/libcoreclrpal.a(seh.cpp.o): in function `UnwindContextToWinContext(unw_cursor*, _CONTEXT*)': dotnet/runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:176: undefined reference to `_ULx86_64_get_reg' /usr/bin/ld: runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:177: undefined reference to `_ULx86_64_get_reg' /usr/bin/ld: runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:178: undefined reference to `_ULx86_64_get_reg' /usr/bin/ld: runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:179: undefined reference to `_ULx86_64_get_reg' /usr/bin/ld: runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:180: undefined reference to `_ULx86_64_get_reg' /usr/bin/ld: runtime/artifacts/bin/coreclr/Linux.x64.Debug//lib/libcoreclrpal.a(seh.cpp.o): runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:181: more undefined references to `_ULx86_64_get_reg' follow /usr/bin/ld: runtime/artifacts/bin/coreclr/Linux.x64.Debug//lib/libcoreclrpal.a(seh.cpp.o): in function `GetContextPointer(unw_cursor*, ucontext_t*, int, unsigned long**)': runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:227: undefined reference to `_ULx86_64_get_save_loc' /usr/bin/ld: runtime/artifacts/bin/coreclr/Linux.x64.Debug//lib/libcoreclrpal.a(seh.cpp.o): in function `PAL_VirtualUnwind': runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:340: undefined reference to `_ULx86_64_init_local' /usr/bin/ld: runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:351: undefined reference to `_ULx86_64_step' /usr/bin/ld: runtime/src/coreclr/src/pal/src/exception/seh-unwind.cpp:360: undefined reference to `_ULx86_64_is_signal_frame' clang-10: error: linker command failed with exit code 1 (use -v to see invocation) Fixes: #42661
VSadov
approved these changes
Sep 29, 2020
This was referenced Sep 29, 2020
@jeffschwMSFT This has already been approved, right? |
@agocke once we have verified and feel this is good, we can merge as part of tell mode for GA. |
jeffschwMSFT
approved these changes
Oct 1, 2020
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.
Approved. We should take this as tell mode in GA
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #42689 to release/5.0
/cc @agocke @omajid
Customer Impact
Source build uses the system libunwind, so without this change the singlefilehost cannot build.
Testing
source build has been tested with the change, and succeeds.
Risk
Low, passing existing options for the CoreCLR build to the singlefilehost build in the same way.