From patchwork Tue Jul 20 16:22:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 59342 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 B6E49B6EF7 for ; Wed, 21 Jul 2010 02:22:59 +1000 (EST) Received: (qmail 32434 invoked by alias); 20 Jul 2010 16:22:56 -0000 Received: (qmail 32412 invoked by uid 22791); 20 Jul 2010 16:22:53 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL, BAYES_05, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from c2beaomr06.btconnect.com (HELO c2beaomr06.btconnect.com) (213.123.26.184) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Jul 2010 16:22:47 +0000 Received: from thor.office (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by c2beaomr06.btconnect.com with ESMTP id DCK82992; Tue, 20 Jul 2010 17:22:30 +0100 (BST) Message-Id: From: IainS To: GCC Patches Mime-Version: 1.0 (Apple Message framework v936) Subject: [Patch Darwin] tidy linkspecs. Date: Tue, 20 Jul 2010 17:22:29 +0100 Cc: mrs@gcc.gnu.org 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 there is a certain amount of unwelcome duplication in the darwin LINK_COMMAND_SPECs. this splits the LINK_COMMAND_SPECs into two parts and only changes the bit that's necessary for darwin >= 9 successful bootstraps on {powerpc*,i686}-apple-darwin9, i686-apple- darwin8, x86_64-apple-darwin10. OK for trunk? Iain gcc/ * config/darwin.h (LINK_COMMAND_SPEC): Split into... (LINK_COMMAND_SPEC_A): New. (DSYMUTIL): New. (DSYMUTIL_SPEC): New. * config/darwin9.h (LINK_COMMAND_SPEC): Remove. (DSYMUTIL_SPEC): Update for darwin >= 9 requirements. /* libSystem contains unwind information for signal frames. */ #define DARWIN_LIBSYSTEM_HAS_UNWIND Index: gcc/config/darwin.h =================================================================== --- gcc/config/darwin.h (revision 162327) +++ gcc/config/darwin.h (working copy) @@ -266,8 +266,9 @@ extern GTY(()) int darwin_ms_struct; instead of LINK_COMMAND_SPEC. The command spec is better for specifying the handling of options understood by generic Unix linkers, and for positional arguments like libraries. */ -#define LINK_COMMAND_SPEC "\ -%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ + +#define LINK_COMMAND_SPEC_A \ + "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ %(linker) %l %X %{d} %{s} %{t} %{Z} %{u*} \ %{A} %{e*} %{m} %{r} %{x} \ %{o*}%{!o:-o a.out} \ @@ -277,11 +278,17 @@ extern GTY(()) int darwin_ms_struct; %{fopenmp|ftree-parallelize-loops=*: \ %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \ %{!nostdlib:%{!nodefaultlibs: %(link_ssp) %G %L }} \ - %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}\n\ -%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ + %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}\n" + +#define DSYMUTIL "dsymutil" + +#define DSYMUTIL_SPEC \ + "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm: \ - %{gdwarf-2:%{!gstabs*:%{!g0: dsymutil %{o*:%*}%{! o:a.out}}}}}}}}}}}}" + %{gdwarf-2:%{!gstabs*:%{!g0: " DSYMUTIL " %{o*:%*}%{! o:a.out}}}}}}}}}}}}" +#define LINK_COMMAND_SPEC LINK_COMMAND_SPEC_A DSYMUTIL_SPEC + #ifdef TARGET_SYSTEM_ROOT #define LINK_SYSROOT_SPEC \ "%{isysroot*:-syslibroot %*;:-syslibroot " TARGET_SYSTEM_ROOT "}" Index: gcc/config/darwin9.h =================================================================== --- gcc/config/darwin9.h (revision 162327) +++ gcc/config/darwin9.h (working copy) @@ -24,22 +24,11 @@ along with GCC; see the file COPYING3. If not see #define DARWIN_PREFER_DWARF /* Since DWARF2 is default, conditions for running dsymutil are different. */ -#undef LINK_COMMAND_SPEC -#define LINK_COMMAND_SPEC "\ -%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ - %(linker) %l %X %{d} %{s} %{t} %{Z} \ - %{A} %{e*} %{m} %{r} %{x} \ - %{o*}%{!o:-o a.out} \ - %{!A:%{!nostdlib:%{!nostartfiles:%S}}} \ - %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*| coverage:-lgcov} \ - %{flto} %{fwhopr} \ - %{fopenmp|ftree-parallelize-loops=*: \ - %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \ - %{!nostdlib:%{!nodefaultlibs: %(link_ssp) %G %L }} \ - %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}\n\ -%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ - %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm: \ - %{g*:%{!gstabs*:%{!g0: dsymutil %{o*:%*}%{!o:a.out}}}}}}}}}}}}" +#undef DSYMUTIL_SPEC +#define DSYMUTIL_SPEC \ + "%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ + %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm|.s: \ + %{g*:%{!gstabs*:%{!g0: " DSYMUTIL " %{o*:%*}%{!o:a.out}}}}}}}}}}}}"