From 25ce9a1b00f58cfaccaaa827462d044c4ebf88ec Mon Sep 17 00:00:00 2001 From: Boshen Date: Wed, 5 Nov 2025 21:22:27 +0800 Subject: [PATCH] fix(ci): fix linker issues on linux (#15327) Attempt to get main to green before the bigger change in https://github.com/oxc-project/oxc/pull/15323 --- .cargo/config.toml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 38ce34a52c..930c9a0e11 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -25,9 +25,6 @@ rustflags = ["-C", "target-feature=+crt-static"] [target.aarch64-pc-windows-msvc] rustflags = ["-C", "target-feature=+crt-static"] -[target.'cfg(target_os = "linux")'] -rustflags = ["-C", "linker-features=-lld", "-C", "link-args=-Wl,--warn-unresolved-symbols"] - # To be able to run unit tests on Windows, support compilation to 'x86_64-pc-windows-msvc'. # Use Hybrid CRT to reduce the size of the binary (Coming by default with Windows 10 and later versions). [target.'cfg(target_os = "windows")'] @@ -45,3 +42,11 @@ rustflags = [ # See https://x.com/Brooooook_lyn/status/1895848334692401270 [target.'cfg(target_env = "gnu")'] rustflags = ["-C", "link-args=-Wl,-z,nodelete"] + +[target.'cfg(target_os = "linux")'] +rustflags = ["-C", "link-args=-Wl,--warn-unresolved-symbols"] + +# LLD linker is currently broken for us, opt out. +# https://blog.rust-lang.org/2025/09/18/Rust-1.90.0/#what-s-in-1-90-0-stable +[target.x86_64-unknown-linux-gnu] +rustflags = ["-C", "linker-features=-lld", "-C", "link-args=-Wl,--warn-unresolved-symbols"]