(in Fedora 31) building AOSP 9 - flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data: failed
# 错误
flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data: Assertion 'cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
/bin/sh: line 1: 58421 Aborted (core dumped) /mnt/android/Android-x86---pie-x86---9.0-rc1/prebuilts/misc/linux-x86/flex/flex-2.5.39 -oscripts/kconfig/zconf.lex.c -L /mnt/android/Android-x86---pie-x86---9.0-rc1/kernel/scripts/kconfig/zconf.l
# 解决
rm prebuilts/misc/linux-x86/flex/flex-2.5.39
ln -s /usr/bin/flex prebuilts/misc/linux-x86/flex/flex-2.5.39
# 根据上面修改,又出现如下错误。 解决方法:rebuild the included flex,如下步骤
out/soong/.intermediates/frameworks/compile/mclinker/lib/Script/libmcldScript/android_x86_64_core_static/gen/lex/frameworks/compile/mclinker/lib/Script/ScriptScanner.cpp:1487:8: error: member reference type 'std::istream *' (aka 'basic_istream<char> *') is a pointer; did you mean to use '->'?
yyin.rdbuf(std::cin.rdbuf());
out/soong/.intermediates/frameworks/compile/mclinker/lib/Script/libmcldScript/android_x86_64_core_static/gen/lex/frameworks/compile/mclinker/lib/Script/ScriptScanner.cpp:1490:9: error: member reference type 'std::ostream *' (aka 'basic_ostream<char> *') is a pointer; did you mean to use '->'?
yyout.rdbuf(std::cout.rdbuf());
# 接着,rm prebuilts/misc/linux-x86/flex/flex-2.5.39
# rebuild the included flex
cd prebuilts/misc/linux-x86/flex
rm flex-2.5.39
tar zxf flex-2.5.39.tar.gz
cd flex-2.5.39
./configure
make
mv flex ..
cd ..
rm flex-2.5.39 -rf
mv flex flex-2.5.39
cd /mnt/android/Android-x86---pie-x86---9.0-rc1
m -j12 iso_img