From patchwork Fri Oct 8 01:57:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Froyd X-Patchwork-Id: 67127 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 4E8E9B6EF0 for ; Fri, 8 Oct 2010 12:57:17 +1100 (EST) Received: (qmail 21580 invoked by alias); 8 Oct 2010 01:57:16 -0000 Received: (qmail 21270 invoked by uid 22791); 8 Oct 2010 01:57:14 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Oct 2010 01:57:10 +0000 Received: (qmail 16836 invoked from network); 8 Oct 2010 01:57:08 -0000 Received: from unknown (HELO codesourcery.com) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 8 Oct 2010 01:57:08 -0000 Date: Thu, 7 Oct 2010 21:57:06 -0400 From: Nathan Froyd To: gcc-patches@gcc.gnu.org Cc: nickc@redhat.com Subject: [PATCH] fix mcore-elf build Message-ID: <20101008015704.GK17388@nightcrawler> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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 The patch below fixes build errors seen on mcore-elf. The INCOMING_RETURN_ADDR_RTX change is needed to keep dwarf2out.c from asserting, and the TARGET_EXCEPT_UNWIND_INFO change fixes things like: In file included from ../../../gcc-head/libgcc/../gcc/unwind-dw2.c:1582:0: ../../../gcc-head/libgcc/../gcc/unwind.inc: In function '_Unwind_RaiseException': ../../../gcc-head/libgcc/../gcc/unwind.inc:136:1: error: __builtin_eh_return not supported on this target ../../../gcc-head/libgcc/../gcc/unwind.inc: In function '_Unwind_ForcedUnwind': ../../../gcc-head/libgcc/../gcc/unwind.inc:212:1: error: __builtin_eh_return not supported on this target ../../../gcc-head/libgcc/../gcc/unwind.inc: In function '_Unwind_Resume': ../../../gcc-head/libgcc/../gcc/unwind.inc:237:1: error: __builtin_eh_return not supported on this target ../../../gcc-head/libgcc/../gcc/unwind.inc: In function '_Unwind_Resume_or_Rethrow': ../../../gcc-head/libgcc/../gcc/unwind.inc:262:1: error: __builtin_eh_return not supported on this target seen while building libgcc. Tested with cross to mcore-elf. OK to commit? -Nathan * config/mcore/mcore.h (INCOMING_RETURN_ADDR_RTX): Define. * config/mcore/mcore.c (TARGET_EXCEPT_UNWIND_INFO): Define. Index: config/mcore/mcore.c =================================================================== --- config/mcore/mcore.c (revision 165145) +++ config/mcore/mcore.c (working copy) @@ -227,6 +227,9 @@ static const struct attribute_spec mcore #undef TARGET_OPTION_OPTIMIZATION #define TARGET_OPTION_OPTIMIZATION mcore_option_optimization +#undef TARGET_EXCEPT_UNWIND_INFO +#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info + struct gcc_target targetm = TARGET_INITIALIZER; /* Adjust the stack and return the number of bytes taken to do it. */ Index: config/mcore/mcore.h =================================================================== --- config/mcore/mcore.h (revision 165145) +++ config/mcore/mcore.h (working copy) @@ -776,6 +776,8 @@ extern const enum reg_class reg_class_fr #undef TARGET_ASM_NAMED_SECTION #define TARGET_ASM_NAMED_SECTION mcore_asm_named_section +#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (SImode, LK_REG) + /* This is how to output an insn to push a register on the stack. It need not be very fast code. */ #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \