test for c++17 w/ c++14 stdlib

Apparently some of our stdlibs are not even quite c++11 compliant.

Bug: skia:9700
Change-Id: I842c2dd2eba55d576aa60b2b3a4734dbace00f6b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259074
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
Mike Klein 2019-12-10 08:58:52 -06:00 committed by Skia Commit-Bot
parent ae834f5781
commit 1bb7e2378d
6 changed files with 20 additions and 22 deletions

View File

@ -1 +1 @@
3
7

View File

@ -26,22 +26,21 @@ def create_asset(target_dir):
raw_input()
subprocess.check_call([
"sudo","apt-get","install",
"libstdc++-4.8-dev-armhf-cross",
"libgcc-4.8-dev-armhf-cross",
"libstdc++-6-dev-armhf-cross",
"libgcc-6-dev-armhf-cross",
"binutils-arm-linux-gnueabihf"
])
shutil.copytree('/usr/arm-linux-gnueabihf', target_dir)
shutil.copytree('/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8.4',
shutil.copytree('/usr/lib/gcc-cross/arm-linux-gnueabihf/6',
os.path.join(target_dir, 'gcc-cross'))
# copy_tree allows copying into a dir that exists
# We need to augment the toolchain with some lib*.so that help ld
# do its magic as well as some includes that may be useful.
dir_util.copy_tree('/usr/x86_64-linux-gnu/arm-linux-gnueabihf/lib',
# Libs needed to link:
shutil.copy('/usr/lib/x86_64-linux-gnu/libbfd-2.28-armhf.so',
os.path.join(target_dir, 'lib'))
shutil.copy('/usr/lib/x86_64-linux-gnu/libopcodes-2.28-armhf.so',
os.path.join(target_dir, 'lib'))
dir_util.copy_tree('/usr/x86_64-linux-gnu/arm-linux-gnueabihf/include',
os.path.join(target_dir, 'include'))
# The file paths in libpthread.so and libc.so start off as absolute file
# paths (e.g. /usr/arm-linux-gnueabihf/lib/libpthread.so.0), which won't

View File

@ -31,9 +31,8 @@ def compile_fn(api, checkout_root, out_dir):
'--sysroot=%s' % sysroot_dir,
'-I%s' % gl_dir.join('include'),
'-I%s' % sysroot_dir.join('include'),
'-I%s' % sysroot_dir.join('include', 'c++', '4.8.4'),
'-I%s' % sysroot_dir.join('include', 'c++', '4.8.4',
'arm-linux-gnueabihf'),
'-I%s' % sysroot_dir.join('include', 'c++', '6'),
'-I%s' % sysroot_dir.join('include', 'c++', '6', 'arm-linux-gnueabihf'),
'-DMESA_EGL_NO_X11_HEADERS',
'-U_GLIBCXX_DEBUG',
]
@ -41,6 +40,7 @@ def compile_fn(api, checkout_root, out_dir):
extra_ldflags = [
'--target=armv7a-linux-gnueabihf',
'--sysroot=%s' % sysroot_dir,
'-static-libstdc++', '-static-libgcc',
# use sysroot's ld which can properly link things.
'-B%s' % sysroot_dir.join('bin'),
# helps locate crt*.o
@ -49,8 +49,6 @@ def compile_fn(api, checkout_root, out_dir):
'-L%s' % sysroot_dir.join('gcc-cross'),
'-L%s' % sysroot_dir.join('lib'),
'-L%s' % gl_dir.join('lib'),
# Explicitly do not use lld for cross compiling like this - I observed
# failures like "Unrecognized reloc 41" and couldn't find out why.
]
else:
gl_dir = api.vars.slave_dir.join('chromebook_x86_64_gles')

View File

@ -37,7 +37,7 @@
"[START_DIR]/cache/work/skia/bin/gn",
"gen",
"[START_DIR]/cache/work/skia/out/Build-Debian9-Clang-arm-Release-Chromebook_GLES/Release",
"--args=cc=\"[START_DIR]/clang_linux/bin/clang\" cxx=\"[START_DIR]/clang_linux/bin/clang++\" extra_asmflags=[\"--target=armv7a-linux-gnueabihf\", \"--sysroot=[START_DIR]/armhf_sysroot\", \"-march=armv7-a\", \"-mfpu=neon\", \"-mthumb\"] extra_cflags=[\"--target=armv7a-linux-gnueabihf\", \"--sysroot=[START_DIR]/armhf_sysroot\", \"-I[START_DIR]/chromebook_arm_gles/include\", \"-I[START_DIR]/armhf_sysroot/include\", \"-I[START_DIR]/armhf_sysroot/include/c++/4.8.4\", \"-I[START_DIR]/armhf_sysroot/include/c++/4.8.4/arm-linux-gnueabihf\", \"-DMESA_EGL_NO_X11_HEADERS\", \"-U_GLIBCXX_DEBUG\", \"-DDUMMY_clang_linux_version=42\"] extra_ldflags=[\"--target=armv7a-linux-gnueabihf\", \"--sysroot=[START_DIR]/armhf_sysroot\", \"-B[START_DIR]/armhf_sysroot/bin\", \"-B[START_DIR]/armhf_sysroot/gcc-cross\", \"-L[START_DIR]/armhf_sysroot/gcc-cross\", \"-L[START_DIR]/armhf_sysroot/lib\", \"-L[START_DIR]/chromebook_arm_gles/lib\"] is_debug=false skia_use_egl=true skia_use_fontconfig=false skia_use_system_freetype2=false target_cpu=\"arm\" werror=true"
"--args=cc=\"[START_DIR]/clang_linux/bin/clang\" cxx=\"[START_DIR]/clang_linux/bin/clang++\" extra_asmflags=[\"--target=armv7a-linux-gnueabihf\", \"--sysroot=[START_DIR]/armhf_sysroot\", \"-march=armv7-a\", \"-mfpu=neon\", \"-mthumb\"] extra_cflags=[\"--target=armv7a-linux-gnueabihf\", \"--sysroot=[START_DIR]/armhf_sysroot\", \"-I[START_DIR]/chromebook_arm_gles/include\", \"-I[START_DIR]/armhf_sysroot/include\", \"-I[START_DIR]/armhf_sysroot/include/c++/6\", \"-I[START_DIR]/armhf_sysroot/include/c++/6/arm-linux-gnueabihf\", \"-DMESA_EGL_NO_X11_HEADERS\", \"-U_GLIBCXX_DEBUG\", \"-DDUMMY_clang_linux_version=42\"] extra_ldflags=[\"--target=armv7a-linux-gnueabihf\", \"--sysroot=[START_DIR]/armhf_sysroot\", \"-static-libstdc++\", \"-static-libgcc\", \"-B[START_DIR]/armhf_sysroot/bin\", \"-B[START_DIR]/armhf_sysroot/gcc-cross\", \"-L[START_DIR]/armhf_sysroot/gcc-cross\", \"-L[START_DIR]/armhf_sysroot/lib\", \"-L[START_DIR]/chromebook_arm_gles/lib\"] is_debug=false skia_use_egl=true skia_use_fontconfig=false skia_use_system_freetype2=false target_cpu=\"arm\" werror=true"
],
"cwd": "[START_DIR]/cache/work/skia",
"env": {

View File

@ -4031,7 +4031,7 @@
{
"name": "skia/bots/armhf_sysroot",
"path": "armhf_sysroot",
"version": "version:3"
"version": "version:7"
},
{
"name": "skia/bots/chromebook_arm_gles",
@ -4529,7 +4529,7 @@
{
"name": "skia/bots/armhf_sysroot",
"path": "armhf_sysroot",
"version": "version:3"
"version": "version:7"
},
{
"name": "skia/bots/chromebook_arm_gles",

View File

@ -54,8 +54,9 @@
#define RETURN_ON_NULL(ptr) do { if (nullptr == (ptr)) return; } while (0)
#define RETURN_ON_FALSE(pred) do { if (!(pred)) return; } while (0)
// This is a test: static_assert with no message is a c++17 feature.
static_assert(true);
// This is a test: static_assert with no message is a c++17 feature,
// and std::max() is constexpr only since the c++14 stdlib.
static_assert(std::max(3,4) == 4);
///////////////////////////////////////////////////////////////////////////////////////////////////