Skip to content

Android build is failing because of localeconv #327

Description

@dpantele

Locale support added the following issue with the android build:

/tmp/asdk/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -MMD -MP -MF ./obj/local/armeabi-v7a/objs-debug/hello-jni/hello-jni.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fno-exceptions -fno-rtti -mthumb -Os -g -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -O0 -UNDEBUG -marm -fno-omit-frame-pointer -I/tmp/asdk/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include -I/tmp/asdk/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -I/tmp/asdk/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -Ijni/../../fmt-3.0.0 -Ijni -DANDROID  -Wa,--noexecstack -Wformat -Werror=format-security  -fexceptions     -I/tmp/asdk/android-ndk-r10e/platforms/android-19/arch-arm/usr/include -c  jni/hello-jni.cpp -o ./obj/local/armeabi-v7a/objs-debug/hello-jni/hello-jni.o 
In file included from jni/hello-jni.cpp:19:0:
jni/../../fmt-3.0.0/fmt/format.h: In member function 'void fmt::BasicWriter<Char>::write_int(T, Spec)':
jni/../../fmt-3.0.0/fmt/format.h:2756:45: error: 'struct lconv' has no member named 'thousands_sep'
     fmt::StringRef sep = std::localeconv()->thousands_sep;

The problem is that in some implementation the lconv structed is just stubbed:

#if 1 /* MISSING FROM BIONIC - DEFINED TO MAKE libstdc++-v3 happy */
struct lconv { };
struct lconv *localeconv(void);
#endif /* MISSING */

However, c++ api exists, and everything compiles after the patch: https://gist.github.com/dpantele/d2e2aec8ff23b0208245c8a6e882f7fe

A haven't checked if it works though, because I am not an android dev.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions