From 53c6c714cd139df9debadad9008e1e49badf3479 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 6 Jun 2013 21:27:07 +0200 Subject: [PATCH] disable symbol export -- fix LinuxVST issue -rdynamic: Pass the flag -export-dynamic to the ELF linker, on targets that support it. This instructs the linker to add all symbols, not only used ones, to the dynamic symbol table. This option is needed for some uses of dlopen or to allow obtaining backtraces from within a program. Some LinuxVST pluging cause ardour3 to crash -- if ardour is linked with -rdynamic (see #ardour log from 2013-jun-6). This is likely compiler specific and not a problem on las' build-machine (gcc 4.5.5) which is why the linux-packaging script enables it by default. The issue can be reproduced reliably with gcc 4.7.2 and 4.6.3. Although it is yet unclear if it is caused by g++/ld or related to other factors of the build-system... --- tools/linux_packaging/noderun | 2 +- wscript | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/linux_packaging/noderun b/tools/linux_packaging/noderun index c48fdedbe7..b092abd5ca 100644 --- a/tools/linux_packaging/noderun +++ b/tools/linux_packaging/noderun @@ -11,7 +11,7 @@ fi cd $BASE || exit 1 git pull || exit 1 -./waf configure $* --strict --noconfirm --also-libdir=$HOME/a3/inst/lib --also-include=$HOME/gtk/inst/include || exit 1 +./waf configure $* --strict --backtrace --noconfirm --also-libdir=$HOME/a3/inst/lib --also-include=$HOME/gtk/inst/include || exit 1 ./waf || exit 1 cd tools/linux_packaging || exit 1 ./build --public --strip some || exit 1 diff --git a/wscript b/wscript index 93f2912edb..dc0279be8c 100644 --- a/wscript +++ b/wscript @@ -106,12 +106,14 @@ def set_compiler_flags (conf,opt): platform = u[0].lower() version = u[2] + # waf adds -O0 -g itself. thanks waf! is_clang = conf.env['CXX'][0].endswith('clang++') if opt.gprofile: debug_flags = [ '-pg' ] - else: + + if opt.backtrace: if platform != 'darwin' and not is_clang: - debug_flags = [ '-rdynamic' ] # waf adds -O0 -g itself. thanks waf! + debug_flags = [ '-rdynamic' ] # Autodetect if opt.dist_target == 'auto': @@ -377,6 +379,8 @@ def options(opt): help='The user-visible name of the program being built') opt.add_option('--arch', type='string', action='store', dest='arch', help='Architecture-specific compiler flags') + opt.add_option('--backtrace', action='store_true', default=False, dest='backtrace', + help='Compile with -rdynamic -- allow obtaining backtraces from within Ardour') opt.add_option('--no-carbon', action='store_true', default=False, dest='nocarbon', help='Compile without support for AU Plugins with only CARBON UI (needed for 64bit)') opt.add_option('--boost-sp-debug', action='store_true', default=False, dest='boost_sp_debug', @@ -668,6 +672,7 @@ const char* const ardour_config_info = "\\n\\ write_config_text('Build documentation', conf.env['DOCS']) write_config_text('Debuggable build', conf.env['DEBUG']) + write_config_text('Export all symbols (backtrace)', opts.backtrace) write_config_text('Install prefix', conf.env['PREFIX']) write_config_text('Strict compiler flags', conf.env['STRICT']) write_config_text('Internal Shared Libraries', conf.is_defined('INTERNAL_SHARED_LIBS'))