diff mbox

Fix Tru64 UNIX Ada bootstrap

Message ID yddty9xul4g.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Aug. 4, 2011, 5:44 p.m. UTC
Arnaud,

>> Fixed as follows, bootstrap is well beyond the failure now.
>> 
>> Ok for mainline?
>
> OK, thanks.

unfortunately, it turned out that this fix only works when compiling
ada/init.c inside gcc, not for gnatlib where CONST_CAST* isn't defined.
I need the following patch instead, which is also simpler for using
CONST_CAST, not CONST_CAST2, and provides a CONST_CAST definition in
tsystem.h, where it doesn't have to care about non-gcc compilers and
older versions of gcc.

alpha-dec-osf5.1b bootstrap has completed, make check currently
running.  Of for mainline if that passes?

Thanks.
	Rainer


2011-08-03  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc:
	* tsystem.h (CONST_CAST2, CONST_CAST): Define.

	gcc/ada:
	* init.c [__alpha__ && __osf__] (__gnat_error_handler): Use
	CONST_CAST.

Comments

Arnaud Charlet Aug. 5, 2011, 9:39 a.m. UTC | #1
> unfortunately, it turned out that this fix only works when compiling
> ada/init.c inside gcc, not for gnatlib where CONST_CAST* isn't defined.
> I need the following patch instead, which is also simpler for using
> CONST_CAST, not CONST_CAST2, and provides a CONST_CAST definition in
> tsystem.h, where it doesn't have to care about non-gcc compilers and
> older versions of gcc.
> 
> alpha-dec-osf5.1b bootstrap has completed, make check currently
> running.  Of for mainline if that passes?

The Ada part is OK. I can't formally approve the tsystem.h bit though.

Arno
Rainer Orth Aug. 5, 2011, 12:16 p.m. UTC | #2
Arnaud Charlet <charlet@adacore.com> writes:

>> unfortunately, it turned out that this fix only works when compiling
>> ada/init.c inside gcc, not for gnatlib where CONST_CAST* isn't defined.
>> I need the following patch instead, which is also simpler for using
>> CONST_CAST, not CONST_CAST2, and provides a CONST_CAST definition in
>> tsystem.h, where it doesn't have to care about non-gcc compilers and
>> older versions of gcc.
>> 
>> alpha-dec-osf5.1b bootstrap has completed, make check currently
>> running.  Of for mainline if that passes?
>
> The Ada part is OK. I can't formally approve the tsystem.h bit though.

Since this fixes a bootstrap failure, I've installed the patch,
considering the tsystem.h part obvious.

Thanks.
	Rainer
diff mbox

Patch

diff --git a/gcc/ada/init.c b/gcc/ada/init.c
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -379,7 +379,7 @@  __gnat_error_handler (int sig, siginfo_t
     }
 
   recurse = 0;
-  Raise_From_Signal_Handler (exception, (char *) msg);
+  Raise_From_Signal_Handler (exception, CONST_CAST (char *, msg));
 }
 
 void
diff --git a/gcc/tsystem.h b/gcc/tsystem.h
--- a/gcc/tsystem.h
+++ b/gcc/tsystem.h
@@ -1,6 +1,7 @@ 
 /* Get common system includes and various definitions and declarations
    based on target macros.
-   Copyright (C) 2000, 2001, 2004, 2005, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2004, 2005, 2009, 2011
+   Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -128,6 +129,9 @@  extern int errno;
    unreachable default case of a switch.  Do not use gcc_assert(0).  */
 #define gcc_unreachable() (abort ())
 
+#define CONST_CAST2(TOTYPE,FROMTYPE,X) ((__extension__(union {FROMTYPE _q; TOTYPE _nq;})(X))._nq)
+#define CONST_CAST(TYPE,X) CONST_CAST2(TYPE, const TYPE, (X))
+
 /* Filename handling macros.  */
 #include "filenames.h"