Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not build on Android ARM #12

Closed
sdroege opened this issue Sep 25, 2014 · 5 comments
Closed

Does not build on Android ARM #12

sdroege opened this issue Sep 25, 2014 · 5 comments

Comments

@sdroege
Copy link

sdroege commented Sep 25, 2014

It unconditionally uses NEON it seems. Not all Android devices have NEON so we need to compile it in conditionally and detect at runtime.

libtool: compile: arm-linux-androideabi-gcc -fuse-ld=gold -DHAVE_CONFIG_H -I. -DGRAPHENE_COMPILATION=1 -DG_LOG_DOMAIN="Graphene" -I../src -I../src -DGRAPHENE_ENABLE_DEBUG --sysroot=/home/jenkins/workspace/cerbero-android/workdir/android-ndk-r9d/platforms/android-9/arch-arm -I/home/jenkins/workspace/cerbero-android/workdir/android-ndk-r9d/platforms/android-9/arch-arm/usr/include -DANDROID -DPIC -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -O3 -ffast-math -fstrict-aliasing -I/home/jenkins/workspace/cerbero-android/workdir/dist/android_arm/include/glib-2.0 -I/home/jenkins/workspace/cerbero-android/workdir/dist/android_arm/lib/glib-2.0/include -fvisibility=hidden -I/home/jenkins/workspace/cerbero-android/workdir/dist/android_arm/include/glib-2.0 -I/home/jenkins/workspace/cerbero-android/workdir/dist/android_arm/lib/glib-2.0/include -Wall -Wshadow -Wstrict-aliasing=2 -Wno-uninitialized -Wcast-align -Wstrict-prototypes -Werror=logical-op -Werror=pointer-arith -Werror=missing-declarations -Werror=redundant-decls -Werror=implicit-function-declaration -Werror=format=2 -Werror=missing-include-dirs -Werror=init-self -Werror=empty-body -Werror=declaration-after-statement -mfpu=neon -Wall -g -Os --sysroot=/home/jenkins/workspace/cerbero-android/workdir/android-ndk-r9d/platforms/android-9/arch-arm -I/home/jenkins/workspace/cerbero-android/workdir/android-ndk-r9d/platforms/android-9/arch-arm/usr/include -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -fPIC -mthumb -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -march=armv5te -mtune=xscale -msoft-float -DANDROID -DPIC -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wa,--noexecstack -g -MT libgraphene_1_0_la-graphene-point.lo -MD -MP -MF .deps/libgraphene_1_0_la-graphene-point.Tpo -c graphene-point.c -fPIC -DPIC -o .libs/libgraphene_1_0_la-graphene-point.o
graphene-alloc.c: In function 'graphene_alloc':
In file included from graphene-config.h:38:0,
from graphene-types.h:32,
from graphene-matrix.h:27,
from graphene-matrix.c:35:
/home/jenkins/workspace/cerbero-android/workdir/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.8/include/arm_neon.h:32:2: error: #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
#error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h

@ebassi ebassi added this to the 1.0 milestone Sep 25, 2014
@ebassi
Copy link
Owner

ebassi commented Sep 25, 2014

I only tested ARM builds by cross-compiling with the GNU EABI toolchain.

I don't have an Android environment, and setting one up is going to probably take me more time than I am able to devote to such a task. a patch to enable NEON flags on Android would be very welcome.

@ebassi
Copy link
Owner

ebassi commented Sep 25, 2014

just to check, you can use the NEON_CFLAGS variable to specify -mfloat-abi=softfp -mfpu=neon when configuring, and see if that fixes it.

I can push a patch that blindly adds -mfloat-abi=softfp to the fallback NEON_CFLAGS in case the canonical host is Android as well.

ebassi added a commit that referenced this issue Sep 25, 2014
It seems that Android requires `-mfloat-abi=softfp -mfpu=neon` in the
compilation flags in order to use the NEON instructions, even if the
configure time check passes with `-mfpu=neon` alone.

[#12]
@ebassi
Copy link
Owner

ebassi commented Sep 25, 2014

there's also the option of reworking the configure.ac check to use intrinsics instead of the NEON assembly, so that we can rely on the check doing the right thing.

@ebassi ebassi modified the milestones: 1.2, 1.0 Oct 21, 2014
ebassi added a commit that referenced this issue Oct 22, 2014
build: Add -mfloat-abi=softfp on Android
@ebassi
Copy link
Owner

ebassi commented Oct 22, 2014

merged the issues/12 branch; let's see what happens.

@ebassi ebassi closed this as completed Oct 22, 2014
@sdroege
Copy link
Author

sdroege commented Mar 7, 2015

Works now, thanks 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants