build for Chromecast with clang

I don't think this switches to libc++... just from GCC to Clang.

Change-Id: I755464161d030668e34ab79f4a77d9807ddc8e3f
Reviewed-on: https://skia-review.googlesource.com/131520
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
Mike Klein 2018-06-01 14:25:07 -04:00 committed by Skia Commit-Bot
parent 0ba9fa0233
commit a3750b2aa0
2 changed files with 15 additions and 6 deletions

View File

@ -13,7 +13,13 @@ def compile_fn(api, checkout_root, out_dir):
toolchain_dir = api.vars.slave_dir.join('cast_toolchain', 'armv7a')
gles_dir = api.vars.slave_dir.join('chromebook_arm_gles')
extra_cflags = [
target = ['-target', 'armv7a-cros-linux-gnueabi']
sysroot = ['--sysroot',
'%s/usr/armv7a-cros-linux-gnueabi' % toolchain_dir]
extra_asmflags = target
extra_cflags = target + sysroot + [
'-I%s' % gles_dir.join('include'),
'-DMESA_EGL_NO_X11_HEADERS',
"-DSK_NO_COMMAND_BUFFER",
@ -25,17 +31,19 @@ def compile_fn(api, checkout_root, out_dir):
api.run.asset_version('cast_toolchain', skia_dir)),
]
extra_ldflags = [
extra_ldflags = target + sysroot + [
# Chromecast does not package libstdc++
'-static-libstdc++', '-static-libgcc',
'-L%s' % toolchain_dir.join('lib'),
'-fuse-ld=gold',
'-B%s/usr/libexec/gcc' % toolchain_dir,
]
quote = lambda x: '"%s"' % x
args = {
'cc': quote(toolchain_dir.join('bin','armv7a-cros-linux-gnueabi-gcc')),
'cxx': quote(toolchain_dir.join('bin','armv7a-cros-linux-gnueabi-g++')),
'ar': quote(toolchain_dir.join('bin','armv7a-cros-linux-gnueabi-ar')),
'cc': quote(toolchain_dir.join('usr', 'bin', 'clang-3.9.elf')),
'cxx': quote(toolchain_dir.join('usr', 'bin', 'clang++-3.9.elf')),
'ar': quote(toolchain_dir.join('bin','armv7a-cros-linux-gnueabi-ar')),
'target_cpu': quote(target_arch),
'skia_use_fontconfig': 'false',
'skia_enable_gpu': 'true',
@ -49,6 +57,7 @@ def compile_fn(api, checkout_root, out_dir):
if configuration != 'Debug':
args['is_debug'] = 'false'
args['extra_asmflags'] = repr(extra_asmflags).replace("'", '"')
args['extra_cflags'] = repr(extra_cflags).replace("'", '"')
args['extra_ldflags'] = repr(extra_ldflags).replace("'", '"')

View File

@ -32,7 +32,7 @@
"[START_DIR]/cache/work/skia/bin/gn",
"gen",
"[START_DIR]/cache/work/skia/out/Build-Debian9-GCC-arm-Release-Chromecast/Release",
"--args=ar=\"[START_DIR]/cast_toolchain/armv7a/bin/armv7a-cros-linux-gnueabi-ar\" cc=\"[START_DIR]/cast_toolchain/armv7a/bin/armv7a-cros-linux-gnueabi-gcc\" cxx=\"[START_DIR]/cast_toolchain/armv7a/bin/armv7a-cros-linux-gnueabi-g++\" extra_cflags=[\"-I[START_DIR]/chromebook_arm_gles/include\", \"-DMESA_EGL_NO_X11_HEADERS\", \"-DSK_NO_COMMAND_BUFFER\", \"-Wno-error=unused-function\", \"-g0\", \"-DDUMMY_cast_toolchain_version=42\"] extra_ldflags=[\"-static-libstdc++\", \"-static-libgcc\", \"-L[START_DIR]/cast_toolchain/armv7a/lib\"] is_debug=false skia_enable_gpu=true skia_use_egl=true skia_use_fontconfig=false skia_use_icu=false skia_use_system_freetype2=false target_cpu=\"arm\""
"--args=ar=\"[START_DIR]/cast_toolchain/armv7a/bin/armv7a-cros-linux-gnueabi-ar\" cc=\"[START_DIR]/cast_toolchain/armv7a/usr/bin/clang-3.9.elf\" cxx=\"[START_DIR]/cast_toolchain/armv7a/usr/bin/clang++-3.9.elf\" extra_asmflags=[\"-target\", \"armv7a-cros-linux-gnueabi\"] extra_cflags=[\"-target\", \"armv7a-cros-linux-gnueabi\", \"--sysroot\", \"[START_DIR]/cast_toolchain/armv7a/usr/armv7a-cros-linux-gnueabi\", \"-I[START_DIR]/chromebook_arm_gles/include\", \"-DMESA_EGL_NO_X11_HEADERS\", \"-DSK_NO_COMMAND_BUFFER\", \"-Wno-error=unused-function\", \"-g0\", \"-DDUMMY_cast_toolchain_version=42\"] extra_ldflags=[\"-target\", \"armv7a-cros-linux-gnueabi\", \"--sysroot\", \"[START_DIR]/cast_toolchain/armv7a/usr/armv7a-cros-linux-gnueabi\", \"-static-libstdc++\", \"-static-libgcc\", \"-L[START_DIR]/cast_toolchain/armv7a/lib\", \"-fuse-ld=gold\", \"-B[START_DIR]/cast_toolchain/armv7a/usr/libexec/gcc\"] is_debug=false skia_enable_gpu=true skia_use_egl=true skia_use_fontconfig=false skia_use_icu=false skia_use_system_freetype2=false target_cpu=\"arm\""
],
"cwd": "[START_DIR]/cache/work/skia",
"env": {