From patchwork Mon Jun 18 16:36:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Howarth X-Patchwork-Id: 165523 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 EF7D7B7085 for ; Tue, 19 Jun 2012 02:37:21 +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=1340642242; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=70jH5UYKM33Tebf2yq+EZV4D5Zc=; b=c6WPOUlr49YUEWp d8D7m1AAK0+v+onwqg9ZoKclTaL0MdXGZ837LnV3mjhCdo5HNV2wmPDC7Q9H84iD VCKY4YAsJT7PnyLWILqwGhLsdJKbsDQCkmDBXskUfDBlPALBZALBxNOqFahHmD64 vUFOw59wJ7TNT94T57StxY+N+KWA= 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:Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=bL+o1nFTwpZ8Rmw3vgXAa1F9khtvzZD5lrp81vX4JZ7fp1QCHquBSOqQ5MRCKG 929oQMdFoho1x+ZGn7dBjbZWHDh1e3N7gEFpObMGRowXKMQoDj35OjwyESJ8/s3a AIH8udbDS2VkOsD1qETz66na+m9H0KkluDQnUK5zMhjPg=; Received: (qmail 9928 invoked by alias); 18 Jun 2012 16:37:14 -0000 Received: (qmail 9807 invoked by uid 22791); 18 Jun 2012 16:37:12 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from bromo.med.uc.edu (HELO bromo.med.uc.edu) (129.137.3.146) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Jun 2012 16:36:51 +0000 Received: from bromo.med.uc.edu (localhost.localdomain [127.0.0.1]) by bromo.med.uc.edu (Postfix) with ESMTP id 740BCB005C; Mon, 18 Jun 2012 12:36:50 -0400 (EDT) Received: (from howarth@localhost) by bromo.med.uc.edu (8.14.3/8.14.3/Submit) id q5IGalsO026123; Mon, 18 Jun 2012 12:36:47 -0400 Date: Mon, 18 Jun 2012 12:36:47 -0400 From: Jack Howarth To: gcc-patches@gcc.gnu.org Cc: mikestump@comcast.net, iains@gcc.gnu.org, jason@redhat.com Subject: [PATCH] backport darwin12 fixes to gcc-4_7-branch Message-ID: <20120618163647.GA26121@bromo.med.uc.edu> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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 attached patch backports... http://gcc.gnu.org/ml/gcc-patches/2012-05/msg01710.html http://gcc.gnu.org/ml/gcc-patches/2012-05/msg01707.html which implement changes for darwin12 and later. Bootstrap and regression tested on current x86_64-apple-darwin12. http://gcc.gnu.org/ml/gcc-testresults/2012-06/msg01547.html Okay for gcc-4_7-branch? Jack 2012-06-17 Jack Howarth Backport from mainline 2012-05-29 Jack Howarth * config/darwin.h (STARTFILE_SPEC): Use -no_new_main with -lgcrt1.o on Darwin >= 12. (DARWIN_CRT1_SPEC): Use -lcrt1.10.6.o when Darwin >= 10 and < 12. 2012-05-29 Jack Howarth PR debug/53453 * doc/tm.texi: Update. * doc/tm.texi.in (SDB and DWARF) : Add @hook. * target.def (force_at_comp_dir): New hook. * config/darwin.h (TARGET_FORCE_AT_COMP_DIR): Define. * dwarf2out.c (dwarf2out_finish): Check targetm.force_at_comp_dir. Index: gcc/doc/tm.texi.in =================================================================== --- gcc/doc/tm.texi.in (revision 188717) +++ gcc/doc/tm.texi.in (working copy) @@ -9386,6 +9386,8 @@ tables, and hence is desirable if it wor @hook TARGET_WANT_DEBUG_PUB_SECTIONS +@hook TARGET_FORCE_AT_COMP_DIR + @hook TARGET_DELAY_SCHED2 @hook TARGET_DELAY_VARTRACK Index: gcc/target.def =================================================================== --- gcc/target.def (revision 188717) +++ gcc/target.def (working copy) @@ -2748,6 +2748,13 @@ DEFHOOKPOD bool, false) DEFHOOKPOD +(force_at_comp_dir, + "True if the @code{DW_AT_comp_dir} attribute should be emitted for each \ + compilation unit. This attribute is required for the darwin linker \ + to emit debug information.", + bool, false) + +DEFHOOKPOD (delay_sched2, "True if sched2 is not to be run at its normal place. \ This usually means it will be run as part of machine-specific reorg.", bool, false) Index: gcc/dwarf2out.c =================================================================== --- gcc/dwarf2out.c (revision 188717) +++ gcc/dwarf2out.c (working copy) @@ -22501,7 +22501,7 @@ dwarf2out_finish (const char *filename) /* Add the name for the main input file now. We delayed this from dwarf2out_init to avoid complications with PCH. */ add_name_attribute (comp_unit_die (), remap_debug_filename (filename)); - if (!IS_ABSOLUTE_PATH (filename)) + if (!IS_ABSOLUTE_PATH (filename) || targetm.force_at_comp_dir) add_comp_dir_attribute (comp_unit_die ()); else if (get_AT (comp_unit_die (), DW_AT_comp_dir) == NULL) { Index: gcc/config/darwin.h =================================================================== --- gcc/config/darwin.h (revision 188717) +++ gcc/config/darwin.h (working copy) @@ -356,7 +356,9 @@ extern GTY(()) int darwin_ms_struct; %{!Zbundle:%{pg:%{static:-lgcrt0.o} \ %{!static:%{object:-lgcrt0.o} \ %{!object:%{preload:-lgcrt0.o} \ - %{!preload:-lgcrt1.o %(darwin_crt2)}}}} \ + %{!preload:-lgcrt1.o \ + %:version-compare(>= 10.8 mmacosx-version-min= -no_new_main) \ + %(darwin_crt2)}}}} \ %{!pg:%{static:-lcrt0.o} \ %{!static:%{object:-lcrt0.o} \ %{!object:%{preload:-lcrt0.o} \ @@ -379,7 +381,7 @@ extern GTY(()) int darwin_ms_struct; #define DARWIN_CRT1_SPEC \ "%:version-compare(!> 10.5 mmacosx-version-min= -lcrt1.o) \ %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lcrt1.10.5.o) \ - %:version-compare(>= 10.6 mmacosx-version-min= -lcrt1.10.6.o) \ + %:version-compare(>< 10.6 10.8 mmacosx-version-min= -lcrt1.10.6.o) \ %{fgnu-tm: -lcrttms.o}" /* Default Darwin ASM_SPEC, very simple. */ @@ -414,6 +416,8 @@ extern GTY(()) int darwin_ms_struct; #define TARGET_WANT_DEBUG_PUB_SECTIONS true +#define TARGET_FORCE_AT_COMP_DIR true + /* When generating stabs debugging, use N_BINCL entries. */ #define DBX_USE_BINCL