fix: lake: use -O0 for debug builds (#11062)

This PR changes Lake's debug build type to use `-O0` instead of `-Og`
when compiling C code. `-Og` was found to be insufficient for debugging
compiled Lean code -- relevant code was stilled optimized out.
This commit is contained in:
Mac Malone 2025-11-02 21:16:26 -05:00 committed by GitHub
parent 2c45d55683
commit 1aca181fe2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -79,7 +79,7 @@ public inductive BuildType
Debug optimization, asserts enabled, custom debug code enabled, and
debug info included in executable (so you can step through the code with a
debugger and have address to source-file:line-number translation).
For example, passes `-Og -g` when compiling C code.
For example, passes `-O0 -g` when compiling C code.
-/
| debug
/--
@ -112,7 +112,7 @@ public instance : Max BuildType := maxOfLe
/-- The arguments to pass to `leanc` based on the build type. -/
public def leancArgs : BuildType → Array String
| debug => #["-Og", "-g"]
| debug => #["-O0", "-g"]
| relWithDebInfo => #["-O3", "-g", "-DNDEBUG"]
| minSizeRel => #["-Os", "-DNDEBUG"]
| release => #["-O3", "-DNDEBUG"]