diff options
| author | Ken Micklas <kmicklas@uber.com> | 2022-06-28 08:09:54 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-06-28 14:16:22 -0400 |
| commit | 22490892fa33c27c6c9158cdb9b910a95d575fde (patch) | |
| tree | af20f820625a9d59d59054b2dad89fcd35a0dad8 /src/Compilation.zig | |
| parent | aa1f9556d0e434e3e127f3460a3d6ee65ef17863 (diff) | |
| download | zig-22490892fa33c27c6c9158cdb9b910a95d575fde.tar.gz zig-22490892fa33c27c6c9158cdb9b910a95d575fde.zip | |
Pass -O0 rather than -Og to Clang for Debug builds
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 01f6a15e2c..c6c7a94b41 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -4073,7 +4073,10 @@ pub fn addCCArgs( .Debug => { // windows c runtime requires -D_DEBUG if using debug libraries try argv.append("-D_DEBUG"); - try argv.append("-Og"); + // Clang has -Og for compatibility with GCC, but currently it is just equivalent + // to -O1. Besides potentially impairing debugging, -O1/-Og significantly + // increases compile times. + try argv.append("-O0"); if (comp.bin_file.options.link_libc and target.os.tag != .wasi) { try argv.append("-fstack-protector-strong"); |
