From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18006 invoked by alias); 3 Mar 2003 17:06:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 17982 invoked by uid 71); 3 Mar 2003 17:06:02 -0000 Date: Mon, 03 Mar 2003 17:06:00 -0000 Message-ID: <20030303170602.17981.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Olivier Hainque Subject: Re: ada/9911: gnatmake fails to link when GCC configured for sjlj Reply-To: Olivier Hainque X-SW-Source: 2003-03/txt/msg00102.txt.bz2 List-Id: The following reply was made to PR ada/9911; it has been noted by GNATS. From: Olivier Hainque To: John David Anglin Cc: dannysmith@users.sourceforge.net, gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, dave.anglin@nrc.ca, gcc-prs@gcc.gnu.org, hainque@ACT-Europe.FR Subject: Re: ada/9911: gnatmake fails to link when GCC configured for sjlj Date: Mon, 3 Mar 2003 17:59:50 +0100 John David Anglin wrote: > there probably does need to be a stub for _Unwind_SjLj_RaiseException in > raise.c. > We also need to fix the call issued from a-except.adb. This is actually > what caused the link failure in the PR. Right. > I hacked a-except.adb and raise.c use to use _Unwind_SjLj_RaiseException > but not being familiar with ada I'm not sure how to conditionalize the ada > code. To avoid the need for conditional compilation at the Ada level, we eventually chose to define stubs with consistent names across the various GCC configuration possibilities. The patch achieves this, basically tested against today's 3.3 sources. Please tell me if it allows you to proceed further or not. Kind Regards, Olivier *** a-except.adb.ori Mon Mar 3 17:04:28 2003 --- a-except.adb Mon Mar 3 17:12:01 2003 *************** package body Ada.Exceptions is *** 199,205 **** function Unwind_RaiseException (E : access GNAT_GCC_Exception) return Unwind_Reason_Code; ! pragma Import (C, Unwind_RaiseException, "_Unwind_RaiseException"); ----------------------- -- Local Subprograms -- --- 199,205 ---- function Unwind_RaiseException (E : access GNAT_GCC_Exception) return Unwind_Reason_Code; ! pragma Import (C, Unwind_RaiseException, "__gnat_Unwind_RaiseException"); ----------------------- -- Local Subprograms -- *** raise.c.ori Mon Mar 3 17:04:16 2003 --- raise.c Mon Mar 3 17:18:15 2003 *************** __gnat_eh_personality (version, actions, *** 597,617 **** } ! #else /* IN_RTS - For eh personality routine */ /* The calls to the GCC runtime interface for exception raising are currently issued from a-except.adb, which is used by both the runtime library and the compiler. As the compiler binary is not linked against the GCC runtime library, we need a stub for this interface in the compiler case. */ _Unwind_Reason_Code ! _Unwind_RaiseException (e) struct _Unwind_Exception *e ATTRIBUTE_UNUSED; { - /* Since we don't link the compiler with a host libgcc, we should not be - using the GCC eh mechanism for the compiler and so expect this function - never to be called. */ abort (); } --- 597,644 ---- } ! /* If the underlying GCC scheme for exception handling is SJLJ, the standard ! propagation routine (_Unwind_RaiseException) is actually renamed using a ! #define directive (see unwing-sjlj.c). We need a consistently named ! interface to import from a-except, so stubs are defined here. */ ! ! #ifdef __USING_SJLJ_EXCEPTIONS__ ! ! _Unwind_Reason_Code ! __gnat_Unwind_RaiseException (e) ! struct _Unwind_Exception *e; ! { ! return _Unwind_SjLj_RaiseException (e); ! } ! ! #else ! /* __USING_SJLJ_EXCEPTIONS__ not defined */ ! ! void ! __gnat_Unwind_RaiseException (e) ! struct _Unwind_Exception *e; ! { ! return _Unwind_RaiseException (e); ! } ! ! #endif ! ! #else ! /* IN_RTS not defined */ /* The calls to the GCC runtime interface for exception raising are currently issued from a-except.adb, which is used by both the runtime library and the compiler. As the compiler binary is not linked against the GCC runtime library, we need a stub for this interface in the compiler case. */ + /* Since we don't link the compiler with a host libgcc, we should not be + using the GCC eh mechanism for the compiler and so expect this function + never to be called. */ _Unwind_Reason_Code ! __gnat_Unwind_RaiseException (e) struct _Unwind_Exception *e ATTRIBUTE_UNUSED; { abort (); }