authorgravatar for kmicklas@uber.comKen Micklas <kmicklas@uber.com> 2022-06-28 08:09:54+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-06-28 14:16:22-04:00
log22490892fa33c27c6c9158cdb9b910a95d575fde
treeaf20f820625a9d59d59054b2dad89fcd35a0dad8
parentaa1f9556d0e434e3e127f3460a3d6ee65ef17863

Pass -O0 rather than -Og to Clang for Debug builds


1 files changed, 4 insertions(+), 1 deletions(-)

src/Compilation.zig+4-1
...@@ -4073,7 +4073,10 @@ pub fn addCCArgs(...@@ -4073,7 +4073,10 @@ pub fn addCCArgs(
4073 .Debug => {4073 .Debug => {
4074 // windows c runtime requires -D_DEBUG if using debug libraries4074 // windows c runtime requires -D_DEBUG if using debug libraries
4075 try argv.append("-D_DEBUG");4075 try argv.append("-D_DEBUG");
4076 try argv.append("-Og");4076 // Clang has -Og for compatibility with GCC, but currently it is just equivalent
4077 // to -O1. Besides potentially impairing debugging, -O1/-Og significantly
4078 // increases compile times.
4079 try argv.append("-O0");
40774080
4078 if (comp.bin_file.options.link_libc and target.os.tag != .wasi) {4081 if (comp.bin_file.options.link_libc and target.os.tag != .wasi) {
4079 try argv.append("-fstack-protector-strong");4082 try argv.append("-fstack-protector-strong");