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
pull/513/head
Nirbheek Chauhan 9 years ago committed by Jussi Pakkanen
parent 1d2b4ed8e9
commit 804a3ca72a
  1. 4
      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']}

Loading…
Cancel
Save