Looking at Android NDK r12, I see that there are differences in the header files under the / android platforms - {API level} / {arch} / usr / include / sys. For API levels 19 and below, exec_elf.h exists, but appears to have been deleted after that. There are a number of other differences in which files were added or removed, but I'm interested in exec_elf.h because it defines a specific macro:
#define ELF64_ST_INFO(b,t) (((b) << 4) + ((t) & 0xf))
This macro is used at the ICU source, and my cross-compiled ICU build fails if I use the toolchain with the target API set to something after 19. The build failed with these errors:
arm-linux-androideabi-clang ... icu/source/tools/toolutil/pkg_genc.c
icu/source/tools/toolutil/pkg_genc.c:869:13: warning: implicit declaration of function 'ELF64_ST_INFO' is invalid in C99 [-Wimplicit-function-declaration]
ELF64_ST_INFO(STB_GLOBAL, STT_OBJECT),
^
icu/source/tools/toolutil/pkg_genc.c:869:13: error: initializer element is not a compile-time constant
ELF64_ST_INFO(STB_GLOBAL, STT_OBJECT),
^~~~~~~~~~~~~~~~~~~
icu/source/tools/toolutil/pkg_genc.c:987:13: error: initializer element is not a compile-time constant
ELF64_ST_INFO(STB_GLOBAL, STT_OBJECT),
The compilation line is as follows:
android-toolchain/bin/arm-linux-androideabi-clang -D_REENTRANT -DU_HAVE_ELF_H=1 \
-DU_HAVE_ATOMIC=1 -Iicu/source/common -Iicu/source/i18n \
-DU_BUILD="x86_64-apple-darwin15.2.0" -DU_HOST="arm-unknown-linux-androideabi" \
-DU_CC="android-toolchain/bin/arm-linux-androideabi-clang" \
-DU_CXX="android-toolchain/bin/arm-linux-androideabi-clang++" \
-DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit \
-DU_ATTRIBUTE_DEPRECATED= -DU_TOOLUTIL_IMPLEMENTATION -O3 -O2 -pipe -fsigned-char \
-fPIC -D__ANDROID__ -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -std=c99 \
-Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -c \
-DPIC -fPIC -o pkg_genc.o icu/source/tools/toolutil/pkg_genc.c
, , ELF64_ST_INFO pkg_genc.c, , Android . - , API? , NDK?