You are not logged in.

#1 2015-08-19 17:25:51

RenatoUtsch
Member
From: Brazil
Registered: 2013-12-15
Posts: 6
Website

[SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

I followed the instructions on the wiki page, but the build failed with the following error message:

including ./system/netd/client/Android.mk ...
including ./system/netd/server/Android.mk ...
including ./system/security/keystore-engine/Android.mk ...
including ./system/security/keystore/Android.mk ...
including ./system/security/softkeymaster/Android.mk ...
including ./system/vold/Android.mk ...
including ./tools/external/fat32lib/Android.mk ...
host C++: validatekeymaps <= frameworks/base/tools/validatekeymaps/Main.cpp
host StaticLib: libinput_32 (out/host/linux-x86/obj32/STATIC_LIBRARIES/libinput_intermediates/libinput.a)
host StaticLib: libutils_32 (out/host/linux-x86/obj32/STATIC_LIBRARIES/libutils_intermediates/libutils.a)
host C: libcutils_32 <= system/core/libcutils/socket_loopback_server.c
host C: libcutils_32 <= system/core/libcutils/socket_network_client.c
host C: libcutils_32 <= system/core/libcutils/sockets.c
host C: libcutils_32 <= system/core/libcutils/ashmem-host.c
host C: libcutils_32 <= system/core/libcutils/dlmalloc_stubs.c
host C: liblog_32 <= system/core/liblog/logd_write.c
host C: liblog_32 <= system/core/liblog/logprint.c
host C: liblog_32 <= system/core/liblog/event_tag_map.c
host C: liblog_32 <= system/core/liblog/fake_log_device.c
Import includes file: out/host/linux-x86/obj32/EXECUTABLES/acp_intermediates/import_includes
host C: libhost_32 <= build/libs/host/CopyFile.c
host Java: guavalib (out/host/common/obj/JAVA_LIBRARIES/guavalib_intermediates/classes)
host C++: aidl <= frameworks/base/tools/aidl/aidl.cpp
host C++: aidl <= frameworks/base/tools/aidl/aidl_language.cpp
host C++: aidl <= frameworks/base/tools/aidl/options.cpp
host C++: aidl <= frameworks/base/tools/aidl/search_path.cpp
host C++: aidl <= frameworks/base/tools/aidl/AST.cpp
host C++: aidl <= frameworks/base/tools/aidl/Type.cpp
host C++: aidl <= frameworks/base/tools/aidl/generate_java.cpp
host C++: aidl <= frameworks/base/tools/aidl/generate_java_binder.cpp
host C++: aidl <= frameworks/base/tools/aidl/generate_java_rpc.cpp
host C++: aidl <= out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp
out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp: In function 'int yyparse()':
out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp:1947:35: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp:2091:35: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
Lex: aidl <= frameworks/base/tools/aidl/aidl_language_l.l
flex-2.5.39: loadlocale.c:131: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))' failed.
build/core/binary.mk:574: recipe for target 'out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp' failed
make: *** [out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Aborted (core dumped)
make: *** Waiting for unfinished jobs....
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

#### make failed to build some targets (01:32 (mm:ss)) ####

I actually trying building different branches (master, android-5.1.1_r13 and android-5.0.1_r1), actually downloading the entire source each time I tried a different branch. All builds stopped with the same exact error and segfault.

I couldn't find anything related to this build error on the internet. Maybe this is an incompatibility with a newer version of a package that android uses and I have to make a downgrade?

Additional info:

  • bash was used;

  • Arch Linux 64 bits (fully updated);

  • Required packages: all requested packages were installed, but when I installed gcc-multilib I was prompted to remove gcc in order to replace it with gcc-multilib;

  • Java: openjdk 1.7.0_85

  • Python: set using virtualenv2 and with a symlink to 2.7.10

  • repo init to branch android-5.0.1_r1 (and the other ones I noted above).

  • lunch invoked for the config full-eng (although trying other configs such as aosp_arm-eng had the same results)

Last edited by RenatoUtsch (2015-08-20 12:15:20)

Offline

#2 2015-08-19 18:11:00

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: [SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

RenatoUtsch wrote:
flex-2.5.39: loadlocale.c:131: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))' failed.

There are already a couple of threads in this forums discussing of similar issues, see https://bbs.archlinux.org/viewtopic.php?id=201067 and https://bbs.archlinux.org/viewtopic.php?id=200845.
By any chance do you have the [testing] repo enabled (post the content of /etc/pacman.conf)?

--edit: typo

Last edited by mauritiusdadd (2015-08-20 06:58:41)


registered linux user #588260github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#3 2015-08-19 19:24:43

RenatoUtsch
Member
From: Brazil
Registered: 2013-12-15
Posts: 6
Website

Re: [SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

Oh I had thought that it was a bug related to Android, not to arch's locale. No wonder I didn't find anything related to it.

I'll try the solutions on these topics tonight.

And no, I don't have the testing repo enabled.

@edit:

Solved the problem following what the guys at the 2nd topic said. If anyone has the same problem again, here are the instructions:

  1. export LANG="" (I did both on my user and as root, dunno if both are needed)

  2. rm /usr/lib/locale/locale-archive

  3. Add the following line to /etc/locale.conf:

    LC_COLLATE=en_US.UTF-8

    Obviously, you can change from english to your language of choice.

  4. Uncomment your language in /etc/locale.gen (don't know why but mine was commented. Maybe it was replaced in a pacman upgrade). I remember the recommendation from the wiki to only uncomment the UTF-8 versions.

  5. run locale-gen

Didn't need any downgrades or upgrades to testing, only the steps above solved this error message I was having:

loadlocale.c:131: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))' failed

