[lld] [CMake] Export symbols after `target_link_libraries` for lld (PR #115700)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 11 01:37:12 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lld
Author: Shatyuka (shatyuka)
<details>
<summary>Changes</summary>
Found that lld only exports very few symbols after enable `LLVM_EXPORT_SYMBOLS_FOR_PLUGINS`.
We need to collect `LINK_LIBRARIES` after all `target_link_libraries` calls.
---
Full diff: https://github.com/llvm/llvm-project/pull/115700.diff
1 Files Affected:
- (modified) lld/tools/lld/CMakeLists.txt (+2-1)
``````````diff
diff --git a/lld/tools/lld/CMakeLists.txt b/lld/tools/lld/CMakeLists.txt
index 8498a91597a930..753b29c5756773 100644
--- a/lld/tools/lld/CMakeLists.txt
+++ b/lld/tools/lld/CMakeLists.txt
@@ -9,7 +9,6 @@ add_lld_tool(lld
SUPPORT_PLUGINS
GENERATE_DRIVER
)
-export_executable_symbols_for_plugins(lld)
function(lld_target_link_libraries target type)
if (TARGET obj.${target})
@@ -34,6 +33,8 @@ lld_target_link_libraries(lld
lldWasm
)
+export_executable_symbols_for_plugins(lld)
+
if(NOT LLD_SYMLINKS_TO_CREATE)
set(LLD_SYMLINKS_TO_CREATE
lld-link ld.lld ld64.lld wasm-ld)
``````````
</details>
https://github.com/llvm/llvm-project/pull/115700
More information about the llvm-commits
mailing list