On Saturday, April 19, 2008 at 21:49:42 +0200, Bruno Haible wrote: > Alain Guibert wrote: >>>>| FAIL: test-c-strcase.sh >> LC_ALL=fr_FR setlocale(LC_ALL, "") returns NULL > Weird. It looks as if some symbols from libintl (or its dependencies: > libiconv) would be affecting/overriding the behaviour of libc. Can you > look at which symbols are defined in libintl.so and libiconv.so:
Nothing special in libiconv 1.12. But there are 4 collisions between libintl.so.8.0.2 and libc.so.5.4.33: | 00031088 T _nl_expand_alias | 000302c8 T _nl_explode_name | 00030514 T _nl_make_l10nflist | 00030a04 T _nl_normalize_codeset Only -lintl -lc fails; -liconv -lc works. This NULL setlocale() problem is present with libintl.so.8 from gettext 0.15, 0.16, and 0.17; absent with libintl.so.2 or 3 from gettext 0.12.1, 0.14.1 and 0.14.4. The small test program (only printf() and setlocale(), no other functions) normally working compiled with -lc, extract from strace: | open("/usr/share/locale/locale.alias", O_RDONLY) = -1 ENOENT (No such file or directory) | open("/usr/share/i18n/locale.alias", O_RDONLY) = -1 ENOENT (No such file or directory) | open("/usr/share/locale/fr_FR/LC_MESSAGES", O_RDONLY) = 3 Same program compiled with -lintl -lc, but working, with gettext 0.12.1: | open("/usr/local/share/locale/locale.alias", O_RDONLY) = -1 ENOENT (No such file or directory) | open("/usr/share/locale/fr_FR/LC_MESSAGES", O_RDONLY) = 3 Note setlocale() was already influenced by -lintl first, as the alias file was then searched in /usr/local instead of /usr... Now same program failing with -lintl -lc gettext 0.17: | open("/usr/local/share/locale/locale.alias", O_RDONLY) = -1 ENOENT (No such file or directory) | open("/usr/share/locale/fr_FR/|", O_RDONLY) = -1 ENOENT (No such file or directory) | open("/usr/share/locale/fr/|", O_RDONLY) = -1 ENOENT (No such file or directory) The alias file is also searched in /usr/local, and the sampled category is "|" (!?), obviously not found. >>>>| test-snprintf.c:61: assertion failed >>>>| FAIL: test-snprintf > You can test whether the attemted workaround actually works by using > this test dir: http://www.haible.de/bruno/gnu/testdirs.tar.gz Excellent, thank you. testdir1 all OK: | checking whether snprintf is declared... yes | checking for snprintf... yes | checking whether snprintf respects a size of 1... no | PASS: test-snprintf But testdir2 fails: | checking whether vsnprintf is declared... yes | checking for vsnprintf... yes | checking whether snprintf respects a size of 1... no | ./configure: test: =: unary operator expected | test-vsnprintf.c:75: assertion failed | FAIL: test-vsnprintf I think that is due to a typo, one lacking "v" in testdir2/glm4/vsnprintf.m4. The attached vsn.patch fixes it, then all tests PASS (appart the error gltests/test-stdint.c:249: two `l's in integer constant). >>>>| test-wcwidth.c:45: assertion failed >>>>| FAIL: test-wcwidth >> wcwidth(32)=-1, and the same for all ASCII characters. > And iswprint(32) = ? And isprint(32) = ? libc iswprint(x)=0 for *all* possible x. isprint(x)=1, for all ASCII except 0-31 and 127, and behaviour above 128 correctly follows the locale. Alain.
--- testdir2/glm4/vsnprintf.m4 Sat Apr 19 19:05:10 2008 +++ testdir2.mod/glm4/vsnprintf.m4 Mon Apr 21 13:35:19 2008 @@ -17,7 +17,7 @@ ;; esac fi - if test $gl_cv_func_snprintf_usable = no; then + if test $gl_cv_func_vsnprintf_usable = no; then gl_REPLACE_VSNPRINTF fi AC_CHECK_DECLS_ONCE([vsnprintf])