From patchwork Sat Sep 28 09:35:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 278726 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 92A402C00BC for ; Sat, 28 Sep 2013 19:35:30 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:subject:date:message-id :cc:to:mime-version; q=dns; s=default; b=HMdlLigHX7JqoYmz45WPYw0 cWKbr6QH5j86a0eSj+FaecRdxp2iDfD2XfQdqFnrPEOYxp+O3wWNmhssvymBI9m9 7jJM545pX6pGEy+1XTg5L4jMXKFfmOlSDnwxGdS84C8HidXZyQzOmem+u3lcxR7W K1VPELwb9O/lMEhmJR/A= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:content-transfer-encoding:subject:date:message-id :cc:to:mime-version; s=default; bh=YZ0GNO+CYUeOdTLzdZwdaf3mYCs=; b= T924r6BUwQFq+9XrRmRgIMXeZWurY/x0dGf86R+O9oqDJ7SeHNWwbQKHXovgfaiv 7gGRVNazzu+c9OW2BOsv0Gkp+sK70z2xHB8/2m5Yu8/nopXXJCsmQMqdPyfEL3PG db/Y2thlKpoTmw4qnuXydlsHuYmwQKcMqQ+yEj3kpBM= Received: (qmail 11887 invoked by alias); 28 Sep 2013 09:35:23 -0000 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 Received: (qmail 11873 invoked by uid 89); 28 Sep 2013 09:35:23 -0000 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 28 Sep 2013 09:35:23 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, RDNS_NONE, SPF_HELO_FAIL autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1VPqvl-0005UA-V4 from Iain_Sandoe@mentor.com ; Sat, 28 Sep 2013 02:35:17 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sat, 28 Sep 2013 02:35:17 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Sat, 28 Sep 2013 10:35:15 +0100 From: Iain Sandoe Subject: [Patch, Darwin] improve cross-compiles. Date: Sat, 28 Sep 2013 10:35:13 +0100 Message-ID: CC: Mike Stump To: GCC Patches MIME-Version: 1.0 (Apple Message framework v1283) I've been experimenting with the idea of building native crosses on my most capable machine, for the many variants of darwin we now have, and then using the older/slower hardware for test only. This has uncovered a few issues with cross/native cross flags etc. this patch adjusts the mh-darwin fragment to ensure (i) that PIE is disabled for gcc exes on Darwin hosts since it is incompatible with the current PCH implementation. (ii) that -mdynamic-no-pic is used for m32 hosts. … for crosses as well as bootstraps (and, also, for stage1 compilations when bootstrapping on a darwin host). OK for trunk? Iain config: * mh-darwin (BOOT_CFLAGS): Only add -mdynamic-no-pic for m32 hosts. (STAGE1_CFLAGS, STAGE1_LDFLAGS): New. Fix over-length lines and amend comments. diff --git a/config/mh-darwin b/config/mh-darwin index 19bf265..a039f20 100644 --- a/config/mh-darwin +++ b/config/mh-darwin @@ -1,7 +1,18 @@ # The -mdynamic-no-pic ensures that the compiler executable is built without # position-independent-code -- the usual default on Darwin. This fix speeds # compiles by 3-5%. -BOOT_CFLAGS += -mdynamic-no-pic +BOOT_CFLAGS += \ +`case ${host} in i?86-*-darwin* | powerpc-*-darwin*) \ + echo -mdynamic-no-pic ;; esac;` -# Ensure we don't try and use -pie, as it is incompatible with pch. -BOOT_LDFLAGS += `case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; esac;` +# ld on Darwin versions >= 10.7 defaults to PIE executables. Disable this for +# gcc components, since it is incompatible with our pch implementation. +BOOT_LDFLAGS += \ +`case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; esac;` + +# Similarly, for cross-compilation. +STAGE1_CFLAGS += \ +`case ${host} in i?86-*-darwin* | powerpc-*-darwin*)\ + echo -mdynamic-no-pic ;; esac;` +STAGE1_LDFLAGS += \ +`case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; esac;`