diff options
-rw-r--r-- | build/common.gypi | 24 | ||||
-rwxr-xr-x | third_party/binutils/download.py | 26 |
2 files changed, 36 insertions, 14 deletions
diff --git a/build/common.gypi b/build/common.gypi index 23ea727..c0b73e7 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -729,8 +729,8 @@ # linux_use_bundled_gold: whether to use the gold linker binary checked # into third_party/binutils. Force this off via GYP_DEFINES when you # are using a custom toolchain and need to control -B in ldflags. - # Gold is not used for 32-bit linux builds as it runs out of address - # space. + # Do not use 32-bit gold on 32-bit hosts as it runs out address space + # for component=static_library builds. ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', { 'linux_use_bundled_gold%': 1, }, { @@ -1445,6 +1445,16 @@ # Omit unwind support in official release builds to save space. We # can use breakpad for these builds. 'release_unwind_tables%': 0, + + 'conditions': [ + # For official builds, use a 64-bit linker to avoid running out + # of address space. The buildbots should have a 64-bit kernel + # and a 64-bit libc installed. + ['host_arch=="ia32" and target_arch=="ia32"', { + 'linux_use_bundled_gold%': '1', + 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin', + }], + ], }], ], }], # os_posix==1 and OS!="mac" and OS!="ios" @@ -3795,16 +3805,14 @@ ['linux_dump_symbols==1', { 'cflags': [ '-g' ], 'conditions': [ - # TODO(thestig) We should not need to specify chromeos==0 here, - # but somehow ChromeOS uses gold despite linux_use_bundled_gold==0. - # http://crbug.com./360082 - ['linux_use_bundled_gold==0 and chromeos==0 and OS!="android"', { + ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', { 'target_conditions': [ ['_toolset=="target"', { 'ldflags': [ - # Workarounds for linker OOM. + # Attempt to use less memory to prevent the linker from + # running out of address space. Considering installing a + # 64-bit kernel and switching to a 64-bit linker. '-Wl,--no-keep-memory', - '-Wl,--reduce-memory-overheads', ], }], ], diff --git a/third_party/binutils/download.py b/third_party/binutils/download.py index 2891c82..b4f0f9b 100755 --- a/third_party/binutils/download.py +++ b/third_party/binutils/download.py @@ -47,17 +47,14 @@ def GetArch(): return subprocess.check_output(['python', DETECT_HOST_ARCH]).strip() -def main(args): - if not sys.platform.startswith('linux'): - return 0 - - archdir = os.path.join(BINUTILS_DIR, 'Linux_' + GetArch()) +def FetchAndExtract(arch): + archdir = os.path.join(BINUTILS_DIR, 'Linux_' + arch) tarball = os.path.join(archdir, BINUTILS_FILE) outdir = os.path.join(archdir, BINUTILS_OUT) sha1file = tarball + '.sha1' if not os.path.exists(sha1file): - print "WARNING: No binutils found for your architecture (%s)!" % GetArch() + print "WARNING: No binutils found for your architecture (%s)!" % arch return 0 checksum = ReadFile(sha1file) @@ -96,5 +93,22 @@ def main(args): return 0 +def main(args): + if not sys.platform.startswith('linux'): + return 0 + + arch = GetArch() + if arch == 'x64': + return FetchAndExtract(arch) + if arch == 'ia32': + ret = FetchAndExtract(arch) + if ret != 0: + return ret + # Fetch the x64 toolchain as well for official bots with 64-bit kernels. + return FetchAndExtract('x64') + print "Host architecture %s is not supported." % arch + return 1 + + if __name__ == '__main__': sys.exit(main(sys.argv)) |