-
Notifications
You must be signed in to change notification settings - Fork 12.1k
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
[libcxxabi] Always link against libzircon for Fuchsia targets #115910
base: main
Are you sure you want to change the base?
[libcxxabi] Always link against libzircon for Fuchsia targets #115910
Conversation
Created using spr 1.3.4
@llvm/pr-subscribers-libcxxabi Author: Paul Kirth (ilovepi) ChangesWhen using LTO, the deplibs mechanism is insufficient to ensure that libzircon To work around this, we can just provide libzircon as a link input. Full diff: https://github.com/llvm/llvm-project/pull/115910.diff 1 Files Affected:
diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt
index 84fe2784bec5ca..5a384c5345d755 100644
--- a/libcxxabi/src/CMakeLists.txt
+++ b/libcxxabi/src/CMakeLists.txt
@@ -75,6 +75,10 @@ if (NOT APPLE) # On Apple platforms, we always use -nostdlib++ so we don't need
add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
endif()
+if (FUCHSIA)
+ add_library_flags(zircon)
+endif()
+
if (NOT LIBCXXABI_USE_COMPILER_RT)
add_library_flags_if(LIBCXXABI_HAS_GCC_LIB gcc)
endif()
|
Created using spr 1.3.4
Created using spr 1.3.4
@@ -75,6 +75,10 @@ if (NOT APPLE) # On Apple platforms, we always use -nostdlib++ so we don't need | |||
add_library_flags_if(LIBCXXABI_HAS_C_LIB c) | |||
endif() | |||
|
|||
if (FUCHSIA) | |||
add_link_flags("-Wl,--push-state,--as-needed,-lzircon,--pop-state") |
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.
I'd leave a TODO
comment to use https://cmake.org/cmake/help/latest/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.html once LLVM requires CMake at least 3.24.
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.
done.
Created using spr 1.3.6-beta.1
ping. Can someone for @llvm/reviewers-libcxxabi take a look at this please? |
When using LTO, the deplibs mechanism is insufficient to ensure that libzircon
is always brought into the link prior to LTO code generation. The general
problem is discussed in depth in
#56070
To work around this, we can just provide libzircon as a link input.