From af6dc61f3d6f169e11ac953ef27939a4385ca61a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 1 Mar 2023 01:32:40 +1100 Subject: [PATCH] Disable `--icf=safe` on MacOS (#839) Signed-off-by: Jiahao XU --- justfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index 9fc8eb5b..34ffa2d7 100644 --- a/justfile +++ b/justfile @@ -106,9 +106,19 @@ rust-lld := "" #if use-cargo-zigbuild != "" { # ICF: link-time identical code folding # -# On windows it works out of the box and on other targets it uses +# On windows it works out of the box and on linux it uses # rust-lld. -rustc-icf := if for-release != "" { " -C link-arg=-Wl,--icf=safe" } else { "" } +rustc-icf := if for-release != "" { + if target-os == "windows" { + " -C link-arg=-Wl,--icf=safe" + } else if target-os == "linux" { + " -C link-arg=-Wl,--icf=safe" + } else { + "" + } +} else { + "" +} # Only enable linker-plugin-lto for release # Also disable this on windows since it uses msvc.