-
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
singlefilehost doesn't link to system libunwind #42661
Comments
Tagging subscribers to this area: @dotnet/ncl |
I am working on a fix for this; will open a PR shortly |
Tagging subscribers to this area: @agocke |
@omajid I've set the milestone to 6.0, but now I feel we might need this for 5.0, am I right? |
Ideally we would add it to 5.0 GA (or post GA if GA is absolutely frozen for now). If this doesn't get added to 5.0, we still have some options: we can carry this as a patch in source-build or in our RPM packages. But that gets reviewed less thoroughly and becomes harder to maintain as runtime gets additional fixes. I think we should decide to handle this issue consistently with #42094 and #42415: either all go to 5.0 or none of them go to 5.0. |
There is still a window to get this in for 5.0 GA, let me update the milestone. |
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: dotnet#42661
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
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
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 Co-authored-by: Omair Majid <[email protected]>
Trying to build runtime (commit 20710bb) with
-DCLR_CMAKE_USE_SYSTEM_LIBUNWIND
is currently broken:Configuration
dotnet/runtime commit
20710bbcae006e32f8a133c372c8d78722890982
as well asrelease/5.0-preview8
tag.Fedora 32.
x64, but probably affects everything.
Yes: building without
-DCLR_CMAKE_USE_SYSTEM_LIBUNWIND
worksRegression?
Yes. This build configuration was supported in .NET Core 3.1 and we were using it in source-build to build on Fedora/RHEL. See dotnet/coreclr#17164 and dotnet/source-build#391
Other information
The fix is probably the along the lines of #42094: the singlefilehost needs to link to the system libunwind library.
The text was updated successfully, but these errors were encountered: