Re: Fix Tru64 UNIX Ada bootstrap
Arnaud Charlet 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 -- - Rainer Orth, Center for Biotechnology, Bielefeld University
Re: Fix Tru64 UNIX Ada bootstrap
> 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
Re: Fix Tru64 UNIX Ada bootstrap
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 gcc: * tsystem.h (CONST_CAST2, CONST_CAST): Define. gcc/ada: * init.c [__alpha__ && __osf__] (__gnat_error_handler): Use CONST_CAST. 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" -- - Rainer Orth, Center for Biotechnology, Bielefeld University
Re: Fix Tru64 UNIX Ada bootstrap
> Fixed as follows, bootstrap is well beyond the failure now. > > Ok for mainline? OK, thanks.
Fix Tru64 UNIX Ada bootstrap
Tru64 UNIX Ada bootstrap was broken, too: /vol/gcc/src/hg/trunk/solaris/gcc/ada/init.c: In function 'void __gnat_error_handler(int, siginfo_t*, void*)': /vol/gcc/src/hg/trunk/solaris/gcc/ada/init.c:382:50: error: cast from type 'const char*' to type 'char*' casts away qualifiers [-Werror=cast-qual] cc1plus: all warnings being treated as errors Fixed as follows, bootstrap is well beyond the failure now. Ok for mainline? Rainer 2011-08-03 Rainer Orth * init.c [__alpha__ && __osf__] (__gnat_error_handler): Use CONST_CAST2. 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,8 @@ __gnat_error_handler (int sig, siginfo_t } recurse = 0; - Raise_From_Signal_Handler (exception, (char *) msg); + Raise_From_Signal_Handler (exception, +CONST_CAST2 (char *, const char *, msg)); } void -- - Rainer Orth, Center for Biotechnology, Bielefeld University