authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-03-08 06:41:51+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-03-08 13:26:09+01:00
log3b3c18909d5f745f607ead203f67d42d13f200d5
treee08dd231c3d3af9eb137c6d03328d4dbbd1cc8c2
parent5466a2f72dd5108846a5318cc70644d8a50bc076

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(...@@ -6029,17 +6029,19 @@ pub fn addCCArgs(
6029 // function was called.6029 // function was called.
6030 try argv.append("-fno-sanitize=function");6030 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.
6035 if (mod.optimize_mode == .ReleaseSafe) {6032 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.
6036 try argv.append("-fsanitize-trap=undefined");6037 try argv.append("-fsanitize-trap=undefined");
6037 }6038 } else {
60386039 // This is necessary because, by default, Clang instructs LLVM to embed
6039 // This is necessary because, by default, Clang instructs LLVM to embed a COFF link6040 // a COFF link dependency on `libclang_rt.ubsan_standalone.a` when the
6040 // dependency on `libclang_rt.ubsan_standalone.a` when the UBSan runtime is used.6041 // UBSan runtime is used.
6041 if (target.os.tag == .windows) {6042 if (target.os.tag == .windows) {
6042 try argv.append("-fno-rtlib-defaultlib");6043 try argv.append("-fno-rtlib-defaultlib");
6044 }
6043 }6045 }
6044 }6046 }
6045 }6047 }