From d48e916ef13145c0238c34d1a3b6969885d09c07 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 24 Sep 2019 17:36:22 -0600 Subject: [PATCH] add configure-time option to use lld as the linker (on linux) this cuts about 15 seconds off the total linker time on a 16 core ryzen threadripper --- wscript | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/wscript b/wscript index 1933c3af66..bf9b7bacba 100644 --- a/wscript +++ b/wscript @@ -836,6 +836,7 @@ def options(opt): '--qm-dsp-include', type='string', action='store', dest='qm_dsp_include', default='/usr/include/qm-dsp', help='directory where the header files of qm-dsp can be found') + opt.add_option ('--use-lld', action='store_true', default=False, dest='use_lld', help='Use LLD linker instead of ld (Linux only)') for i in children: opt.recurse(i) @@ -1235,10 +1236,22 @@ int main () { return 0; } conf.env['BUILD_CORECRAPPITA'] = any('coreaudio' in b for b in backends) conf.env['BUILD_PULSEAUDIO'] = any('pulseaudio' in b for b in backends) + if (Options.options.use_lld): + if re.search ("linux", sys.platform) != None and Options.options.dist_target != 'mingw' and conf.env['BUILD_PABACKEND']: + print("lld is only for Linux builds") + else: + try: + conf.find_program ('lld') + conf.env.append_value('LINKFLAGS', '-fuse-ld=lld') + print ("Using the lld linker") + except conf.errors.ConfigurationError: + pass + if re.search ("linux", sys.platform) != None and Options.options.dist_target != 'mingw' and conf.env['BUILD_PABACKEND']: print("PortAudio Backend is not for Linux") sys.exit(1) + if sys.platform != 'darwin' and conf.env['BUILD_CORECRAPPITA']: print("Coreaudio backend is only available for OSX") sys.exit(1) @@ -1409,7 +1422,7 @@ def build(bld): if bld.is_defined ('BEATBOX'): bld.recurse('tools/bb') - + bld.install_files (bld.env['CONFDIR'], 'system_config') bld.install_files (os.path.join (bld.env['DATADIR'], 'templates'), bld.path.ant_glob ('templates/**'), cwd=bld.path.find_dir ('templates'), relative_trick=True)