This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Fix PR other/23541 and other/26507


It's a regression present in all 4.x compilers on SPARC64/Solaris.

libintl is miscompiled by these compilers because of a bad interaction between 
<locale.h> and "libintl.h" which causes some prototypes not to be declared by 
the latter if the order of inclusion is not the right one.  Since the plaform 
is LP64 big-endian, this is fatal for functions returning pointers.  As a 
result, GCC 4.0.x and GCC 4.1.x cannot compile themselves and GCC 4.2 cannot 
even bootstrap.

It turns out that the fix has been sitting in the official gettext repository 
for more than 3 years!

Bootstrapped on sparc64-sun-solaris, applied to all branches as obvious.


2006-09-13  Eric Botcazou  <ebotcazou@libertysurf.fr>

	PR other/23541
	PR other/26507
	Backport from gettext repository:

	2003-09-04  Bruno Haible  <bruno@clisp.org>
	* dgettext.c: Include <locale.h> after gettextP.h, not before. This
	ensures that libintl_dcgettext is correctly declared on Solaris.
	(Needed because Solaris <locale.h> includes libintl.h.)
	* dngettext.c: Likewise, for the libintl_dcngettext declaration.


-- 
Eric Botcazou
Index: dngettext.c
===================================================================
RCS file: /sources/gettext/gettext/gettext-runtime/intl/dngettext.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- dngettext.c	13 Feb 2003 20:35:43 -0000	1.1
+++ dngettext.c	4 Sep 2003 20:58:51 -0000	1.2
@@ -1,5 +1,5 @@
 /* Implementation of the dngettext(3) function.
-   Copyright (C) 1995-1997, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU Library General Public License as published
@@ -20,9 +20,10 @@
 # include <config.h>
 #endif
 
+#include "gettextP.h"
+
 #include <locale.h>
 
-#include "gettextP.h"
 #ifdef _LIBC
 # include <libintl.h>
 #else
Index: dgettext.c
===================================================================
RCS file: /sources/gettext/gettext/gettext-runtime/intl/dgettext.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- dgettext.c	13 Feb 2003 20:35:27 -0000	1.1
+++ dgettext.c	4 Sep 2003 20:58:51 -0000	1.2
@@ -1,5 +1,5 @@
 /* Implementation of the dgettext(3) function.
-   Copyright (C) 1995-1997, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU Library General Public License as published
@@ -20,9 +20,10 @@
 # include <config.h>
 #endif
 
+#include "gettextP.h"
+
 #include <locale.h>
 
-#include "gettextP.h"
 #ifdef _LIBC
 # include <libintl.h>
 #else

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