From patchwork Thu Aug 4 17:44:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 108552 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 876E8B6F68 for ; Fri, 5 Aug 2011 03:45:13 +1000 (EST) Received: (qmail 2089 invoked by alias); 4 Aug 2011 17:45:08 -0000 Received: (qmail 2079 invoked by uid 22791); 4 Aug 2011 17:45:07 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Aug 2011 17:44:52 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 785D2781; Thu, 4 Aug 2011 19:44:51 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id VVEmuK9-EnOj; Thu, 4 Aug 2011 19:44:49 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 534B777D; Thu, 4 Aug 2011 19:44:49 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.5+Sun/8.14.5/Submit) id p74Hiluk001749; Thu, 4 Aug 2011 19:44:47 +0200 (MEST) From: Rainer Orth To: Arnaud Charlet Cc: gcc-patches@gcc.gnu.org, "Joseph S. Myers" Subject: Re: Fix Tru64 UNIX Ada bootstrap References: <20110803131134.GB31315@adacore.com> Date: Thu, 04 Aug 2011 19:44:47 +0200 In-Reply-To: <20110803131134.GB31315@adacore.com> (Arnaud Charlet's message of "Wed, 3 Aug 2011 15:11:34 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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"