I am trying to create NDK-compatible code (which works and has been tested), but during the build process I get the following error:
[armeabi-v7a] Compile thumb : cpufeatures <= cpu-features.c
/Users/sean/Library/Android/sdk/ndk-bundle/sources/android/cpufeatures/cpu-features.c: In function 'get_elf_hwcap_from_proc_self_auxv':
/Users/sean/Library/Android/sdk/ndk-bundle/sources/android/cpufeatures/cpu-features.c:534:5: warning: implicit declaration of function 'typeof' [-Wimplicit-function-declaration]
int fd = TEMP_FAILURE_RETRY(open(filepath, O_RDONLY));
^
In file included from /Users/sean/Library/Android/sdk/ndk-bundle/platforms/android-14/arch-arm/usr/include/fcntl.h:34:0,
from /Users/sean/Library/Android/sdk/ndk-bundle/sources/android/cpufeatures/cpu-features.c:75:
/Users/sean/Library/Android/sdk/ndk-bundle/platforms/android-14/arch-arm/usr/include/unistd.h:207:18: error: expected ';' before '_rc'
typeof (exp) _rc; \
^
/Users/sean/Library/Android/sdk/ndk-bundle/sources/android/cpufeatures/cpu-features.c:534:14: note: in expansion of macro 'TEMP_FAILURE_RETRY'
int fd = TEMP_FAILURE_RETRY(open(filepath, O_RDONLY));
^
/Users/sean/Library/Android/sdk/ndk-bundle/platforms/android-14/arch-arm/usr/include/unistd.h:209:9: error: '_rc' undeclared (first use in this function)
_rc = (exp); \
^
/Users/sean/Library/Android/sdk/ndk-bundle/sources/android/cpufeatures/cpu-features.c:534:14: note: in expansion of macro 'TEMP_FAILURE_RETRY'
int fd = TEMP_FAILURE_RETRY(open(filepath, O_RDONLY));
^
/Users/sean/Library/Android/sdk/ndk-bundle/platforms/android-14/arch-arm/usr/include/unistd.h:209:9: note: each undeclared identifier is reported only once for each function it appears in
_rc = (exp); \
^
/Users/sean/Library/Android/sdk/ndk-bundle/sources/android/cpufeatures/cpu-features.c:534:14: note: in expansion of macro 'TEMP_FAILURE_RETRY'
int fd = TEMP_FAILURE_RETRY(open(filepath, O_RDONLY));
^
/Users/sean/Library/Android/sdk/ndk-bundle/platforms/android-14/arch-arm/usr/include/unistd.h:207:18: error: expected ';' before '_rc'
typeof (exp) _rc; \
^
/Users/sean/Library/Android/sdk/ndk-bundle/sources/android/cpufeatures/cpu-features.c:544:19: note: in expansion of macro 'TEMP_FAILURE_RETRY'
int ret = TEMP_FAILURE_RETRY(read(fd, (char*)&entry, sizeof entry));
^
make: *** [obj/local/armeabi-v7a/objs/cpufeatures/cpu-features.o] Error 1
I tried to configure AP_ABI for different architectures, but with more or less the same result. My local development environment is OSX, and I run it directly usingndk-clean & ndk-build
Does anyone else understand this?
source
share