[libcxx-commits] [libcxx] [libc++] Correct libcxx default linker script behavior (PR #74130)
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Dec 1 11:12:34 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Haowei (zeroomega)
<details>
<summary>Changes</summary>
Patch 4b1fe097f9a3882f437bc3b829ef02331e28a8d6 introduced a bug when building libc++ for Fuchsia, it disabled the libc++.so linker script by default. This patch restores its original behavior.
---
Full diff: https://github.com/llvm/llvm-project/pull/74130.diff
1 Files Affected:
- (modified) libcxx/CMakeLists.txt (+4-4)
``````````diff
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 8572e7530fd363e..31fc9cec1c57f25 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -251,14 +251,14 @@ option(LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY
# Generate and install a linker script inplace of libc++.so. The linker script
# will link libc++ to the correct ABI library. This option is on by default
-# on UNIX platforms other than Apple unless we statically link libc++abi
-# inside libc++.so, we don't build libc++.so at all or we don't have any
-# ABI library.
+# on UNIX platforms other than Apple, and on the Fuchsia platform unless we
+# statically link libc++abi inside libc++.so, we don't build libc++.so at all
+# or we don't have any ABI library.
if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY
OR NOT LIBCXX_ENABLE_SHARED
OR LIBCXX_CXX_ABI STREQUAL "none")
set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE OFF)
-elseif(UNIX AND NOT APPLE)
+elseif((UNIX OR FUCHSIA) AND NOT APPLE)
set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE ON)
else()
set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE OFF)
``````````
</details>
https://github.com/llvm/llvm-project/pull/74130
More information about the libcxx-commits
mailing list