From 13fa61455cdb3e20df56cd2503f2cb2a1bd6243d Mon Sep 17 00:00:00 2001 From: Nedko Arnaudov Date: Fri, 24 Dec 2021 13:54:04 +0200 Subject: [PATCH] Make siginfo.c build optional and disabled by default siginfo is now disabled by default so building on new CPU architectures does not require adjusting of siginfo.c anymore. When needed, --siginfo can be used as option to ./waf configure to enable the functionality --- daemon/main.c | 4 ++++ wscript | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/daemon/main.c b/daemon/main.c index 8d997c9a..ef5a9877 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -35,7 +35,9 @@ #include "version.h" /* git version define */ #include "proctitle.h" #include "loader.h" +#if SIGINFO_ENABLED #include "siginfo.h" +#endif #include "control.h" #include "studio.h" #include "../dbus_constants.h" @@ -328,8 +330,10 @@ int main(int argc, char ** argv, char ** envp) log_error("signal(SIGPIPE, SIG_IGN)."); } +#if SIGINFO_ENABLED /* setup our SIGSEGV magic that prints nice stack in our logfile */ setup_siginfo(); +#endif if (!conf_proxy_init()) { diff --git a/wscript b/wscript index 0ea49c44..29655c68 100644 --- a/wscript +++ b/wscript @@ -49,6 +49,7 @@ def options(opt): opt.add_option('--enable-liblash', action='store_true', default=False, help='Build LASH compatibility library') opt.add_option('--enable-pylash', action='store_true', default=False, help='Build python bindings for LASH compatibility library') opt.add_option('--debug', action='store_true', default=False, dest='debug', help="Build debuggable binaries") + opt.add_option('--siginfo', action='store_true', default=False, dest='siginfo', help="Log backtrace on fatal signal") opt.add_option('--doxygen', action='store_true', default=False, help='Enable build of doxygen documentation') opt.add_option('--distnodeps', action='store_true', default=False, help="When creating distribution tarball, don't package git submodules") opt.add_option('--distname', type='string', default=None, help="Name for the distribution tarball") @@ -218,6 +219,7 @@ def configure(conf): conf.env['BUILD_LIBLASH'] = Options.options.enable_liblash conf.env['BUILD_PYLASH'] = Options.options.enable_pylash + conf.env['BUILD_SIGINFO'] = Options.options.siginfo if conf.env['BUILD_PYLASH'] and not conf.env['BUILD_LIBLASH']: conf.fatal("pylash build was requested but liblash was not") conf.env['BUILD_PYLASH'] = False @@ -273,6 +275,7 @@ def configure(conf): conf.define('DBUS_NAME_BASE', DBUS_NAME_BASE) conf.define('DBUS_BASE_PATH', '/' + DBUS_NAME_BASE.replace('.', '/')) conf.define('BASE_NAME', APPNAME) + conf.define('SIGINFO_ENABLED', conf.env['BUILD_SIGINFO']) conf.define('_GNU_SOURCE', 1) conf.write_config_header('config.h') @@ -297,6 +300,7 @@ def configure(conf): display_msg(conf, 'Build gladish', yesno(conf.env['BUILD_GLADISH'])) display_msg(conf, 'Build liblash', yesno(Options.options.enable_liblash)) display_msg(conf, 'Build pylash', yesno(conf.env['BUILD_PYLASH'])) + display_msg(conf, 'Build with siginfo', yesno(conf.env['BUILD_SIGINFO'])) display_msg(conf, 'Treat warnings as errors', yesno(conf.env['BUILD_WERROR'])) display_msg(conf, 'Debuggable binaries', yesno(conf.env['BUILD_DEBUG'])) display_msg(conf, 'Build doxygen documentation', yesno(conf.env['BUILD_DOXYGEN_DOCS'])) @@ -369,7 +373,6 @@ def build(bld): for source in [ 'main.c', 'loader.c', - 'siginfo.c', 'proctitle.c', 'appdb.c', 'procfs.c', @@ -416,6 +419,9 @@ def build(bld): ]: daemon.source.append(os.path.join("daemon", source)) + if Options.options.siginfo: + daemon.source.append(os.path.join("daemon", 'siginfo.c')) + for source in [ 'jack_proxy.c', 'graph_proxy.c',