Commit ac296392 authored by thestig@chromium.org's avatar thestig@chromium.org

Linux: Switch 32-bit official builds to use the bundled 64-bit linker.

It is assumed that even though the buildbots have 32-bit userland,
they also have a 64-bit kernel and a 64-bit libc installed.

BUG=366523

Review URL: https://codereview.chromium.org/255023003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266729 0039d316-1c4b-4281-b951-d872f2087c98
parent b71e2501
...@@ -729,8 +729,8 @@ ...@@ -729,8 +729,8 @@
# linux_use_bundled_gold: whether to use the gold linker binary checked # linux_use_bundled_gold: whether to use the gold linker binary checked
# into third_party/binutils. Force this off via GYP_DEFINES when you # into third_party/binutils. Force this off via GYP_DEFINES when you
# are using a custom toolchain and need to control -B in ldflags. # 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 # Do not use 32-bit gold on 32-bit hosts as it runs out address space
# space. # for component=static_library builds.
['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', { ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
'linux_use_bundled_gold%': 1, 'linux_use_bundled_gold%': 1,
}, { }, {
...@@ -1445,6 +1445,16 @@ ...@@ -1445,6 +1445,16 @@
# Omit unwind support in official release builds to save space. We # Omit unwind support in official release builds to save space. We
# can use breakpad for these builds. # can use breakpad for these builds.
'release_unwind_tables%': 0, '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" }], # os_posix==1 and OS!="mac" and OS!="ios"
...@@ -3795,16 +3805,14 @@ ...@@ -3795,16 +3805,14 @@
['linux_dump_symbols==1', { ['linux_dump_symbols==1', {
'cflags': [ '-g' ], 'cflags': [ '-g' ],
'conditions': [ 'conditions': [
# TODO(thestig) We should not need to specify chromeos==0 here, ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
# 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"', {
'target_conditions': [ 'target_conditions': [
['_toolset=="target"', { ['_toolset=="target"', {
'ldflags': [ '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,--no-keep-memory',
'-Wl,--reduce-memory-overheads',
], ],
}], }],
], ],
......
...@@ -47,17 +47,14 @@ def GetArch(): ...@@ -47,17 +47,14 @@ def GetArch():
return subprocess.check_output(['python', DETECT_HOST_ARCH]).strip() return subprocess.check_output(['python', DETECT_HOST_ARCH]).strip()
def main(args): def FetchAndExtract(arch):
if not sys.platform.startswith('linux'): archdir = os.path.join(BINUTILS_DIR, 'Linux_' + arch)
return 0
archdir = os.path.join(BINUTILS_DIR, 'Linux_' + GetArch())
tarball = os.path.join(archdir, BINUTILS_FILE) tarball = os.path.join(archdir, BINUTILS_FILE)
outdir = os.path.join(archdir, BINUTILS_OUT) outdir = os.path.join(archdir, BINUTILS_OUT)
sha1file = tarball + '.sha1' sha1file = tarball + '.sha1'
if not os.path.exists(sha1file): 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 return 0
checksum = ReadFile(sha1file) checksum = ReadFile(sha1file)
...@@ -96,5 +93,22 @@ def main(args): ...@@ -96,5 +93,22 @@ def main(args):
return 0 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__': if __name__ == '__main__':
sys.exit(main(sys.argv)) sys.exit(main(sys.argv))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment