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
This commit is contained in:
parent
1f4b409d7e
commit
d48e916ef1
13
wscript
13
wscript
@ -836,6 +836,7 @@ def options(opt):
|
|||||||
'--qm-dsp-include', type='string', action='store',
|
'--qm-dsp-include', type='string', action='store',
|
||||||
dest='qm_dsp_include', default='/usr/include/qm-dsp',
|
dest='qm_dsp_include', default='/usr/include/qm-dsp',
|
||||||
help='directory where the header files of qm-dsp can be found')
|
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:
|
for i in children:
|
||||||
opt.recurse(i)
|
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_CORECRAPPITA'] = any('coreaudio' in b for b in backends)
|
||||||
conf.env['BUILD_PULSEAUDIO'] = any('pulseaudio' 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']:
|
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")
|
print("PortAudio Backend is not for Linux")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
if sys.platform != 'darwin' and conf.env['BUILD_CORECRAPPITA']:
|
if sys.platform != 'darwin' and conf.env['BUILD_CORECRAPPITA']:
|
||||||
print("Coreaudio backend is only available for OSX")
|
print("Coreaudio backend is only available for OSX")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user