projectNe10/Ne10

Android aarch64 NDK_ISYSROOT_PATH incorrect

Opened this issue · 1 comments

It looks like the NDK_ISYSROOT_PATH is incorrect for aarch64 builds on android. It is looking in the ANDROID_NDK_TOOLCHAIN_CROSS_PREFIX subdirectory of includes, but never in the includes directory itself.

Ubuntu 16.04 - with a barebones setup using the latest android NDK (synced 9/21/2018) and latest Ne10 on master:

export ANDROID_NDK=/home/jasper/Android/Sdk/ndk-bundle
export NE10_ANDROID_TARGET_ARCH=aarch64
export ANDROID_API_LEVEL=24
cmake -DCMAKE_TOOLCHAIN_FILE=../android/android_config.cmake ..
make

build output is as follows:

[  2%] Building C object modules/CMakeFiles/NE10.dir/__/common/NE10_mask_table.c.o
clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
In file included from /home/jasper/Ne10/common/NE10_mask_table.c:32:
In file included from /home/jasper/Ne10/common/NE10_mask_table.h:32:
/home/jasper/Ne10/inc/NE10_types.h:39:10: fatal error: 'stdio.h' file not
      found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.
modules/CMakeFiles/NE10.dir/build.make:62: recipe for target 'modules/CMakeFiles/NE10.dir/__/common/NE10_mask_table.c.o' failed
make[2]: *** [modules/CMakeFiles/NE10.dir/__/common/NE10_mask_table.c.o] Error 1
CMakeFiles/Makefile2:85: recipe for target 'modules/CMakeFiles/NE10.dir/all' failed
make[1]: *** [modules/CMakeFiles/NE10.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

here is my change to make Ne10 work locally, are both paths needed in the ISYSROOT?

--- a/android/android_config.cmake
+++ b/android/android_config.cmake

     #NDK_SYSROOT_PATH is used in compiler's '--sysroot' flags
     set(NDK_SYSROOT_PATH "$ENV{ANDROID_NDK}/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_NDK_PLATFORMS_ARCH_SUFFIX}/")
-    set(NDK_ISYSROOT_PATH "$ENV{ANDROID_NDK}/sysroot -I$ENV{ANDROID_NDK}/sysroot/usr/include/${ANDROID_NDK_TOOLCHAIN_CROSS_PREFIX}")
+    set(NDK_ISYSROOT_PATH "$ENV{ANDROID_NDK}/sysroot -I$ENV{ANDROID_NDK}/sysroot/usr/include/${ANDROID_NDK_TOOLCHAIN_CROSS_PREFIX} -I$ENV{ANDROID_NDK}/sysroot/usr/include/")
 
cojo commented

FYI this is also currently breaking armv7 builds of android on Mac OSX. If you don't apply this fix, you get a similar file not found for assert.h.