This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix libBrokenLocale


Hi!

glibc build fails on ia64 with:
/usr/bin/ld: /usr/src/build/81207-ia64/BUILD/glibc-2.2.5/build-ia64-linux/locale/libBrokenLocale_pic.a(broken_cur_max.os): @gprel relocation against dynamic symbol _nl_current_LC_CTYPE

In localeinfo.h, you write:
/* XXX _nl_current_LC_CTYPE and _nl_current_LC_COLLATE were exported
   but where are they used?  */

_nl_current_LC_COLLATE seems to be unused, while _nl_current_LC_CTYPE
was used by libBrokenLocale.so.
The following should work:

2002-03-14  Jakub Jelinek  <jakub@redhat.com>

	* locale/broken_cur_max.c (__ctype_get_mb_cur_max): Use nl_langinfo.
	* locale/Versions (_nl_current_LC_COLLATE, _nl_current_LC_CTYPE):
	Remove.

--- libc/locale/broken_cur_max.c.jj	Mon Jul  9 14:59:13 2001
+++ libc/locale/broken_cur_max.c	Thu Mar 14 13:04:58 2002
@@ -44,7 +44,8 @@
 size_t
 __ctype_get_mb_cur_max (void)
 {
-  size_t correct_value = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX);
+  union locale_data_value u;
 
-  return ((size_t []) { 1, 1, 1, 2, 2, 3, 4 })[correct_value];
+  u.string = nl_langinfo (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX);
+  return ((size_t []) { 1, 1, 1, 2, 2, 3, 4 })[u.word];
 }
--- libc/locale/Versions.jj	Sun Feb  3 04:36:20 2002
+++ libc/locale/Versions	Thu Mar 14 13:06:05 2002
@@ -50,6 +50,5 @@ libc {
     # global variables
     __collate_element_hash; __collate_element_strings;
     __collate_symbol_classes; __collate_symbol_hash; __collate_symbol_strings;
-    _nl_current_LC_COLLATE; _nl_current_LC_CTYPE;
   }
 }


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]