From c54aff74b3df4e350d9b3c8b747208a29e162f7f Mon Sep 17 00:00:00 2001 From: MarkusTeufelberger Date: Wed, 24 Sep 2014 11:23:05 +0200 Subject: [PATCH] Build gcc.debug using -Og flag Since gcc 4.8 is required anyways, it might be nice to use its features. Intro to feature (second bullet point): https://gcc.gnu.org/gcc-4.8/changes.html -g (line 328) is still needed: http://stackoverflow.com/questions/12970596/gcc-4-8-does-og-imply-g --- SConstruct | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 598802071..60692bcfa 100644 --- a/SConstruct +++ b/SConstruct @@ -259,7 +259,7 @@ def config_env(toolchain, variant, env): '-Wno-sign-compare', '-Wno-char-subscripts', '-Wno-format', - '-g' # enable debug symbols for gcc and clang + '-g' # generate debug symbols ]) if toolchain == 'clang': @@ -367,6 +367,11 @@ def config_env(toolchain, variant, env): env.Append(CPPDEFINES={ '_FORTIFY_SOURCE': 2 }) + # Build debuggable but still optimized executable + # via -Og switch introduced in GCC 4.8 + env.Append(CCFLAGS=[ + '-Og' # Debuggable optimizations, new in GCC 4.8 + ]) elif toolchain == 'msvc': env.Append (CPPPATH=[