only use gold-specific flags for the target linker
The host linker might not be gold if linux_use_gold_binary==0,
eg where we have a cross toolchain with gold and we want to use
that instead of third_party/gold/gold64.
Review URL: https://chromiumcodereview.appspot.com/19541006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212823 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/build/common.gypi b/build/common.gypi
index 56bce88f0..9e133e1 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -3378,12 +3378,18 @@
],
}],
['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',
+ 'target_conditions': [
+ ['_toolset=="target"', {
+ '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
+ # Only apply this to the target linker, since the host
+ # linker might not be gold, but isn't used much anyway.
+ '-Wl,--threads',
+ '-Wl,--thread-count=4',
+ ],
+ }],
],
'conditions': [
['release_valgrind_build==0', {