From 35e033b83837146814c09d60100b5b1bf004fffc Mon Sep 17 00:00:00 2001 From: KongQun Yang Date: Thu, 12 Feb 2015 12:42:03 -0800 Subject: [PATCH] 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 --- gyp_packager.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gyp_packager.py b/gyp_packager.py index ea5e2a018f..e8b68aa4ce 100755 --- a/gyp_packager.py +++ b/gyp_packager.py @@ -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