authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-03-08 06:41:51+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-03-08 11:22:38-08:00
log1a7ffe4aae9716db58f06f1243d1502480b33f10
treeb883ee682b1e9e54d5ee3b81973dba5d470b315d
parentc9c58ebbe3b0cda39958b3abda835761b00199ec

Compilation: Fix `-fno-rtlib-defaultlib` unused argument warning in ReleaseSafe.

Closes #23138.

1 files changed, 11 insertions(+), 9 deletions(-)

src/Compilation.zig+11-9
......@@ -6029,17 +6029,19 @@ pub fn addCCArgs(
60296029 // function was called.
60306030 try argv.append("-fno-sanitize=function");
60316031
6032 // It's recommended to use the minimal runtime in production environments
6033 // due to the security implications of the full runtime. The minimal runtime
6034 // doesn't provide much benefit over simply trapping.
60356032 if (mod.optimize_mode == .ReleaseSafe) {
6033 // It's recommended to use the minimal runtime in production
6034 // environments due to the security implications of the full runtime.
6035 // The minimal runtime doesn't provide much benefit over simply
6036 // trapping, however, so we do that instead.
60366037 try argv.append("-fsanitize-trap=undefined");
6037 }
6038
6039 // This is necessary because, by default, Clang instructs LLVM to embed a COFF link
6040 // dependency on `libclang_rt.ubsan_standalone.a` when the UBSan runtime is used.
6041 if (target.os.tag == .windows) {
6042 try argv.append("-fno-rtlib-defaultlib");
6038 } else {
6039 // This is necessary because, by default, Clang instructs LLVM to embed
6040 // a COFF link dependency on `libclang_rt.ubsan_standalone.a` when the
6041 // UBSan runtime is used.
6042 if (target.os.tag == .windows) {
6043 try argv.append("-fno-rtlib-defaultlib");
6044 }
60436045 }
60446046 }
60456047 }