public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix libBrokenLocale
@ 2002-03-14 10:12 Jakub Jelinek
  2002-03-14 12:08 ` Jakub Jelinek
  2002-03-14 12:47 ` Ulrich Drepper
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Jelinek @ 2002-03-14 10:12 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix libBrokenLocale
  2002-03-14 10:12 [PATCH] Fix libBrokenLocale Jakub Jelinek
@ 2002-03-14 12:08 ` Jakub Jelinek
  2002-03-14 12:47 ` Ulrich Drepper
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Jelinek @ 2002-03-14 12:08 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

On Thu, Mar 14, 2002 at 07:12:32PM +0100, Jakub Jelinek wrote:
> --- 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);

I obviously meant to write:
  u.string = nl_langinfo (_NL_CTYPE_MB_CUR_MAX);
here. Sorry.

	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix libBrokenLocale
  2002-03-14 10:12 [PATCH] Fix libBrokenLocale Jakub Jelinek
  2002-03-14 12:08 ` Jakub Jelinek
@ 2002-03-14 12:47 ` Ulrich Drepper
  1 sibling, 0 replies; 3+ messages in thread
From: Ulrich Drepper @ 2002-03-14 12:47 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

On Thu, 2002-03-14 at 10:12, Jakub Jelinek wrote:

> 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.

I've applied this one as well.  Thanks,

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-03-14 20:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-14 10:12 [PATCH] Fix libBrokenLocale Jakub Jelinek
2002-03-14 12:08 ` Jakub Jelinek
2002-03-14 12:47 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).