Disable gold linker by default

The bundled gold (third_party/gold) does not work on Ubuntu 64bit server.

Did some benchmarking on some systems: the build is around 1% faster,
which is not significant.

"gold" tool will still be pulled in using gclient. It can be enabled via
GYP_DEFINES flag:
GYP_DEFINES="linux_use_gold_binary=1 linux_use_gold_flags=1" gclient runhooks

Issue: 7

Change-Id: Ic5a83368e0e475280f6722ddbd3f5cead2276712
This commit is contained in:
KongQun Yang 2015-02-12 12:42:03 -08:00
parent daac38db98
commit 35e033b838
1 changed files with 6 additions and 5 deletions

View File

@ -58,14 +58,15 @@ if __name__ == '__main__':
args.extend(['-I' + os.path.join(src_dir, 'build', 'common.gypi')])
# Set these default GYP_DEFINES if user does not set the value explicitly.
_DEFAULT_DEFINES = {"test_isolation_mode" : "noop", "use_glib" : 0,
"use_openssl" : 1, "use_x11" : 0}
_DEFAULT_DEFINES = {'test_isolation_mode': 'noop', 'use_glib': 0,
'use_openssl': 1, 'use_x11': 0,
'linux_use_gold_binary': 0, 'linux_use_gold_flags': 0}
gyp_defines = (os.environ['GYP_DEFINES'] if os.environ.get('GYP_DEFINES')
else "")
else '')
for key in _DEFAULT_DEFINES:
if key not in gyp_defines:
gyp_defines += " {0}={1}".format(key, _DEFAULT_DEFINES[key])
gyp_defines += ' {0}={1}'.format(key, _DEFAULT_DEFINES[key])
os.environ['GYP_DEFINES'] = gyp_defines.strip()
# There shouldn't be a circular dependency relationship between .gyp files,
@ -88,7 +89,7 @@ if __name__ == '__main__':
output_dir = os.path.join(checkout_dir, 'out')
gyp_generator_flags = 'output_dir="' + output_dir + '"'
if os.environ.get('GYP_GENERATOR_FLAGS'):
os.environ['GYP_GENERATOR_FLAGS'] += " " + gyp_generator_flags
os.environ['GYP_GENERATOR_FLAGS'] += ' ' + gyp_generator_flags
else:
os.environ['GYP_GENERATOR_FLAGS'] = gyp_generator_flags