so I'm trying to figure out how to build ICU for android. Initially I tryed to make it with standalone tool-chain, and after some battles I was able to do that at least for x86_64 arch (didn't try with others). However I don't want to have fully custom build system so I decide to figure out how to make it with prebuild toolchains. And I found that it's behave very different - which is very strange. So this was my command when I actually try to configure ICU with standalone tool-chain:
icu/source/configure --disable-shared --enable-static --disable-dyload --disable-extras --disable-tests --disable-samples --prefix=/icu/build --host=x86_64-linux-android --with-cross-build=/toplay/icu/icu_linux CC=/custom_toolchain/bin/clang CXX=/custom_toolchain/bin/clang++ LD=/custom_toolchain/bin/x86_64-linux-android-ld AR=/custom_toolchain/bin/x86_64-linux-android-ar CFLAGS="-fPIC -DANDROID -fdata-sections -ffunction-sections" CXXFLAGS="-fPIC -DANDROID -frtti -fno-exceptions -fdata-sections -ffunction-sections"
So, having all the same command, but only changing compilers and tools from prebuild toolchain which will look like:
icu/source/configure --disable-shared --enable-static --disable-dyload --disable-extras --disable-tests --disable-samples --prefix=/icu/build --host=x86_64-linux-android --with-cross-build=/toplay/icu/icu_linux CC=/ndk-bundle/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/clang CXX=/ndk-bundle/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/clang++ LD=/ndk-bundle/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/x86_64-linux-android-ld AR=/ndk-bundle/toolchains/x86_64-4.9/prebuilt/linux-x86_64//bin/x86_64-linux-android-ar CFLAGS="-fPIC -DANDROID -fdata-sections -ffunction-sections" CXXFLAGS="-fPIC -DANDROID -frtti -fno-exceptions -fdata-sections -ffunction-sections"
I get very different configure step results. Which I placed there: (TLDR: main diff: in prebuild tool-chain case system can't understand that it's cross-compile mode, it's find nl_langinfo
, strtod_l
which isn't available in android) And if standalone tool-chain initially could build ICU, in prebuild case build process eventually broke.
So my question: what is the difference between compilers and tools in prebuild and standalone case and what flags/settings I need to add to make it work in prebuild case?
configure
from arch-specific directories, e.g. fromobj/local/armeabi-v7a/objs/icu
, and then I can perform it as one step of the globalndk-build
. See an example here: stackoverflow.com/a/42964186/192373 – Alex Cohn