mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-12 09:20:36 +00:00
Toolchain+CI: Link LLVM with LLD if available
According to most benchmarks, LLD is faster than GNU ld and the macOS linker, so let's use it if possible in order to speed up the toolchain build.
This commit is contained in:
parent
d21c38a72d
commit
162606f358
Notes:
sideshowbarker
2024-07-17 21:16:12 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/162606f3586 Pull-request: https://github.com/SerenityOS/serenity/pull/11701 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/jepebe
2 changed files with 14 additions and 1 deletions
|
@ -10,7 +10,7 @@ steps:
|
|||
sudo add-apt-repository ppa:canonical-server/server-backports
|
||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||
sudo apt-get update
|
||||
sudo apt-get install ccache e2fsprogs gcc-11 g++-11 libstdc++-11-dev libmpfr-dev libmpc-dev ninja-build qemu-utils qemu-system-i386 unzip
|
||||
sudo apt-get install ccache e2fsprogs gcc-11 g++-11 libstdc++-11-dev libmpfr-dev libmpc-dev ninja-build qemu-utils qemu-system-i386 unzip lld
|
||||
displayName: 'Install Dependencies'
|
||||
|
||||
- ${{ if eq(parameters.os, 'Linux') }}:
|
||||
|
|
|
@ -130,6 +130,18 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
link_lld=
|
||||
buildstep dependencies echo "Checking whether the LLD linker is available..."
|
||||
if ${CXX:-c++} -o /dev/null -fuse-ld=lld -xc - >/dev/null 2>/dev/null << 'PROGRAM'
|
||||
int main() {}
|
||||
PROGRAM
|
||||
then
|
||||
link_lld=1
|
||||
buildstep dependencies echo "Using LLD for linking LLVM."
|
||||
else
|
||||
buildstep dependencies echo "LLD not found. Using the default linker."
|
||||
fi
|
||||
|
||||
# === CHECK CACHE AND REUSE ===
|
||||
|
||||
pushd "$DIR"
|
||||
|
@ -254,6 +266,7 @@ pushd "$DIR/Build/clang"
|
|||
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
|
||||
-DSERENITY_MODULE_PATH="$DIR/CMake" \
|
||||
-C "$DIR/CMake/LLVMConfig.cmake" \
|
||||
${link_lld:+"-DLLVM_ENABLE_LLD=ON"} \
|
||||
${dev:+"-DLLVM_CCACHE_BUILD=ON"} \
|
||||
${ci:+"-DLLVM_CCACHE_BUILD=ON"} \
|
||||
${ci:+"-DLLVM_CCACHE_DIR=$LLVM_CCACHE_DIR"} \
|
||||
|
|
Loading…
Reference in a new issue