[infra] Update chromebook toolchain to support c++17
My hope is that with Bazel, we will be able to remove this CIPD package in favor of a properly maintained/created toolchain. Change-Id: I6a7b5013da22395511d828bee857777fbe0bcd8c Bug: skia:12878 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502289 Reviewed-by: John Stiles <johnstiles@google.com>
This commit is contained in:
parent
3034776433
commit
e5a9059acf
@ -1,9 +1,6 @@
|
||||
ARM (hard float) sysroot for cross-compiling c++ code on a x86_64 Linux bot.
|
||||
ARM (hard float) sysroot for cross-compiling c++ code on an x86_64 Linux bot.
|
||||
|
||||
Run create_and_upload which installs the following debian packages and turns them
|
||||
into a toolchain:
|
||||
Run create_and_upload which installs some debian packages and turns them into a toolchain.
|
||||
|
||||
libstdc++-4.8-dev-armhf-cross libgcc-4.8-dev-armhf-cross binutils-arm-linux-gnueabihf
|
||||
|
||||
Take a peak at `/usr/arm-linux-gnueabihf/include/c++/4.8.X` - you may need to update the
|
||||
include paths if that number changed from the previous release (currently 4.8.4).
|
||||
This has been updated in the past when moving up in supported C++ versions (e.g. to c++14, and
|
||||
then again to c++17).
|
||||
|
@ -1 +1 @@
|
||||
7
|
||||
10
|
@ -17,44 +17,37 @@ import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from distutils import dir_util
|
||||
|
||||
|
||||
def create_asset(target_dir):
|
||||
"""Create the asset."""
|
||||
|
||||
print("Installing some cross-compiling packages. Hit enter to continue.")
|
||||
input()
|
||||
print("Installing some cross-compiling packages. You may be asked for your sudo password")
|
||||
subprocess.check_call([
|
||||
"sudo","apt-get","install",
|
||||
"libstdc++-6-dev-armhf-cross",
|
||||
"libgcc-6-dev-armhf-cross",
|
||||
"libstdc++-10-dev-armhf-cross",
|
||||
"libgcc-10-dev-armhf-cross",
|
||||
"binutils-arm-linux-gnueabihf"
|
||||
])
|
||||
|
||||
|
||||
# shutil complains if the target directory exists already.
|
||||
shutil.rmtree(target_dir)
|
||||
shutil.copytree('/usr/arm-linux-gnueabihf', target_dir)
|
||||
shutil.copytree('/usr/lib/gcc-cross/arm-linux-gnueabihf/6',
|
||||
shutil.copytree('/usr/lib/gcc-cross/arm-linux-gnueabihf/10',
|
||||
os.path.join(target_dir, 'gcc-cross'))
|
||||
|
||||
# Libs needed to link:
|
||||
shutil.copy('/usr/lib/x86_64-linux-gnu/libbfd-2.28-armhf.so',
|
||||
# Libs needed to link. These were found by trial-and-error.
|
||||
shutil.copy('/usr/lib/x86_64-linux-gnu/libbfd-2.37-armhf.so',
|
||||
os.path.join(target_dir, 'lib'))
|
||||
shutil.copy('/usr/lib/x86_64-linux-gnu/libopcodes-2.28-armhf.so',
|
||||
shutil.copy('/usr/lib/x86_64-linux-gnu/libopcodes-2.37-armhf.so',
|
||||
os.path.join(target_dir, 'lib'))
|
||||
shutil.copy('/usr/lib/x86_64-linux-gnu/libctf-armhf.so.0',
|
||||
os.path.join(target_dir, 'lib'))
|
||||
|
||||
# The file paths in libpthread.so and libc.so start off as absolute file
|
||||
# The file paths in libc.so start off as absolute file
|
||||
# paths (e.g. /usr/arm-linux-gnueabihf/lib/libpthread.so.0), which won't
|
||||
# work on the bots. We use fileinput to replace just those lines (which
|
||||
# start with GROUP). fileinput redirects stdout, so printing here actually
|
||||
# writes to the file.
|
||||
bad_libpthread = os.path.join(target_dir, "lib", "libpthread.so")
|
||||
for line in fileinput.input(bad_libpthread, inplace=True):
|
||||
if line.startswith("GROUP"):
|
||||
print("GROUP ( libpthread.so.0 libpthread_nonshared.a )")
|
||||
else:
|
||||
print(line)
|
||||
|
||||
bad_libc = os.path.join(target_dir, "lib", "libc.so")
|
||||
for line in fileinput.input(bad_libc, inplace=True):
|
||||
if line.startswith("GROUP"):
|
||||
|
@ -47,8 +47,8 @@ def compile_fn(api, checkout_root, out_dir):
|
||||
'--sysroot=%s' % sysroot_dir,
|
||||
'-I%s' % os.path.join(gl_dir, 'include'),
|
||||
'-I%s' % os.path.join(sysroot_dir, 'include'),
|
||||
'-I%s' % os.path.join(sysroot_dir, 'include', 'c++', '6'),
|
||||
'-I%s' % os.path.join(sysroot_dir, 'include', 'c++', '6', 'arm-linux-gnueabihf'),
|
||||
'-I%s' % os.path.join(sysroot_dir, 'include', 'c++', '10'),
|
||||
'-I%s' % os.path.join(sysroot_dir, 'include', 'c++', '10', 'arm-linux-gnueabihf'),
|
||||
'-DMESA_EGL_NO_X11_HEADERS',
|
||||
'-U_GLIBCXX_DEBUG',
|
||||
]
|
||||
|
@ -37,7 +37,7 @@
|
||||
"[START_DIR]/cache/work/skia/bin/gn",
|
||||
"gen",
|
||||
"[START_DIR]/cache/work/skia/out/Build-Debian10-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++/6\",\"-I[START_DIR]/armhf_sysroot/include/c++/6/arm-linux-gnueabihf\",\"-DMESA_EGL_NO_X11_HEADERS\",\"-U_GLIBCXX_DEBUG\",\"-DREBUILD_IF_CHANGED_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"
|
||||
"--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++/10\",\"-I[START_DIR]/armhf_sysroot/include/c++/10/arm-linux-gnueabihf\",\"-DMESA_EGL_NO_X11_HEADERS\",\"-U_GLIBCXX_DEBUG\",\"-DREBUILD_IF_CHANGED_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": {
|
||||
|
@ -3275,7 +3275,7 @@
|
||||
{
|
||||
"name": "skia/bots/armhf_sysroot",
|
||||
"path": "armhf_sysroot",
|
||||
"version": "version:7"
|
||||
"version": "version:10"
|
||||
},
|
||||
{
|
||||
"name": "skia/bots/chromebook_arm_gles",
|
||||
@ -3669,7 +3669,7 @@
|
||||
{
|
||||
"name": "skia/bots/armhf_sysroot",
|
||||
"path": "armhf_sysroot",
|
||||
"version": "version:7"
|
||||
"version": "version:10"
|
||||
},
|
||||
{
|
||||
"name": "skia/bots/chromebook_arm_gles",
|
||||
|
Loading…
Reference in New Issue
Block a user