编译Android源码7.1.2出错:
Starting build with ninja
ninja: Entering directory `.'
[ 0% 34/46696] Yacc: checkpolicy <= external/selinux/checkpolicy/policy_parse.y
FAILED: /bin/bash -c "prebuilts/misc/linux-x86/bison/bison -d -v --defines=out/host/linux-x86/obj/EXECUTABLES/checkpolicy_intermediates/policy_parse.h -o out/host/linux-x86/obj/EXECUTABLES/checkpolicy_intermediates/policy_parse.c external/selinux/checkpolicy/policy_parse.y"
/bin/bash: prebuilts/misc/linux-x86/bison/bison: No such file or directory
[ 0% 34/46696] Lex: checkpolicy <= external/selinux/checkpolicy/policy_scan.l
FAILED: /bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/host/linux-x86/obj/EXECUTABLES/checkpolicy_intermediates/policy_scan.c external/selinux/checkpolicy/policy_scan.l"
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.
Aborted (core dumped)
[ 0% 34/46696] Lex: checkpolicy <= external/selinux/libsepol/cil/src/cil_lexer.l
FAILED: /bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -oout/host/linux-x86/obj/STATIC_LIBRARIES/libsepol_intermediates/cil/src/cil_lexer.c external/selinux/libsepol/cil/src/cil_lexer.l"
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.
Aborted (core dumped)
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
修复:
在build/envsetup.sh脚本中最后添加
export LC_ALL=C