From e5d07a07d09dd377ad88e3474c86f265ca4bf373 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Tue, 13 Oct 2026 23:37:54 +0200 Subject: [PATCH] lld: Add version 22.1.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [Description](https://lld.llvm.org/): > LLD is a linker from the LLVM project that is a drop-in replacement > for system linkers and runs much faster than them. It also provides > features that are useful for toolchain developers. Build lld from the llvm-project monorepo as a standalone build against the installed llvm 22.1.8, like `compiler-rt.be0`, reusing the same tarball on beehive. Also build with `-G Ninja`. `LLVM_USE_SYMLINKS` is defined only in `llvm/CMakeLists.txt`, so in a standalone build it is unset and AddLLVM copies the binary for every flavour: [132/132] … && /usr/bin/cmake -E copy …/build/bin/lld …/build/./bin/lld-link && … -E copy …/bin/lld …/bin/ld.lld && … -E copy …/bin/lld …/bin/ld64.lld && … -E copy …/bin/lld …/bin/wasm-ld -rwxr-xr-x root/root 8264544 /usr/bin/wasm-ld -rwxr-xr-x root/root 8264544 /usr/bin/ld64.lld -rwxr-xr-x root/root 8264544 /usr/bin/ld.lld -rwxr-xr-x root/root 8264544 /usr/bin/lld-link -rwxr-xr-x root/root 8264544 /usr/bin/lld Set it explicitly, so that ld.lld, ld64.lld, lld-link and wasm-ld are symbolic links to lld, which shrinks the package from 15.9 MB to 5.8 MB. Tests are disabled, as they need llvm_gtest, which llvm does not install. Tested by building on MXQ (quokka), and linking C, C++, ThinLTO and a shared object with `clang --ld-path=…/ld.lld` and `gcc -fuse-ld=lld -B…/usr/bin`, all reporting `Linker: LLD 22.1.8`. Assisted-by: claude-opus-5.5 (Claude Code) --- lld.be0 | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 lld.be0 diff --git a/lld.be0 b/lld.be0 new file mode 100755 index 000000000..51f45c886 --- /dev/null +++ b/lld.be0 @@ -0,0 +1,39 @@ +#!/usr/bin/env beesh + +# BEE_VERSION lld-22.1.8-0 + +#SRCURL[0]="https://github.com/llvm/llvm-project/releases/download/llvmorg-${PKGVERSION}/llvm-project-${PKGVERSION}.src.tar.xz" +SRCURL[0]="https://beehive.molgen.mpg.de/69065494ebcb1150b2a329c1b3db7584/llvm-project-22.1.8.src.tar.xz" + +# PATCHURL+=() + +# build_in_sourcedir + +sourcesubdir_append lld + +#mee_extract() { +# bee_extract "${@}" +#} + +#mee_patch() { +# bee_patch "${@}" +#} + +mee_configure() { + bee_configure \ + -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_CMAKE_DIR=$(llvm-config --cmakedir) \ + -DLLVM_LINK_LLVM_DYLIB=ON \ + -DLLVM_USE_SYMLINKS=ON \ + -DLLVM_INCLUDE_TESTS=OFF \ + -Wno-dev \ + -G Ninja +} + +mee_build() { + start_cmd ninja -v -C ${B} ${BEE_NINJAFLAGS} "${@}" +} + +mee_install() { + DESTDIR=${D} start_cmd ninja -C ${B} install "${@}" +}