Last edited by RenatoUtsch (2015-08-20 17:57:47)

Offline

#4 2015-08-21 10:10:43

justinkb
Member
Registered: 2015-08-21
Posts: 3

Re: [SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

Well, I have the exact same problem as you, but following your instructions doesn't help at all actually. Very weird issue. Do you have locales other than en_US ones uncommented in /etc/locale.gen ?

Offline

#5 2015-08-21 11:21:53

FlyingHappy
Member
From: Cincinnati, OH
Registered: 2011-04-18
Posts: 191

Re: [SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

If you add

LANG=C 

prior to your build code which for me is

LANG=C ./rom-build.sh shamu

it should run fine.

Offline

#6 2015-08-21 20:43:18

RenatoUtsch
Member
From: Brazil
Registered: 2013-12-15
Posts: 6
Website

Re: [SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

I actually add pt-BR.UTF-8 also.

This link also has another solution:
https://www.reddit.com/r/archlinux/comments/3g9dzf/

Funny is that the problem reappears if I close the terminal, it only works if I am in the same session.

Last edited by RenatoUtsch (2015-08-21 20:44:33)

Offline

#7 2015-08-27 19:57:28

luca020400
Member
Registered: 2015-03-02
Posts: 5

Re: [SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

I tried every solution but I still getting the error
flex-2.5.39: loadlocale.c:131: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))' failed.
Any clue ?

Offline

#8 2015-08-28 10:30:09

Lloir
Member
Registered: 2015-08-28
Posts: 1

Re: [SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

Perfect RenatoUtsch's fix worked fine for me. Thank you very much smile

Offline

#9 2015-09-01 08:53:05

justinkb
Member
Registered: 2015-08-21
Posts: 3

Re: [SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

If you've only got en_US locales in /etc/locale.conf, this is still problematic... To be able to build ROMs and use my desktop properly at the same time I have to actually edit the locale.conf, switch to actual console window outside X, then use tmux, and attach to that from gnome-terminal. Really a hassle but otherwise either the android compiling is broken or my desktop is half broken.

Offline

#10 2015-09-04 08:32:26

Volle
Member
From: Stuttgart, Germany
Registered: 2013-12-05
Posts: 47

Re: [SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

luca020400 wrote:

I tried every solution but I still getting the error
flex-2.5.39: loadlocale.c:131: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))' failed.
Any clue ?

yeah i too cant get this to work ... :<

Offline

#11 2015-09-05 18:52:14

luca020400
Member
Registered: 2015-03-02
Posts: 5

Re: [SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

Volle wrote:
luca020400 wrote:

I tried every solution but I still getting the error
flex-2.5.39: loadlocale.c:131: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))' failed.
Any clue ?

yeah i too cant get this to work ... :<

I hope this is going to be fixed
I switched to ubuntu because of that  .....

Offline

#12 2015-09-06 19:59:21

luca020400
Member
Registered: 2015-03-02
Posts: 5

Re: [SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

justinkb wrote:

If you've only got en_US locales in /etc/locale.conf, this is still problematic... To be able to build ROMs and use my desktop properly at the same time I have to actually edit the locale.conf, switch to actual console window outside X, then use tmux, and attach to that from gnome-terminal. Really a hassle but otherwise either the android compiling is broken or my desktop is half broken.

Thank you
Now I can build android on arch <3

EDIT : it worked one time
I'm again unable to build hmm

Last edited by luca020400 (2015-09-06 20:10:58)

Offline

#13 2015-09-07 12:06:53

luca020400
Member
Registered: 2015-03-02
Posts: 5

Re: [SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

Finally I fixed the error
I built flex from source provided by google with new glibc
New bin : http://www.mediafire.com/download/te8gg … lex-2.5.39
File path : prebuilts/misc/linux-x86/flex/flex-2.5.39

EDIT:
My fix has been merged in cm
http://review.cyanogenmod.org/#/c/108768/
Run export USE_HOST_LEX=yes at every build

Last edited by luca020400 (2015-09-07 20:37:43)

Offline

#14 2015-09-10 07:49:57

Volle
Member
From: Stuttgart, Germany
Registered: 2013-12-05
Posts: 47

Re: [SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

luca020400 wrote:

My fix has been merged in cm
http://review.cyanogenmod.org/#/c/108768/
Run export USE_HOST_LEX=yes at every build

Thanks so much, i can finally build again.
This is awesome!

Offline

#15 2015-09-10 21:33:36

mydongistiny
Member
Registered: 2015-09-10
Posts: 1

Re: [SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

deleted

Last edited by mydongistiny (2015-09-10 21:33:57)

Offline

#16 2015-10-14 15:03:42

dunkles
Member
From: Chile
Registered: 2010-04-26
Posts: 64

Re: [SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

luca020400 wrote:

Finally I fixed the error
I built flex from source provided by google with new glibc
New bin : http://www.mediafire.com/download/te8gg … lex-2.5.39
File path : prebuilts/misc/linux-x86/flex/flex-2.5.39

EDIT:
My fix has been merged in cm
http://review.cyanogenmod.org/#/c/108768/
Run export USE_HOST_LEX=yes at every build

awesome man, thanks you very much smile

Offline

#17 2015-12-29 09:48:45

danimihalca
Member
Registered: 2013-08-01
Posts: 1

Re: [SOLVED] Can't compile Android 5 on Arch Linux (problem with locale)

.

Last edited by danimihalca (2015-12-30 20:06:20)

Offline

Board footer

Powered by FluxBB