From patchwork Mon May 7 11:03:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 157289 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 CC298B6FAB for ; Mon, 7 May 2012 21:04:16 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1336993457; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:To:Subject:Date:Message-ID:User-Agent: MIME-Version:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=XyzJUKd/lSXn9NIQEgoiw22dzF4=; b=bYqeBUoqwnzFmoO JKgaFqRrUa1Gefe2JkeVA2u8dQA7upo8GNKE0RoupTB+zUYTeM6p+aMlz4pgGe33 EAvhc25YCextFuMcuFYjrXIum+4J56IBYSUL8fTPXLKtN/X5c59Oiqs76DTZA38K wV2penRy6vrbQLK2m06a2A+qZNSM= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=xQIK18/G3c1TcPsTsxhVYO2p622ZFxTI1sCDGb6hNUwP2wzAasKe/x1CEP4jIp e9ip2hyjRk+X6udagenmCyeFLud3eB1qhksQhb6nVM5eq8Jup+zKZqkY945aJtJX Z+m8BtyPeJeuAVUWYhjZu+Vz0XY8Ix+55AFjxs8vQIfaE=; Received: (qmail 28022 invoked by alias); 7 May 2012 11:04:11 -0000 Received: (qmail 28009 invoked by uid 22791); 7 May 2012 11:04:10 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS 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; Mon, 07 May 2012 11:03:56 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 7AA697A4 for ; Mon, 7 May 2012 13:03:55 +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 xqcAtEZd42Bm for ; Mon, 7 May 2012 13:03:53 +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 D24207A2 for ; Mon, 7 May 2012 13:03:52 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.5+Sun/8.14.5/Submit) id q47B3qIW018076; Mon, 7 May 2012 13:03:52 +0200 (MEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Subject: Don't use DWARF 4 on Solaris Date: Mon, 07 May 2012 13:03:52 +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 Solaris bootstrap on mainline is currently broken with the native linker: linking stage1 libgcc_s.so fails like this: ld: fatal: unwind table: file _divdi3_s.o: section .eh_frame: bad cie version 0: offset 0x20 It turns out that ld cannot handle CIE version 3. The wrong error message nonwithstanding, it requires CIE version 1. CR 7166576 (ld/elfdump need to support DWARF-4) has been filed for this issue and adding proper DWARF-3/4 support is under investigation by the linker maintainers. For the time being, I work around this as on Darwin by defaulting to DWARF-2 unless something else is specified explicitly. For consistency, I'm doing this always, even if using GNU ld, which could be reconsidered. Bootstrapped on i386-pc-solaris2.{9, 10, 11} and sparc-sun-solaris2.{9, 10, 11} with as/ld, gas/ld, gas/gld, installed on mainline. Rainer 2012-05-04 Rainer Orth * config/sol2.c (solaris_override_options): New function. * config/sol2-protos.h (solaris_override_options): Declare. * config/sol2.h (SUBTARGET_OVERRIDE_OPTIONS): Define. # HG changeset patch # Parent 9ee70e3b93194a9a802f878a7502ae5e5519c180 Don't use DWARF 4 on Solaris diff --git a/gcc/config/sol2-protos.h b/gcc/config/sol2-protos.h --- a/gcc/config/sol2-protos.h +++ b/gcc/config/sol2-protos.h @@ -1,6 +1,6 @@ /* Operating system specific prototypes to be used when targeting GCC for any Solaris 2 system. - Copyright 2004, 2007, 2010, 2011 Free Software Foundation, Inc. + Copyright 2004, 2007, 2010, 2011, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -24,6 +24,7 @@ extern void solaris_elf_asm_comdat_secti extern void solaris_file_end (void); extern void solaris_insert_attributes (tree, tree *); extern void solaris_output_init_fini (FILE *, tree); +extern void solaris_override_options (void); /* In sol2-c.c. */ extern void solaris_register_pragmas (void); diff --git a/gcc/config/sol2.c b/gcc/config/sol2.c --- a/gcc/config/sol2.c +++ b/gcc/config/sol2.c @@ -1,5 +1,6 @@ /* General Solaris system support. - Copyright (C) 2004, 2005 , 2007, 2010, 2011 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 , 2007, 2010, 2011, 2012 + Free Software Foundation, Inc. Contributed by CodeSourcery, LLC. This file is part of GCC. @@ -282,3 +283,12 @@ solaris_file_end (void) htab_traverse (solaris_comdat_htab, solaris_define_comdat_signature, NULL); } + +void +solaris_override_options (void) +{ + /* Don't emit DWARF3/4 unless specifically selected. Solaris ld cannot + handle CIE version 3 in .eh_frame. */ + if (!global_options_set.x_dwarf_version) + dwarf_version = 2; +} diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h --- a/gcc/config/sol2.h +++ b/gcc/config/sol2.h @@ -99,6 +99,12 @@ along with GCC; see the file COPYING3. TARGET_SUB_OS_CPP_BUILTINS(); \ } while (0) +#define SUBTARGET_OVERRIDE_OPTIONS \ + do { \ + solaris_override_options (); \ + } while (0) + + /* It's safe to pass -s always, even if -g is not used. Those options are handled by both Sun as and GNU as. */ #define ASM_SPEC_BASE \