[libcxx-commits] [libcxxabi] [libcxxabi] Always link against libzircon for Fuchsia targets (PR #115910)

Paul Kirth via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 14 09:43:27 PST 2024


https://github.com/ilovepi updated https://github.com/llvm/llvm-project/pull/115910

>From 70828dc662560c9788bddb3311e255d964efa217 Mon Sep 17 00:00:00 2001
From: Paul Kirth <paulkirth at google.com>
Date: Tue, 12 Nov 2024 09:39:24 -0800
Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?=
 =?UTF-8?q?itial=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.4
---
 libcxxabi/src/CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

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()

>From 498c1612b284db66305b6dc572cbe5affd10e622 Mon Sep 17 00:00:00 2001
From: Paul Kirth <paulkirth at google.com>
Date: Thu, 14 Nov 2024 09:43:13 -0800
Subject: [PATCH 2/2] Actually use --as-needed in the correct patch

Created using spr 1.3.4
---
 libcxxabi/src/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt
index 5a384c5345d755..ae824a0afaada1 100644
--- a/libcxxabi/src/CMakeLists.txt
+++ b/libcxxabi/src/CMakeLists.txt
@@ -76,7 +76,7 @@ if (NOT APPLE) # On Apple platforms, we always use -nostdlib++ so we don't need
 endif()
 
 if (FUCHSIA)
-    add_library_flags(zircon)
+    add_link_flags("-Wl,--push-state,--as-needed,-lzircon,--pop-state")
 endif()
 
 if (NOT LIBCXXABI_USE_COMPILER_RT)



More information about the libcxx-commits mailing list