GN: support 32-bit x86 builds

Take over Ubuntu -x86- bots.

Note the change to Build-Win-MSVC-x86-Release-GN.json, which is not incidental.
We'll want target_cpu="x86" there too.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2340463008

Committed: https://skia.googlesource.com/skia/+/1949386ae00485ae92dd5608a2614b9dee417542

CQ_INCLUDE_TRYBOTS=master.client.skia.compile:Build-Ubuntu-Clang-x86-Debug-GN_Android-Trybot,Build-Ubuntu-GCC-x86-Release-Trybot

Review-Url: https://codereview.chromium.org/2340463008
This commit is contained in:
mtklein 2016-09-15 12:07:48 -07:00 committed by Commit bot
parent ab00f4222c
commit 1fbdf98d0e
7 changed files with 71 additions and 34 deletions

View File

@ -554,22 +554,26 @@ action("skia.h") {
]
}
executable("fiddle") {
include_dirs = [ "$target_gen_dir" ]
libs = []
if (is_linux) {
libs += [ "OSMesa" ]
}
if (target_cpu == "x64") {
# Our bots only have 64-bit libOSMesa installed.
# TODO: worth fixing?
executable("fiddle") {
include_dirs = [ "$target_gen_dir" ]
libs = []
if (is_linux) {
libs += [ "OSMesa" ]
}
sources = [
"src/images/SkForceLinking.cpp",
"tools/fiddle/draw.cpp",
"tools/fiddle/fiddle_main.cpp",
]
deps = [
":skia",
":skia.h",
]
sources = [
"src/images/SkForceLinking.cpp",
"tools/fiddle/draw.cpp",
"tools/fiddle/fiddle_main.cpp",
]
deps = [
":skia",
":skia.h",
]
}
}
# Targets guarded by skia_enable_tools may use //third_party freely.

View File

@ -39,6 +39,7 @@ config("debug_symbols") {
}
config("default") {
asmflags = []
cflags = [
"-O1",
"-fstrict-aliasing",
@ -77,10 +78,18 @@ config("default") {
"-march=mips32r2",
"-mdspr2",
]
} else if (current_cpu == "x86") {
asmflags += [ "-m32" ]
cflags += [
"-m32",
"-msse2",
"-mfpmath=sse",
]
ldflags += [ "-m32" ]
}
if (is_android) {
asmflags = [
asmflags += [
"--target=$ndk_target",
"-B$ndk/toolchains/$ndk_gccdir-4.9/prebuilt/$ndk_host/$ndk_target/bin",
]

View File

@ -8,12 +8,15 @@ import default_flavor
class GNFlavorUtils(default_flavor.DefaultFlavorUtils):
def supported(self):
extra_config = self.m.vars.builder_cfg.get('extra_config', '')
os = self.m.vars.builder_cfg.get('os', '')
target_arch = self.m.vars.builder_cfg.get('target_arch', '')
return any([
'SAN' in extra_config,
extra_config == 'Fast',
extra_config == 'GN',
extra_config.startswith('SK')
extra_config.startswith('SK'),
os == 'Ubuntu' and target_arch == 'x86',
])
def _run(self, title, cmd, env=None, infra_step=False):
@ -29,6 +32,7 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils):
configuration = self.m.vars.builder_cfg.get('configuration', '')
extra_config = self.m.vars.builder_cfg.get('extra_config', '')
os = self.m.vars.builder_cfg.get('os', '')
target_arch = self.m.vars.builder_cfg.get('target_arch', '')
clang_linux = str(self.m.vars.slave_dir.join('clang_linux'))
@ -65,6 +69,7 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils):
'extra_cflags': ' '.join(extra_cflags),
'extra_ldflags': ' '.join(extra_ldflags),
'sanitize': extra_config if 'SAN' in extra_config else '',
'target_cpu': 'x86' if target_arch == 'x86' else '',
}.iteritems():
if v:
args[k] = '"%s"' % v

View File

@ -121,19 +121,38 @@
},
{
"cmd": [
"make",
"most"
"[CUSTOM_/_B_WORK]/skia/bin/fetch-gn"
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"BUILDTYPE": "Debug",
"CHROME_HEADLESS": "1",
"CHROME_PATH": "[SLAVE_BUILD]/src",
"GYP_DEFINES": "skia_arch_type=x86 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86-Debug"
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "build most"
"name": "fetch-gn"
},
{
"cmd": [
"gn",
"gen",
"[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86-Debug/Debug",
"--args=cc=\"gcc\" cxx=\"g++\" target_cpu=\"x86\""
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "gn gen"
},
{
"cmd": [
"ninja",
"-C",
"[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86-Debug/Debug"
],
"cwd": "[CUSTOM_/_B_WORK]/skia",
"env": {
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]"
},
"name": "ninja"
},
{
"cmd": [

View File

@ -134,7 +134,7 @@
"gn",
"gen",
"[CUSTOM_C:\\_B_WORK]\\skia\\out\\Build-Win-MSVC-x86-Release-GN\\Release",
"--args=is_debug=false"
"--args=is_debug=false target_cpu=\"x86\""
],
"cwd": "[CUSTOM_C:\\_B_WORK]\\skia",
"env": {

View File

@ -35,7 +35,7 @@
"BUILDTYPE": "Debug",
"CHROME_HEADLESS": "1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86-Debug"
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Debug"
},
"name": "gclient setup"
},
@ -64,7 +64,7 @@
"BUILDTYPE": "Debug",
"CHROME_HEADLESS": "1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86-Debug"
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Debug"
},
"name": "gclient sync",
"~followup_annotations": [
@ -95,7 +95,7 @@
"BUILDTYPE": "Debug",
"CHROME_HEADLESS": "1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86-Debug"
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Debug"
},
"name": "gclient recurse (git config user.name)"
},
@ -115,7 +115,7 @@
"BUILDTYPE": "Debug",
"CHROME_HEADLESS": "1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86-Debug"
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Debug"
},
"name": "gclient recurse (git config user.email)"
},
@ -129,9 +129,9 @@
"BUILDTYPE": "Debug",
"CHROME_HEADLESS": "1",
"CHROME_PATH": "[SLAVE_BUILD]/src",
"GYP_DEFINES": "skia_arch_type=x86 skia_warnings_as_errors=1",
"GYP_DEFINES": "skia_arch_type=x86_64 skia_warnings_as_errors=1",
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]:RECIPE_PACKAGE_REPO[depot_tools]",
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86-Debug"
"SKIA_OUT": "[CUSTOM_/_B_WORK]/skia/out/Build-Ubuntu-GCC-x86_64-Debug"
},
"name": "build most",
"~followup_annotations": [

View File

@ -265,7 +265,7 @@ def GenTests(api):
mastername = 'client.skia.compile'
slavename = 'skiabot-win-compile-000'
buildername = 'Build-Ubuntu-GCC-x86-Debug'
buildername = 'Build-Ubuntu-GCC-x86_64-Debug'
yield (
api.test('failed_compile') +
api.properties(buildername=buildername,