diff options
author | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2016-04-08 00:46:45 +0530 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-04-07 22:16:45 +0300 |
commit | 804a3ca72a6b65b3abeba18a292ea592654db03c (patch) | |
tree | 64abd2b765fa4c4934fb4be001306be134f34bad | |
parent | 1d2b4ed8e9c2a8aec792ca302adf8ef4ac485273 (diff) | |
download | meson-804a3ca72a6b65b3abeba18a292ea592654db03c.zip meson-804a3ca72a6b65b3abeba18a292ea592654db03c.tar.gz meson-804a3ca72a6b65b3abeba18a292ea592654db03c.tar.bz2 |
compilers: Debug optimization level should be -O0 (#509)
Without any -O options, gcc does not generate properly debuggable code.
> With no -O option at all, some compiler passes that collect information useful
> for debugging do not run at all
gcc recommends -Og, but that isn't supported by clang, so we use -O0
See https://github.com/mesonbuild/meson/pull/509 for more discussion
-rw-r--r-- | mesonbuild/compilers.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index 4f55be4..f80a28d 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -55,7 +55,9 @@ def is_library(fname): return suffix in lib_suffixes gnulike_buildtype_args = {'plain' : [], - 'debug' : ['-g'], + # -O0 is passed for improved debugging information with gcc + # See https://github.com/mesonbuild/meson/pull/509 + 'debug' : ['-O0', '-g'], 'debugoptimized' : ['-O2', '-g'], 'release' : ['-O3']} |