[lld] [CMake] Export symbols after `target_link_libraries` for lld (PR #115700)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 11 21:08:05 PST 2024


https://github.com/shatyuka updated https://github.com/llvm/llvm-project/pull/115700

>From 144b60571c8db8af81cc61dc69a8217539d37c02 Mon Sep 17 00:00:00 2001
From: shatyuka <shatyuka at qq.com>
Date: Mon, 11 Nov 2024 17:31:22 +0800
Subject: [PATCH 1/2] [CMake] Export symbols after `target_link_libraries` for
 lld

---
 lld/tools/lld/CMakeLists.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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)

>From 7d7904d3db6a804f305cc089f39f17cf3660e667 Mon Sep 17 00:00:00 2001
From: shatyuka <shatyuka at qq.com>
Date: Tue, 12 Nov 2024 13:07:42 +0800
Subject: [PATCH 2/2] [lld] Rearrange cmake targets

---
 lld/CMakeLists.txt | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt
index 64c9f238055092..eb89a1455c547f 100644
--- a/lld/CMakeLists.txt
+++ b/lld/CMakeLists.txt
@@ -189,6 +189,11 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
 endif()
 
 add_subdirectory(Common)
+add_subdirectory(COFF)
+add_subdirectory(ELF)
+add_subdirectory(MachO)
+add_subdirectory(MinGW)
+add_subdirectory(wasm)
 add_subdirectory(tools/lld)
 
 if (LLVM_INCLUDE_TESTS)
@@ -201,10 +206,5 @@ if (LLVM_INCLUDE_TESTS)
 endif()
 
 add_subdirectory(docs)
-add_subdirectory(COFF)
-add_subdirectory(ELF)
-add_subdirectory(MachO)
-add_subdirectory(MinGW)
-add_subdirectory(wasm)
 
 add_subdirectory(cmake/modules)



More information about the llvm-commits mailing list