harfbuzz vlc contrib fails to compile if native icu-config is installed
Probably not the right place to fill this bug, vlc might be better? But this is probably unique to android...
Description
cross-compiling harfbuzz fails because its configure script incorrectly detects system's icu-config
Steps to reproduce
- install icu-devtools (apparently only sid proovides icu-config script) or libicu-devel (fedora)
- run compile script
- harfbuzz fails to compile with some obscure clang cast error in ndk headers, because host system headers are used in the middle of the compilation, because icu is incorrectly detected as auto
Suggestion
I'm not sure how to pass options down to contrib script, but if we can the simplest would be to pass --with-icu=no
so autodetection doesn't kick in.
If not possible patching the configure script would work but is ugly... I probably should also open an upstream bug for that I guess, configure is nice enough to print a warning about the use of host configure tool but doesn't abort:
checking for ICU... no
checking for aarch64-linux-android-icu-config... no
checking for icu-config... icu-config
configure: WARNING: using cross tools not prefixed with host triplet
checking for ICU by using icu-config fallback... yes
Final error for reference/searchability:
In file included from hb-icu.cc:39:
In file included from /usr/include/unicode/unorm2.h:34:
In file included from /usr/include/unicode/localpointer.h:45:
In file included from /home/shared/android-sdk/ndk-bundle//toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/memory:653:
/home/shared/android-sdk/ndk-bundle//toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/typeinfo:215:14: error: cast from pointer to smaller type 'std::__type_info_implementations::__non_unique_arm_rtti_bit_impl::__type_name_t' (aka 'unsigned int') loses information
return reinterpret_cast<__type_name_t>(__v);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/shared/android-sdk/ndk-bundle//toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/c++/v1/typeinfo:221:16: error: reinterpret_cast from 'std::__type_info_implementations::__non_unique_arm_rtti_bit_impl::__type_name_t' (aka 'unsigned int') to 'size_t' (aka 'unsigned long') is not allowed
return reinterpret_cast<size_t>(__v);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1625 warnings and 7 errors generated.