About the wasm removal:
Simply having a patch like that is not really helping because there thing in
source that uses wasm symbols (dont know exactly how many)
An example build error after the patch below applied:
```
/usr/bin/ld:
tools/lld/tools/lld/CMakeFiles/lld.dir/lld.cpp.o:(.data.rel.ro.C.2.0+0x48):
undefined reference to `lld::wasm::link(llvm::ArrayRef<char const*>,
llvm::raw_ostream&, llvm::raw_ostream&, bool, bool)'
```
So proper wasm removal definitely not trivial. Should we add all wasm
related outputs into not installed?
@doko do you maybe know a better way to disable wasm?
```
Description: Add CMake option to disable building WASM linker backend
This patch adds an LLD_BUILD_WASM option to control whether the WASM
linker backend is built.
Author: Talha Can Havadar
Forwarded: no
Last-Update: 2025-12-16
--- a/lld/CMakeLists.txt
+++ b/lld/CMakeLists.txt
@@ -164,6 +164,9 @@
option(LLD_BUILD_TOOLS
"Build the lld tools. If OFF, just generate build targets." ON)
+option(LLD_BUILD_WASM
+ "Build the WebAssembly linker backend. If OFF, wasm-ld will not be built."
ON)
+
option(LLD_DEFAULT_LD_LLD_IS_MINGW
"Use MinGW as the default backend for ld.lld. If OFF, ELF will be used."
OFF)
if (LLD_DEFAULT_LD_LLD_IS_MINGW)
@@ -205,6 +208,8 @@
add_subdirectory(ELF)
add_subdirectory(MachO)
add_subdirectory(MinGW)
-add_subdirectory(wasm)
+if (LLD_BUILD_WASM)
+ add_subdirectory(wasm)
+endif()
add_subdirectory(cmake/modules)
--- a/lld/tools/lld/CMakeLists.txt
+++ b/lld/tools/lld/CMakeLists.txt
@@ -31,12 +31,21 @@
lldELF
lldMachO
lldMinGW
- lldWasm
)
+if(LLD_BUILD_WASM)
+ lld_target_link_libraries(lld
+ PRIVATE
+ lldWasm
+ )
+endif()
+
if(NOT LLD_SYMLINKS_TO_CREATE)
set(LLD_SYMLINKS_TO_CREATE
- lld-link ld.lld ld64.lld wasm-ld)
+ lld-link ld.lld ld64.lld)
+ if(LLD_BUILD_WASM)
+ list(APPEND LLD_SYMLINKS_TO_CREATE wasm-ld)
+ endif()
endif()
foreach(link ${LLD_SYMLINKS_TO_CREATE})
```
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2133814
Title:
NEW package request: llvm-toolchain-rocm
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+bug/2133814/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs