Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#7561 - [gcc-4.2.0-5] libstdc++ uses generic locale model

Attached to Project: Arch Linux
Opened by Rulatir (Rulatir) - Wednesday, 04 July 2007, 16:07 GMT
Last edited by Jan de Groot (JGC) - Wednesday, 04 July 2007, 21:56 GMT
Task Type Bug Report
Category Packages: Current
Status Closed
Assigned To No-one
Architecture i686
Severity High
Priority Normal
Reported Version 2007.05 Duke
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

After upgrade to gcc-4.2.0-5, libstdc++ uses the generic locale model which only supports "C" and "POSIX" locales. This causes std::locale loc("") to throw, among other things.

NOTE WELL: Even though --enable-clocale=gnu is requested, configure falls back to generic:

checking for C locale to use... generic

This is most likely caused by this configure quirk introduced in 4.2:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32254

If I understand it correctly, configure will fallback to generic if the locale "de_DE" is not installed on the *building machine*.
   ltest.cc (0.5 KiB)
This task depends upon

Closed by  Jan de Groot (JGC)
Wednesday, 04 July 2007, 21:56 GMT
Reason for closing:  Fixed
Additional comments about closing:  Please update to gcc 4.2.1-1 (which is actually the RC for 4.2.1 released an hour ago)
Comment by Rulatir (Rulatir) - Wednesday, 04 July 2007, 16:09 GMT
Sorry, the attachment is irrelevant. I clicked "Remove" and it seemed to work but didn't.
Comment by Rulatir (Rulatir) - Wednesday, 04 July 2007, 17:27 GMT
DOH! Won't be that easy. The problem is still present when gcc package is remade on a machine where the "de_DE" locale is installed, even though the standard library now happily configures with the gnu locale model:

$ cat makepkg.log | grep checking\ for\ C\ locale
checking for C locale to use... gnu

The attached ltest (build with g++ -lstdc++ -o ltest ltest.cc) outputs this for installed locales:

$ ./ltest `locale -a`
"C": OK
"POSIX": OK
"de_DE": ERROR:
locale::facet::_S_create_c_locale name not valid
"de_DE.iso88591": ERROR:
locale::facet::_S_create_c_locale name not valid
"de_DE.iso885915@euro": ERROR:
locale::facet::_S_create_c_locale name not valid
"de_DE@euro": ERROR:
locale::facet::_S_create_c_locale name not valid
"deutsch": ERROR:
locale::facet::_S_create_c_locale name not valid
"en_US": ERROR:
locale::facet::_S_create_c_locale name not valid
"en_US.iso88591": ERROR:
locale::facet::_S_create_c_locale name not valid
"en_US.utf8": ERROR:
locale::facet::_S_create_c_locale name not valid
"german": ERROR:
locale::facet::_S_create_c_locale name not valid
"pl_PL": ERROR:
locale::facet::_S_create_c_locale name not valid
"pl_PL.iso88592": ERROR:
locale::facet::_S_create_c_locale name not valid
"pl_PL.utf8": ERROR:
locale::facet::_S_create_c_locale name not valid
"polish": ERROR:
locale::facet::_S_create_c_locale name not valid

Debugging machine code for locale::facet::_S_create_c_locale gives the impression that the generic version is called regardless. Very puzzling!

Downgrading to gcc-4.2.0-2 fixes the problem for me:

$ ./ltest `locale -a`
"C": OK
"POSIX": OK
"de_DE": OK
"de_DE.iso88591": OK
"de_DE.iso885915@euro": OK
"de_DE@euro": OK
"deutsch": OK
"en_US": OK
"en_US.iso88591": OK
"en_US.utf8": OK
"german": OK
"pl_PL": OK
"pl_PL.iso88592": OK
"pl_PL.utf8": OK
"polish": OK

Comment by Jan de Groot (JGC) - Wednesday, 04 July 2007, 19:49 GMT
Works here:
[jan@laptop ~]$ ./test `locale -a`
"C": OK
"POSIX": OK
"de_DE.utf8": OK
"en_US.utf8": OK
[jan@laptop ~]$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/usr --enable-shared --enable-languages=c,c++,objc --enable-threads=posix --enable-__cxa_atexit --disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch --with-tune=generic
Thread model: posix
gcc version 4.2.1 20070704 (prerelease)

Loading...