r/LFS • • Oct 27 '26

cannot upgrade glibc: msgfmt has no iconv

I have a strange phenomenon while trying to follow the LFS book for my first try at updating glibc.
So far I've always rebuilt the whole system (A/B partitions) but I got curious 🙂

glibc can be compiled but install DESTDIR fails with a strange error message. I changed to the directory and tried some commands manually then:

root@lfs /sources/13.1/glibc-2.44/po # msgfmt -o /sources/13.1/glibc-2.44/build/po/ar.mo ar.po
root@lfs /sources/13.1/glibc-2.44/po # msgfmt -o /sources/13.1/glibc-2.44/build/po/en_GB.mo en_GB.po
msgfmt: Cannot convert from "ASCII" to "UTF-8". msgfmt relies on iconv(). This version was built without iconv().

So msgfmt can convert ar.mo but not en_GB.mo.
I've rebuilt gettext multiple times, even installed the latest libiconv again, ran configure again on the gettext package, but nothing works - always this infamous error message. I can see msgfmt now has a reference to libiconv.so.2 (it didn't have that previously):

root@lfs /sources/13.1/glibc-2.44/po # ldd /bin/msgfmt  
linux-vdso.so.1 (0x00007f1ccb6d0000)  
[libgettextsrc-1.0.so](http://libgettextsrc-1.0.so) => /usr/lib/libgettextsrc-1.0.so (0x00007f1ccb643000)  
[libgettextlib-1.0.so](http://libgettextlib-1.0.so) => /usr/lib/libgettextlib-1.0.so (0x00007f1ccb4d0000)  
libattr.so.1 => /usr/lib/libattr.so.1 (0x00007f1ccb4c8000)  
libacl.so.1 => /usr/lib/libacl.so.1 (0x00007f1ccb4bc000)  
libxml2.so.16 => /usr/lib/libxml2.so.16 (0x00007f1ccb335000)  
libz.so.1 => /usr/lib/libz.so.1 (0x00007f1ccb316000)  
libtextstyle.so.0 => /usr/lib/libtextstyle.so.0 (0x00007f1ccb25b000)  
libm.so.6 => /usr/lib/libm.so.6 (0x00007f1ccb168000)  
libncursesw.so.6 => /usr/lib/libncursesw.so.6 (0x00007f1ccb0ed000)  
libintl.so.8 => /usr/lib/libintl.so.8 (0x00007f1ccb0c6000)  
libc.so.6 => /usr/lib/libc.so.6 (0x00007f1ccaedf000)  
libiconv.so.2 => /usr/lib/libiconv.so.2 (0x00007f1ccadf7000)  
libicuuc.so.78 => /usr/lib/libicuuc.so.78 (0x00007f1ccabc9000)  
/lib64/ld-linux-x86-64.so.2 (0x00007f1ccb6d2000)  
libicudata.so.78 => /usr/lib/libicudata.so.78 (0x00007f1cc8c34000)  
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f1cc896d000)  
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f1cc893f000)  

I have no idea what I'm doing wrong here. Previous full installation (glibc 2.42) worked fine.

2 Upvotes

2 comments sorted by

1

u/tseeling Oct 29 '26

found it.

The configure script for gettext could not detect a working iconv although I followed the LFS book exactly for the previous 2.42 glibc version which I planned to update. It threw out error 32 at the "check for working iconv" step because it had some problems with the EUC-JP data file.

glibc 2.44 was built correctly *with* iconv support, so I boldly
installed without some of the message files. After this step I could
configure and built gettext, and this time it could detect a working
iconv. I repeated "make install" of glibc and this time it could
successfully call msgfmt on all of the input files.

So basically my previous glibc suddenly lacked some iconv support, but I
still could update to 2.44 and now it works again.

The instructions for updating a running glibc in the LFS book worked fine with make
DESTDIR and the install command for the .so files.

3

u/Due-Celery4326 Oct 27 '26

The problem likely does not lie in the compilation of glibc 2.44, but rather in how gettext msgfmt was compiled or linked to the iconv() implementation. The most critical message is msgfmt: Cannot convert from ASCII to UTF-8 msgfmt relies on iconv() This version was built without iconv() An interesting detail is that ar.po works, while en_GB.po fails this may be because the two files require different processing paths en_GB.po might necessitate a conversion that the current version of msgfmt cannot perform Verify that the glibc iconv is functional since glibc provides iconv(), it is generally unnecessary to install libiconv separately on a glibc based LFS system Run iconv --version followed by printf 'hello\n' | iconv -f ASCII -t UTF-8 If this works, it confirms that basic conversion functions correctly via the iconv executable however, it does not guarantee that msgfmt is configured correctly Check msgfmt and its associated libraries.