From 26bc9879f93bc5c78ad0ff7ff521c83888490877 Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Thu, 9 Feb 2012 19:00:17 +0000 Subject: [PATCH] linux: migrate linker --threads flag out of gyp (Retry of r121148 with ChromeOS excluded.) This just copies the flags used within gyp. BUG=gyp:250 Review URL: http://codereview.chromium.org/9360032 git-svn-id: http://src.chromium.org/svn/trunk/src/build@121257 4ff67af0-8c30-449e-8e8b-ad334ec8d88c --- common.gypi | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/common.gypi b/common.gypi index 60e982b65..76614d450 100644 --- a/common.gypi +++ b/common.gypi @@ -389,13 +389,18 @@ # linux_use_gold_binary: whether to use the binary checked into # third_party/gold. - # linux_use_gold_flags: whether to use build flags that rely on gold. - # On by default for x64 Linux. ['host_arch=="x64"', { 'linux_use_gold_binary%': 1, - 'linux_use_gold_flags%': 1, }, { 'linux_use_gold_binary%': 0, + }], + + # linux_use_gold_flags: whether to use build flags that rely on gold. + # On by default for x64 Linux. Temporarily off for ChromeOS as + # it failed on a buildbot. + ['host_arch=="x64" and chromeos==0', { + 'linux_use_gold_flags%': 1, + }, { 'linux_use_gold_flags%': 0, }], @@ -2003,6 +2008,13 @@ 'cflags': ['-finstrument-functions'], }], ['linux_use_gold_flags==1', { + 'ldflags': [ + # Experimentation found that using four linking threads + # saved ~20% of link time. + # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36 + '-Wl,--threads', + '-Wl,--thread-count=4', + ], 'conditions': [ ['release_valgrind_build==0', { 'target_conditions': [