Commit 27772016 authored by noms's avatar noms Committed by Commit bot

Revert of linux: Always use (64bit) gold for linking, even on 32bit. (patchset...

Revert of linux: Always use (64bit) gold for linking, even on 32bit. (patchset #3 of https://codereview.chromium.org/503873004/)

Reason for revert:
Tentatively reverting because it made the sizes bot grumpy (http://build.chromium.org/p/chromium/buildstatus?builder=Linux&number=52715)

Original issue's description:
> linux: Always use (64bit) gold for linking, even on 32bit.
>
> All 32bit bots now have 64bit kernels and can run 64bit gold. So always use
> that.  We already require running 64bit binaries for clang, and the official
> bots already used to do this for gold.  This makes linking on 32bit bots faster,
> and simplifies our configurations.
>
> BUG=396333
> TBR=brettw
>
> Committed: https://chromium.googlesource.com/chromium/src/+/c7864673b16236a2ec3cd435bb11608cbb76c1b4

TBR=thestig@chromium.org,brettw@chromium.org,thakis@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=396333

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

Cr-Commit-Position: refs/heads/master@{#291905}
parent 7cd5e7a3
...@@ -809,9 +809,9 @@ ...@@ -809,9 +809,9 @@
# 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.
# 32-bit hosts have to be 32-bit userland with a 64-bit kernel, so that # Do not use 32-bit gold on 32-bit hosts as it runs out address space
# 64-bit gold gets used. 32-bit gold will run out of address space. # for component=static_library builds.
['OS=="linux"', { ['OS=="linux" and (target_arch=="x64" or target_arch=="arm")', {
'linux_use_bundled_gold%': 1, 'linux_use_bundled_gold%': 1,
}, { }, {
'linux_use_bundled_gold%': 0, 'linux_use_bundled_gold%': 0,
...@@ -820,7 +820,7 @@ ...@@ -820,7 +820,7 @@
# linux_use_bundled_binutils: whether to use the binary binutils # linux_use_bundled_binutils: whether to use the binary binutils
# checked into third_party/binutils. These are not multi-arch so cannot # checked into third_party/binutils. These are not multi-arch so cannot
# be used except on x86 and x86-64 (the only two architectures which # be used except on x86 and x86-64 (the only two architectures which
# are currently checked in). Force this off via GYP_DEFINES when you # are currently checke in). Force this off via GYP_DEFINES when you
# are using a custom toolchain and need to control -B in cflags. # are using a custom toolchain and need to control -B in cflags.
['OS=="linux" and (target_arch=="x64")', { ['OS=="linux" and (target_arch=="x64")', {
'linux_use_bundled_binutils%': 1, 'linux_use_bundled_binutils%': 1,
...@@ -1488,9 +1488,6 @@ ...@@ -1488,9 +1488,6 @@
}], }],
# Get binutils version so we can enable debug fission if we can. # Get binutils version so we can enable debug fission if we can.
['os_posix==1 and OS!="mac" and OS!="ios"', { ['os_posix==1 and OS!="mac" and OS!="ios"', {
# 32-bit hosts have to be 32-bit userland with a 64-bit kernel, so that
# 64-bit gold gets used. 32-bit gold will run out of address space.
'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
'conditions': [ 'conditions': [
# compiler_version doesn't work with clang # compiler_version doesn't work with clang
# TODO(mithro): Land https://codereview.chromium.org/199793014/ so # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
...@@ -1504,6 +1501,12 @@ ...@@ -1504,6 +1501,12 @@
['OS=="android"', { ['OS=="android"', {
'binutils_version%': 222, 'binutils_version%': 222,
}], }],
['host_arch=="x64"', {
'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
}],
['host_arch=="ia32"', {
'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
}],
# Our version of binutils in third_party/binutils # Our version of binutils in third_party/binutils
['linux_use_bundled_binutils==1', { ['linux_use_bundled_binutils==1', {
'binutils_version%': 224, 'binutils_version%': 224,
...@@ -1576,6 +1579,16 @@ ...@@ -1576,6 +1579,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"
...@@ -4191,6 +4204,20 @@ ...@@ -4191,6 +4204,20 @@
}], }],
['linux_dump_symbols==1', { ['linux_dump_symbols==1', {
'cflags': [ '-g' ], 'cflags': [ '-g' ],
'conditions': [
['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
'target_conditions': [
['_toolset=="target"', {
'ldflags': [
# 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',
],
}],
],
}],
],
}], }],
['use_allocator!="tcmalloc"', { ['use_allocator!="tcmalloc"', {
'defines': ['NO_TCMALLOC'], 'defines': ['NO_TCMALLOC'],
......
...@@ -16,7 +16,7 @@ declare_args() { ...@@ -16,7 +16,7 @@ declare_args() {
android_full_debug = false android_full_debug = false
} }
use_gold = is_linux use_gold = is_linux && cpu_arch == "x64"
# linux_use_debug_fission: whether to use split DWARF debug info # linux_use_debug_fission: whether to use split DWARF debug info
# files. This can reduce link time significantly, but is incompatible # files. This can reduce link time significantly, but is incompatible
...@@ -200,8 +200,8 @@ config("compiler") { ...@@ -200,8 +200,8 @@ config("compiler") {
] ]
} }
if (use_gold) { if (use_gold) {
# 32-bit hosts have to be 32-bit userland with a 64-bit kernel, so that # Use gold for linking on 64-bit Linux only (on 32-bit it runs out of
# 64-bit gold gets used. 32-bit gold will run out of address space. # address space, and it doesn't support cross-compiling).
gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin",
root_build_dir) root_build_dir)
ldflags += [ ldflags += [
......
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