summaryrefslogtreecommitdiff
path: root/wscript
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2019-09-24 17:36:22 -0600
committerPaul Davis <paul@linuxaudiosystems.com>2019-09-24 17:36:45 -0600
commitd48e916ef13145c0238c34d1a3b6969885d09c07 (patch)
tree4d650209e0dbfd1108340e479bc8bb7611deab12 /wscript
parent1f4b409d7ec0093ee9874656c96ef8f01d027583 (diff)
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
Diffstat (limited to 'wscript')
-rw-r--r--wscript15
1 files changed, 14 insertions, 1 deletions
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)