Hello
When I try to build libiconv for Android, using Android NDK r25b, it fails with following error:
In file included from .././../src/1.17-e2a53830aa.clean/srclib/canonicalize-lgpl.c:28:
In file included from ./stdlib.h:36:
In file included from /home/alexey/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/local/include/stdlib.h:31:
In file included from /home/alexey/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/stdlib.h:34:
In file included from /home/alexey/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/malloc.h:30:
In file included from ./stdio.h:43:
In file included from /home/alexey/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/stdio.h:376:
/home/alexey/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/bits/fortify/stdio.h:53:53: error: use of undeclared identifier '__USE_FORTIFY_LEVEL'
return __builtin___vsnprintf_chk(dest, size, 0, __bos(dest), format, ap);
^
.././../src/1.17-e2a53830aa.clean/srclib/cdefs.h:144:48: note: expanded from macro '__bos'
#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
^
I assume that the cause of error is that libiconv uses its own copy of cdefs.h from glibc instead of the one present in Android NDK, and it's incompatible with other NDK headers.
Does libiconv only support glibc?