From patchwork Fri Jun 10 14:34:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 99899 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 9BCF8B702A for ; Sat, 11 Jun 2011 00:34:50 +1000 (EST) Received: (qmail 32625 invoked by alias); 10 Jun 2011 14:34:47 -0000 Received: (qmail 32287 invoked by uid 22791); 10 Jun 2011 14:34:46 -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 snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Jun 2011 14:34:26 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 0E6C285B; Fri, 10 Jun 2011 16:34:25 +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 WVgAuChi5bKu; Fri, 10 Jun 2011 16:34:22 +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 9703A85A; Fri, 10 Jun 2011 16:34:22 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id p5AEYEX6013679; Fri, 10 Jun 2011 16:34:14 +0200 (MEST) From: Rainer Orth To: "Joseph S. Myers" Cc: gcc-patches@gcc.gnu.org, Jakub Jelinek Subject: Re: [testsuite] Run TLS torture tests with -fpic etc. References: <20110603194403.GG17079@tyan-ft48-01.lab.bos.redhat.com> <20110607165513.GD17079@tyan-ft48-01.lab.bos.redhat.com> Date: Fri, 10 Jun 2011 16:34:14 +0200 In-Reply-To: (Joseph S. Myers's message of "Fri, 10 Jun 2011 14:02:44 +0000 (UTC)") 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 "Joseph S. Myers" writes: > On Fri, 10 Jun 2011, Rainer Orth wrote: > >> Jakub Jelinek writes: >> >> > On Tue, Jun 07, 2011 at 06:48:08PM +0200, Rainer Orth wrote: >> >> any word on this patch? I think I only need approval for the gcc.c >> > >> > I'm not a maintainer of gcc.c, and I think it is a bad idea. >> > PIE is just a (slightly) more secure form of an executable, therefore >> > if a target doesn't support position independent executables, linking >> > it as normal executable is IMHO just fine. >> >> Joseph, as driver maintainer, what's your take on this? >> >> http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00373.html >> >> If the gcc.c change is unacceptable, I'll change the pie >> effective-target keyword to just check for darwin9+ and linux instead. > > I think we should leave gcc.c as-is here, treating -pie as a non-semantic > option. Ok, I've comitted that patch as follows, after running the appropriate runtest invocation on powerpc-apple-darwin9.8.0 and i386-pc-solaris2.10. I've omitted adding -pie in gcc.dg/pie-link.c for now. Rainer 2011-06-04 Rainer Orth gcc: * doc/sourcebuild.texi (Effective-Target Keywords, pie): Document it. gcc/testsuite: * lib/target-supports.exp (check_effective_target_pie): New proc. * gcc.dg/pie-link.c: Use target pie. Index: gcc/doc/sourcebuild.texi =================================================================== --- gcc/doc/sourcebuild.texi (revision 174908) +++ gcc/doc/sourcebuild.texi (working copy) @@ -1787,6 +1787,9 @@ @item pe_aligned_commons Target supports @option{-mpe-aligned-commons}. +@item pie +Target supports @option{-pie}, @option{-fpie} and @option{-fPIE}. + @item section_anchors Target supports section anchors. Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp (revision 174908) +++ gcc/testsuite/lib/target-supports.exp (working copy) @@ -788,6 +788,16 @@ return 0 } +# Return 1 if -pie, -fpie and -fPIE are supported, 0 otherwise. + +proc check_effective_target_pie { } { + if { [istarget *-*-darwin\[912\]*] + || [istarget *-*-linux*] } { + return 1; + } + return 0 +} + # Return true if the target supports -mpaired-single (as used on MIPS). proc check_effective_target_mpaired_single { } { Index: gcc/testsuite/gcc.dg/pie-link.c =================================================================== --- gcc/testsuite/gcc.dg/pie-link.c (revision 174908) +++ gcc/testsuite/gcc.dg/pie-link.c (working copy) @@ -1,4 +1,4 @@ -/* { dg-do link { target *-*-darwin[912]* *-*-linux* } } */ +/* { dg-do link { target pie } } */ /* { dg-options "-fpie" } */ int main(void)