Skia Build fails on Android x86

128 views
Skip to first unread message

Marsh B

unread,
Sep 15, 2015, 1:12:27 PM9/15/15
to skia-discuss

The build fails after looking at a header in /usr/include. Should I have expected it to use the cross compiler headers in the NDK? 

In file included from /usr/include/stdlib.h:24:0,
                 from ../../../../third_party/externals/yasm/source/patched-yasm/tools/re2c/code.c:5:


I'm following the instructions from here:
https://skia.org/user/quick/android


I'm on UBuntu 14.04.1. 
Building for x86_64 succeeds

My target device is an Iconia One 7 with a 1.6GHz Intel Atom


Here's the full error:

marshb@marshb-VirtualBox:~/sandbox/skia$ ./platform_tools/android/bin/android_ninja -d x86
GYP_GENERATORS is "ninja-android"
Updating projects from gyp files...
ninja: Entering directory `/home/marshb/sandbox/skia/out/config/android-x86/Debug'
[138/3066] CC obj.host/third_party/externals/yasm/source/patched-yasm/tools/re2c/re2c.code.o
FAILED: cc -MMD -MF obj.host/third_party/externals/yasm/source/patched-yasm/tools/re2c/re2c.code.o.d -DSK_INTERNAL -DSK_GAMMA_APPLY_TO_A8 -DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0 -DSK_SUPPORT_GPU=1 -DSK_SUPPORT_OPENCL=0 -DSK_FORCE_DISTANCE_FIELD_TEXT=0 -DSK_BUILD_FOR_ANDROID -DSK_GAMMA_EXPONENT=1.4 -DSK_GAMMA_CONTRAST=0.0 -DSKIA_DLL -DSKIA_IMPLEMENTATION=1 -DSK_SUPPORT_LEGACY_CLIPTOLAYERFLAG -DSK_DEVELOPER=1 -I../../../../third_party/yasm/config/android -I../../../../third_party/externals/yasm/source/patched-yasm -fPIC -msse2 -mfpmath=sse -g -fno-exceptions -fstrict-aliasing -Wall -Wextra -Winit-self -Wpointer-arith -Wsign-compare -Wno-unused-parameter -m32 -Werror -fuse-ld=gold -mssse3 -std=gnu99 -w -g   -c ../../../../third_party/externals/yasm/source/patched-yasm/tools/re2c/code.c -o obj.host/third_party/externals/yasm/source/patched-yasm/tools/re2c/re2c.code.o
In file included from /usr/include/stdlib.h:24:0,
                 from ../../../../third_party/externals/yasm/source/patched-yasm/tools/re2c/code.c:5:
/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory
 #  include <sys/cdefs.h>
                         ^
compilation terminated.

[138/3066] CXX obj/third_party/externals/icu/source/common/icuuc.bytestriebuilder.o
ninja: build stopped: subcommand failed.


Marsh B

unread,
Sep 16, 2015, 1:52:41 PM9/16/15
to skia-discuss
After much digging, I figured it out.  The cross compiler is not in use; yasm is a tool used by the build process.  Yasm is being built using Linux's build environment. 

I installed this package:
sudo apt-get install libc6-dev-i386

And now it is building.

cruz...@gmail.com

unread,
Sep 16, 2015, 8:15:28 PM9/16/15
to skia-discuss
Did you by chance run the tools/install_dependencies.sh script?  This script should take care of things like this but if it isn't then it may need to be updated.

Marsh B

unread,
Sep 17, 2015, 10:15:47 AM9/17/15
to skia-discuss
I didn't run that script.  I was following the steps in the checkout & build procedure, and that script wasn't mentioned.

Tom Hudson

unread,
Sep 17, 2015, 10:19:55 AM9/17/15
to skia-d...@googlegroups.com
On Thu, Sep 17, 2015 at 10:15 AM, Marsh B <mbe...@istation.com> wrote:
I didn't run that script.  I was following the steps in the checkout & build procedure, and that script wasn't mentioned.

Huh, install_dependencies is only listed on the linux start page (https://skia.org/user/quick/linux).
I suppose when people build for Android on the core team they've *always* built on their host first so nobody noticed the missing step?

Tom Hudson

unread,
Sep 17, 2015, 11:29:41 AM9/17/15
to skia-d...@googlegroups.com
On Thu, Sep 17, 2015 at 10:15 AM, Marsh B <mbe...@istation.com> wrote:
I didn't run that script.  I was following the steps in the checkout & build procedure, and that script wasn't mentioned.

Mention of the script added in https://codereview.chromium.org/1342263004/, which should be live on https://skia.org/ in 15 minutes or so. Sorry it wasn't there before.

Tom

Marsh B

unread,
Sep 17, 2015, 12:25:42 PM9/17/15
to skia-discuss


Thanks.  Linux is my alt machine, I'm usually on Windows.  I'm using Linux specifically to build skia for Android, and I'm a novice at Android development.  It's hard to know what I don't know.  And, I don't know quite a bit :)

Tom Hudson

unread,
Sep 17, 2015, 12:30:47 PM9/17/15
to skia-d...@googlegroups.com
On Thu, Sep 17, 2015 at 12:25 PM, Marsh B <mbe...@istation.com> wrote:
Thanks.  Linux is my alt machine, I'm usually on Windows.  I'm using Linux specifically to build skia for Android, and I'm a novice at Android development.  It's hard to know what I don't know.  And, I don't know quite a bit :)

It turns out that script may not be sufficient - Hal pointed out that it's probably going to install the native compiler, and you're needing the cross-compiler?

The person who knows this area best is out today. I'll ping him when he's back in the office.
 

cruz...@gmail.com

unread,
Sep 17, 2015, 12:50:18 PM9/17/15
to skia-discuss
Marsh mentioned that the error came from building yasm for his local environment.  In that case I would think that the native dependencies were the issue and not the android toolchain.  This is only a guess though since I haven't paid attention to the yasm part of the build.

Marsh B

unread,
Sep 17, 2015, 1:10:50 PM9/17/15
to skia-discuss

This is true, the cross compiler (NDK) seems to work.  It's installed in the android toochains folder. Yasm was the one not building at first.  I'm building just fine now.
Reply all
Reply to author
Forward
0 new messages