diff --git a/wscript b/wscript index ae4b85e61d..57d3496465 100644 --- a/wscript +++ b/wscript @@ -177,10 +177,6 @@ def set_compiler_flags (conf,opt): if opt.gprofile: debug_flags = [ '-pg' ] - if opt.backtrace: - if platform != 'darwin' and not is_clang: - debug_flags = [ '-rdynamic' ] - # Autodetect if opt.dist_target == 'auto': if platform == 'darwin': @@ -415,6 +411,10 @@ def set_compiler_flags (conf,opt): conf.env.append_value('CFLAGS', optimization_flags) conf.env.append_value('CXXFLAGS', optimization_flags) + if opt.backtrace: + if platform != 'darwin' and not is_clang: + linker_flags += [ '-rdynamic' ] + conf.env.append_value('CFLAGS', compiler_flags) conf.env.append_value('CFLAGS', c_flags) conf.env.append_value('CXXFLAGS', compiler_flags)