aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-09-01 15:51:03 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-01 15:51:03 -0700
commit795423198ba883393a56196c6ea4481efabba311 (patch)
treef79b600b98984c1188ad514fa53a552f5cb5c94f
parentd592a4e5343a61a0dfc307bc59284bb24554a8d7 (diff)
GN: Build and link with LLD when using our Clang toolchain.
I am hoping this makes it easier to get *SAN bots going. Today we're generating a libcompiler_rt.a that's using a relocation type that the ld on the bots doesn't know about. This lld is will know about anything our Clang generates. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2301273002 Review-Url: https://codereview.chromium.org/2301273002
-rw-r--r--infra/bots/assets/clang_linux/VERSION2
-rwxr-xr-xinfra/bots/assets/clang_linux/create.py1
-rw-r--r--infra/bots/recipe_modules/flavor/gn_flavor.py3
-rw-r--r--infra/bots/recipes/swarm_compile.expected/Build-Mac-Clang-x86_64-Release-GN.json2
-rw-r--r--infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-x86_64-Debug-GN.json2
-rw-r--r--infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-GCC-x86_64-Debug-GN.json2
-rw-r--r--infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-GCC-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json2
-rw-r--r--infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-GCC-x86_64-Release-Fast.json2
-rw-r--r--infra/bots/recipes/swarm_compile.expected/Build-Win-MSVC-x86-Release-GN.json2
9 files changed, 11 insertions, 7 deletions
diff --git a/infra/bots/assets/clang_linux/VERSION b/infra/bots/assets/clang_linux/VERSION
index d8263ee986..e440e5c842 100644
--- a/infra/bots/assets/clang_linux/VERSION
+++ b/infra/bots/assets/clang_linux/VERSION
@@ -1 +1 @@
-2 \ No newline at end of file
+3 \ No newline at end of file
diff --git a/infra/bots/assets/clang_linux/create.py b/infra/bots/assets/clang_linux/create.py
index c72261693c..ace0d6c957 100755
--- a/infra/bots/assets/clang_linux/create.py
+++ b/infra/bots/assets/clang_linux/create.py
@@ -22,6 +22,7 @@ def create_asset(target_dir):
subprocess.check_call(["git", "clone", "-b", BRANCH, REPO + "llvm"])
os.chdir("llvm/tools")
subprocess.check_call(["git", "clone", "-b", BRANCH, REPO + "clang"])
+ subprocess.check_call(["git", "clone", "-b", BRANCH, REPO + "lld"])
os.chdir("../projects")
subprocess.check_call(["git", "clone", "-b", BRANCH, REPO + "compiler-rt"])
subprocess.check_call(["git", "clone", "-b", BRANCH, REPO + "libcxx"])
diff --git a/infra/bots/recipe_modules/flavor/gn_flavor.py b/infra/bots/recipe_modules/flavor/gn_flavor.py
index f759d4bcc4..31b4756be0 100644
--- a/infra/bots/recipe_modules/flavor/gn_flavor.py
+++ b/infra/bots/recipe_modules/flavor/gn_flavor.py
@@ -29,10 +29,12 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils):
cc, cxx = 'cc', 'c++'
extra_cflags = []
+ extra_ldflags = []
if compiler == 'Clang' and os == 'Ubuntu':
cc = self.m.vars.slave_dir.join('clang_linux', 'bin', 'clang')
cxx = self.m.vars.slave_dir.join('clang_linux', 'bin', 'clang++')
+ extra_ldflags.append('-fuse-ld=lld')
elif compiler == 'Clang':
cc, cxx = 'clang', 'clang++'
elif compiler == 'GCC':
@@ -57,6 +59,7 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils):
'cxx': quote(cxx),
'compiler_prefix': quote(compiler_prefix),
'extra_cflags': quote(' '.join(extra_cflags)),
+ 'extra_ldflags': quote(' '.join(extra_ldflags)),
'is_debug': 'true' if configuration == 'Debug' else 'false',
}.iteritems()))
diff --git a/infra/bots/recipes/swarm_compile.expected/Build-Mac-Clang-x86_64-Release-GN.json b/infra/bots/recipes/swarm_compile.expected/Build-Mac-Clang-x86_64-Release-GN.json
index c915a06c1f..4a3179594d 100644
--- a/infra/bots/recipes/swarm_compile.expected/Build-Mac-Clang-x86_64-Release-GN.json
+++ b/infra/bots/recipes/swarm_compile.expected/Build-Mac-Clang-x86_64-Release-GN.json
@@ -121,7 +121,7 @@
"gn",
"gen",
"[CUSTOM_/_B_WORK]/skia/out/Build-Mac-Clang-x86_64-Release-GN/Release",
- "--args=cc=\"clang\" compiler_prefix=\"/usr/bin/ccache\" cxx=\"clang++\" extra_cflags=\"-Qunused-arguments\" is_debug=false"
+ "--args=cc=\"clang\" compiler_prefix=\"/usr/bin/ccache\" cxx=\"clang++\" extra_cflags=\"-Qunused-arguments\" extra_ldflags=\"\" is_debug=false"
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
diff --git a/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-x86_64-Debug-GN.json b/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-x86_64-Debug-GN.json
index bf05e3706c..c0873c9a31 100644
--- a/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-x86_64-Debug-GN.json
+++ b/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-Clang-x86_64-Debug-GN.json
@@ -121,7 +121,7 @@
"gn",
"gen",
"[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-Clang-x86_64-Debug-GN/Debug",
- "--args=cc=\"[SLAVE_BUILD]/clang_linux/bin/clang\" compiler_prefix=\"/usr/bin/ccache\" cxx=\"[SLAVE_BUILD]/clang_linux/bin/clang++\" extra_cflags=\"-Qunused-arguments\" is_debug=true"
+ "--args=cc=\"[SLAVE_BUILD]/clang_linux/bin/clang\" compiler_prefix=\"/usr/bin/ccache\" cxx=\"[SLAVE_BUILD]/clang_linux/bin/clang++\" extra_cflags=\"-Qunused-arguments\" extra_ldflags=\"-fuse-ld=lld\" is_debug=true"
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
diff --git a/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-GCC-x86_64-Debug-GN.json b/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-GCC-x86_64-Debug-GN.json
index 394f452c71..475e99fb9e 100644
--- a/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-GCC-x86_64-Debug-GN.json
+++ b/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-GCC-x86_64-Debug-GN.json
@@ -121,7 +121,7 @@
"gn",
"gen",
"[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Debug-GN/Debug",
- "--args=cc=\"gcc\" compiler_prefix=\"/usr/bin/ccache\" cxx=\"g++\" extra_cflags=\"\" is_debug=true"
+ "--args=cc=\"gcc\" compiler_prefix=\"/usr/bin/ccache\" cxx=\"g++\" extra_cflags=\"\" extra_ldflags=\"\" is_debug=true"
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
diff --git a/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-GCC-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json b/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-GCC-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json
index c232daa715..8e28246007 100644
--- a/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-GCC-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json
+++ b/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-GCC-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json
@@ -119,7 +119,7 @@
"gn",
"gen",
"[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE/Debug",
- "--args=cc=\"gcc\" compiler_prefix=\"\" cxx=\"g++\" extra_cflags=\"-DSK_USE_DISCARDABLE_SCALEDIMAGECACHE\" is_debug=true"
+ "--args=cc=\"gcc\" compiler_prefix=\"\" cxx=\"g++\" extra_cflags=\"-DSK_USE_DISCARDABLE_SCALEDIMAGECACHE\" extra_ldflags=\"\" is_debug=true"
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
diff --git a/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-GCC-x86_64-Release-Fast.json b/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-GCC-x86_64-Release-Fast.json
index 5780ec6483..203c25e18d 100644
--- a/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-GCC-x86_64-Release-Fast.json
+++ b/infra/bots/recipes/swarm_compile.expected/Build-Ubuntu-GCC-x86_64-Release-Fast.json
@@ -119,7 +119,7 @@
"gn",
"gen",
"[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Release-Fast/Release",
- "--args=cc=\"gcc\" compiler_prefix=\"\" cxx=\"g++\" extra_cflags=\"-march=native -fomit-frame-pointer -O3\" is_debug=false"
+ "--args=cc=\"gcc\" compiler_prefix=\"\" cxx=\"g++\" extra_cflags=\"-march=native -fomit-frame-pointer -O3\" extra_ldflags=\"\" is_debug=false"
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
diff --git a/infra/bots/recipes/swarm_compile.expected/Build-Win-MSVC-x86-Release-GN.json b/infra/bots/recipes/swarm_compile.expected/Build-Win-MSVC-x86-Release-GN.json
index 3408d76c16..97ae427471 100644
--- a/infra/bots/recipes/swarm_compile.expected/Build-Win-MSVC-x86-Release-GN.json
+++ b/infra/bots/recipes/swarm_compile.expected/Build-Win-MSVC-x86-Release-GN.json
@@ -89,7 +89,7 @@
"gn",
"gen",
"[CUSTOM_C:\\_B_WORK]\\skia\\out\\Build-Win-MSVC-x86-Release-GN\\Release",
- "--args=cc=\"cc\" compiler_prefix=\"\" cxx=\"c++\" extra_cflags=\"\" is_debug=false"
+ "--args=cc=\"cc\" compiler_prefix=\"\" cxx=\"c++\" extra_cflags=\"\" extra_ldflags=\"\" is_debug=false"
],
"cwd": "[CUSTOM_C:\\_B_WORK]\\skia",
"env": {