From 804a3ca72a6b65b3abeba18a292ea592654db03c Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 8 Apr 2016 00:46:45 +0530 Subject: 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 --- mesonbuild/compilers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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']} -- cgit v1.1