Merge pull request #11611 from fcobos/lto_jobs

Reduce gcc lto build time by telling the linker to use the number of jobs indicated by -j

[ci skip]
This commit is contained in:
Rémi Verschelde 2017-09-26 17:18:40 +02:00 committed by GitHub
commit 7119858ce6
2 changed files with 8 additions and 2 deletions

View file

@ -265,7 +265,10 @@ def configure(env):
if env['use_lto']:
env.Append(CCFLAGS=['-flto'])
env.Append(LINKFLAGS=['-flto'])
if not env['use_llvm'] and env.GetOption("num_jobs") > 1:
env.Append(LINKFLAGS=['-flto=' + str(env.GetOption("num_jobs"))])
else:
env.Append(LINKFLAGS=['-flto'])
## Compile flags

View file

@ -120,7 +120,10 @@ def configure(env):
if env['use_lto']:
env.Append(CCFLAGS=['-flto'])
env.Append(LINKFLAGS=['-flto'])
if not env['use_llvm'] and env.GetOption("num_jobs") > 1:
env.Append(LINKFLAGS=['-flto=' + str(env.GetOption("num_jobs"))])
else:
env.Append(LINKFLAGS=['-flto'])
if not env['use_llvm']:
env['RANLIB'] = 'gcc-ranlib'
env['AR'] = 'gcc-ar'