From 5041bc7ab12abc24cb06561dc3c710260a1d8a3e Mon Sep 17 00:00:00 2001 From: james58899 Date: Sat, 16 Mar 2024 09:24:33 +0000 Subject: [PATCH] Try mold --- .github/workflows/build.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cd8d3c2..31cf756 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,8 +33,8 @@ jobs: env: CC: clang-17 CXX: clang-17 - CFLAGS: "-flto -fuse-ld=lld-17" - CXXFLAGS: "-flto -fuse-ld=lld-17" + CFLAGS: "-flto -fuse-ld=mold" + CXXFLAGS: "-flto -fuse-ld=mold" steps: - uses: actions/checkout@v4 - name: Install build tools @@ -43,6 +43,10 @@ jobs: echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main" | sudo tee /etc/apt/sources.list.d/llvm.list sudo apt-get update sudo apt-get install -y crossbuild-essential-arm64 crossbuild-essential-armhf clang-17 + - name: Install mold + uses: rui314/setup-mold@v1 + with: + make-default: false - uses: actions/cache@v4 with: path: | @@ -59,11 +63,10 @@ jobs: - name: Build env: __CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS: "nightly" - CARGO_HOST_LINKER: "clang-17" - CARGO_HOST_RUSTFLAGS: "-Clink-arg=-fuse-ld=lld-17" - CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-Clinker-plugin-lto -Clinker=clang-17 -Clink-arg=-fuse-ld=lld-17 -Clink-arg=--target=x86_64-unknown-linux-gnu" - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-Clinker-plugin-lto -Clinker=clang-17 -Clink-arg=-fuse-ld=lld-17 -Clink-arg=--target=aarch64-unknown-linux-gnu" - CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUSTFLAGS: "-Clinker-plugin-lto -Clinker=clang-17 -Clink-arg=-fuse-ld=lld-17 -Clink-arg=--target=armv7-unknown-linux-gnueabihf" + CARGO_HOST_RUSTFLAGS: "-Clinker-plugin-lto=/usr/lib/LLVMgold.so -Clinker=clang-17 -Clink-arg=-fuse-ld=mold" + CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-Clinker-plugin-lto=/usr/lib/LLVMgold.so -Clinker=clang-17 -Clink-arg=-fuse-ld=mold -Clink-arg=--target=x86_64-unknown-linux-gnu" + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-Clinker-plugin-lto=/usr/lib/LLVMgold.so -Clinker=clang-17 -Clink-arg=-fuse-ld=mold -Clink-arg=--target=aarch64-unknown-linux-gnu" + CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUSTFLAGS: "-Clinker-plugin-lto=/usr/lib/LLVMgold.so -Clinker=clang-17 -Clink-arg=-fuse-ld=mold -Clink-arg=--target=armv7-unknown-linux-gnueabihf" run: cargo -Ztarget-applies-to-host -Zhost-config build --verbose --release --target=${{ matrix.target }} - uses: actions/upload-artifact@v4 with: