From ec086945fc190d88aa21d2c1bc2159578bbe62d5 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Wed, 12 Jun 2024 15:16:05 -0600 Subject: [PATCH] Use clang+mold on linux (#12944) Takes a clean build on my machine from 222s to 185s Release Notes: - N/A --- .cargo/config.toml | 4 ++++ script/linux | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.cargo/config.toml b/.cargo/config.toml index d73dead142..828d113ffd 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -4,3 +4,7 @@ rustflags = ["-C", "symbol-mangling-version=v0", "--cfg", "tokio_unstable"] [alias] xtask = "run --package xtask --" + +[target.x86_64-unknown-linux-gnu] +linker = "/usr/bin/clang" +rustflags = ["-C", "link-arg=-fuse-ld=mold"] diff --git a/script/linux b/script/linux index 894ce73943..c07a5064af 100755 --- a/script/linux +++ b/script/linux @@ -24,6 +24,8 @@ if [[ -n $apt ]]; then libvulkan1 libgit2-dev make + clang + mold ) $maysudo "$apt" install -y "${deps[@]}" exit 0 @@ -36,6 +38,8 @@ if [[ -n $dnf ]]; then deps=( gcc g++ + clang + mold alsa-lib-devel fontconfig-devel wayland-devel