Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docker] uClibc fails on configuration with missing en_US.UTF-8 locale #207

Closed
falaleevms opened this issue Nov 21, 2019 · 1 comment
Closed

Comments

@falaleevms
Copy link
Contributor

falaleevms commented Nov 21, 2019

Host: ubuntu:16.04 and ubuntu:18.04

+ ./build-all.sh --no-elf32 --cpu hs38 --install-dir ../INSTALL-uclibc-hs38
 PASSED run_elf em4_dmips em6_dmips 
 Checking out GIT trees ...
 Downloading external dependencies...
 START little-endian uClibc: Thu Nov 21 12:13:47 UTC 2019
 Installing in /home/auto_user/arc_gnu/toolchain/../INSTALL-uclibc-hs38
 Installing Linux headers ...
   finished configuring Linux
   finished installing Linux headers
 Building binutils ...
   configuring...
   building...
   installing...
   generating PDF documentation...
 Building gcc-stage1 ...
   configuring...
   building...
   installing...
 Installing uClibc headers ...
 ERROR: uClibc header install was not successful. Please see
        "/home/auto_user/arc_gnu/logs/uclibc-build-2019-11-21-1213.log" for details.

See uclibc-build-2019-11-21-1213.log.txt

Reporduce:

# skip following command on ru20arcgnu1
docker load -i /slowfs/ru20arcgnu1/arcoss_verification/artifacts/ubuntu-16.04-reproduce-uclibc-headers-fail.tar

docker run -it --rm ubuntu-16.04-reproduce-uclibc-headers-fail
cd $HOME
/var/release-testing/toolchain-smoketest-tarball.sh
@abrodkin abrodkin added bug component: uclibc release notes Items to mention in release notes labels Nov 22, 2019
@abrodkin abrodkin added this to the 2019.09 milestone Nov 22, 2019
@abrodkin abrodkin changed the title arc-2019.09-rc1: Linux uClibc toolchain: failed installing uClibc headers [Docker] uClibc fails on configuration with missing en_US.UTF-8 locale Nov 22, 2019
@abrodkin
Copy link
Member

uClibc with enabled support of locales uses locale installed on build host and if it's missing (en_US.UTF-8 in particular) then uClibc fails to configure that way:

install -d libubacktrace/arc
make -C extra/locale locale_headers
gcc ../../extra/locale/gen_wc8bit.c  -o ../..//extra/locale/gen_wc8bit    -Os  -D__UCLIBC_GEN_LOCALE -I../..// -DCTYPE_PACKED=1 -DDO_WIDE_CHAR=1
echo "/home/auto_user/arc_gnu/uclibc-ng/extra/locale/../../extra/locale/charmaps/ASCII.pairs" > ../..//extra/locale/codesets.txt
echo ".../uclibc-ng/extra/locale/../../extra/locale/charmaps/ISO-8859-1.pairs" >> ../..//extra/locale/codesets.txt
../..//extra/locale/gen_wc8bit `cat ../..//extra/locale/codesets.txt` > ../..//extra/locale/c8tables.h
Makefile.in:163: recipe for target '../..//extra/locale/c8tables.h' failed
make[1]: *** [../..//extra/locale/c8tables.h] Error 1
Makefile.in:185: recipe for target 'headers' failed
make: *** [headers] Error 2

This happens because on a previous step gen_wc8bit didn't create proper c8tables.h:

# ./gen_wc8bit cat codesets.txt
could not find a UTF8 locale ... please enable en_US.UTF-8

# cat ./extra/locale/c8tables.h
could not find a UTF8 locale ... please enable en_US.UTF-8

That said for successful building of uClibc toolchain one has to have locale files for en_US.UTF-8 generated on build host. For that:

  1. Make sure locale source files and utilities are installed. On Debian-based Linux distros apt-get install locales.
  2. Generate en_US.UTF-8 files with:
# sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
# locale-gen

Note typically normally installed desktop and server Linux distros have that locale generated, but in case of containers it might be missing. And Ubuntu containers do miss it so steps described above must be executed.

@abrodkin abrodkin removed the release notes Items to mention in release notes label Nov 22, 2019
falaleevms pushed a commit that referenced this issue Dec 16, 2019
python3 - glibc requires Python3 and fails on configuration step if it's
not found

locales - For building uClibc it is required to have `en_US.UTF-8`
locale installed on the build host (otherwise build fails, for details
see
#207)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants