aboutsummaryrefslogtreecommitdiffhomepage
path: root/site
diff options
context:
space:
mode:
authorGravatar Kevin Lubick <kjlubick@google.com>2017-11-02 12:28:34 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-02 16:34:41 +0000
commit8be4a33005e6c3fc4f634e792e88558123823709 (patch)
treebb9fd394abbaa7eda7d4f5f77b79cbc2bda9a587 /site
parent5eb9b707138fd99c5e14b0d84366aa24be619083 (diff)
Add instructions for building Skia for Chromebooks
No-Try: true Docs-Preview: https://skia.org/?cl=66561 Bug: skia: Change-Id: Ie4d74eea74a48b5177daefc45498bf67334daf2f Reviewed-on: https://skia-review.googlesource.com/66561 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Kevin Lubick <kjlubick@google.com>
Diffstat (limited to 'site')
-rw-r--r--site/user/build.md91
1 files changed, 91 insertions, 0 deletions
diff --git a/site/user/build.md b/site/user/build.md
index bfcb18a7c3..2715c2867a 100644
--- a/site/user/build.md
+++ b/site/user/build.md
@@ -101,6 +101,97 @@ and run it as normal. You may find `bin/droid` convenient.
adb push resources /data/local/tmp
adb shell "cd /data/local/tmp; ./dm --src gm --config gl"
+
+ChromeOS
+--------------
+To cross-compile Skia for arm ChromeOS devices the following is needed:
+
+ - Clang 4 or newer
+ - An armhf sysroot
+ - The (E)GL lib files on the arm chromebook to link against.
+
+To compile Skia for an x86 ChromeOS device, one only needs Clang and the lib files.
+
+If you have access to CIPD, you can fetch all of these as follows:
+
+ python infra/bots/assets/clang_linux/download.py -t /opt/clang
+ python infra/bots/assets/armhf_sysroot/download.py -t /opt/armhf_sysroot
+ python infra/bots/assets/chromebook_arm_gles/download.py -t /opt/chromebook_arm_gles
+ python infra/bots/assets/chromebook_x86_64_gles/download.py -t /opt/chromebook_x86_64_gles
+
+If you don't have authorization to use those assets, then see the README.md files for
+[armhf_sysroot](https://skia.googlesource.com/skia/+/master/infra/bots/assets/armhf_sysroot/README.md),
+[chromebook_arm_gles](https://skia.googlesource.com/skia/+/master/infra/bots/assets/chromebook_arm_gles/README.md), and
+[chromebook_x86_64_gles](https://skia.googlesource.com/skia/+/master/infra/bots/assets/chromebook_x86_64_gles/README.md)
+for instructions on creating those assets.
+
+Once those files are in place, generate the GN args that resemble the following:
+
+ #ARM
+ cc= "/opt/clang/bin/clang"
+ cxx = "/opt/clang/bin/clang++"
+
+ extra_asmflags = [
+ "--target=armv7a-linux-gnueabihf",
+ "--sysroot=/opt/armhf_sysroot/",
+ "-march=armv7-a",
+ "-mfpu=neon",
+ "-mthumb",
+ ]
+ extra_cflags=[
+ "--target=armv7a-linux-gnueabihf",
+ "--sysroot=/opt/armhf_sysroot",
+ "-I/opt/chromebook_arm_gles/include",
+ "-I/opt/armhf_sysroot/include/",
+ "-I/opt/armhf_sysroot/include/c++/4.8.4/",
+ "-I/opt/armhf_sysroot/include/c++/4.8.4/arm-linux-gnueabihf/",
+ "-DMESA_EGL_NO_X11_HEADERS",
+ "-funwind-tables",
+ ]
+ extra_ldflags=[
+ "--sysroot=/opt/armhf_sysroot",
+ "-B/opt/armhf_sysroot/bin",
+ "-B/opt/armhf_sysroot/gcc-cross",
+ "-L/opt/armhf_sysroot/gcc-cross",
+ "-L/opt/armhf_sysroot/lib",
+ "-L/opt/chromebook_arm_gles/lib",
+ "--target=armv7a-linux-gnueabihf",
+ ]
+ target_cpu="arm"
+ skia_use_fontconfig = false
+ skia_use_system_freetype2 = false
+ skia_use_egl = true
+
+
+ # x86_64
+ cc= "/opt/clang/bin/clang"
+ cxx = "/opt/clang/bin/clang++"
+ extra_cflags=[
+ "-I/opt/clang/include/c++/v1/",
+ "-I/opt/chromebook_x86_64_gles/include",
+ "-DMESA_EGL_NO_X11_HEADERS",
+ "-DEGL_NO_IMAGE_EXTERNAL",
+ ]
+ extra_ldflags=[
+ "-stdlib=libc++",
+ "-fuse-ld=lld",
+ "-L/opt/chromebook_x86_64_gles/lib",
+ ]
+ target_cpu="x64"
+ skia_use_fontconfig = false
+ skia_use_system_freetype2 = false
+ skia_use_egl = true
+
+Compile dm (or another executable of your choice) with ninja, as per usual.
+
+Push the binary to a chromebook via ssh and [run dm as normal](https://skia.org/dev/testing/tests)
+using the gles GPU config.
+
+Most chromebooks by default have their home directory partition marked as noexec.
+To avoid "permission denied" errors, remember to run something like:
+
+ sudo mount -i -o remount,exec /home/chronos
+
Mac
---