From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121660 invoked by alias); 17 Nov 2017 16:41:32 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 121641 invoked by uid 89); 17 Nov 2017 16:41:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KB_WAM_FROM_NAME_SINGLEWORD,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=curiosity X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Nov 2017 16:41:30 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id vAHGfNEa023252 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 17 Nov 2017 11:41:27 -0500 Received: by simark.ca (Postfix, from userid 112) id 0C0381E585; Fri, 17 Nov 2017 11:41:23 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 8459B1E4F2; Fri, 17 Nov 2017 11:41:12 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 17 Nov 2017 16:41:00 -0000 From: Simon Marchi To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] [testsuite] Pass -pie in ldflags In-Reply-To: <1510932126-11752-1-git-send-email-yao.qi@linaro.org> References: <1510932126-11752-1-git-send-email-yao.qi@linaro.org> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.2 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 17 Nov 2017 16:41:23 +0000 X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00347.txt.bz2 On 2017-11-17 10:22, Yao Qi wrote: > -pie is a linker flag, it should be passed via "ldflags", instead > of "additional_flags". Otherwise, clang complains, > > clang: warning: argument unused during compilation: '-pie' > > gdb/testsuite: > > 2017-11-17 Yao Qi > > * gdb.base/attach-pie-noexec.exp: Pass "-pie" in ldflags. > * gdb.base/break-interp.exp: Likewise. > * gdb.base/jit-attach-pie.exp: Likewise. > --- > gdb/testsuite/gdb.base/attach-pie-noexec.exp | 2 +- > gdb/testsuite/gdb.base/break-interp.exp | 3 ++- > gdb/testsuite/gdb.base/jit-attach-pie.exp | 2 +- > 3 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/gdb/testsuite/gdb.base/attach-pie-noexec.exp > b/gdb/testsuite/gdb.base/attach-pie-noexec.exp > index 82e6af6..56a42cb 100644 > --- a/gdb/testsuite/gdb.base/attach-pie-noexec.exp > +++ b/gdb/testsuite/gdb.base/attach-pie-noexec.exp > @@ -20,7 +20,7 @@ if {![can_spawn_for_attach]} { > standard_testfile .c > set executable ${testfile} > > -if { [prepare_for_testing "failed to prepare" $executable "" [list > debug "additional_flags=-fPIE -pie"]] } { > +if { [prepare_for_testing "failed to prepare" $executable "" [list > debug "additional_flags=-fPIE" "ldflags=-pie"]] } { > return -1 > } > > diff --git a/gdb/testsuite/gdb.base/break-interp.exp > b/gdb/testsuite/gdb.base/break-interp.exp > index 3a6d9a9..460e5f6 100644 > --- a/gdb/testsuite/gdb.base/break-interp.exp > +++ b/gdb/testsuite/gdb.base/break-interp.exp > @@ -625,7 +625,8 @@ foreach ldprelink {NO YES} { > lappend opts {debug} > } > if {$binpie != "NO"} { > - lappend opts {additional_flags=-fPIE -pie} > + lappend opts {additional_flags=-fPIE} > + lappend opts {ldflags=-pie} > } > > set dir ${exec}.d > diff --git a/gdb/testsuite/gdb.base/jit-attach-pie.exp > b/gdb/testsuite/gdb.base/jit-attach-pie.exp > index da77a4a..eb484a3 100644 > --- a/gdb/testsuite/gdb.base/jit-attach-pie.exp > +++ b/gdb/testsuite/gdb.base/jit-attach-pie.exp > @@ -21,7 +21,7 @@ standard_testfile .c > set executable ${testfile} > > if { [build_executable ${testfile}.exp $executable $srcfile \ > - [list debug pthreads "additional_flags=-fPIE -pie"]] } { > + [list debug pthreads "additional_flags=-fPIE" "ldflags=-pie"]] } > { > return -1 > } LGTM, but out of curiosity, does break-interp.exp work for you (before this patch)? I am seeing many failures, even with GCC. Simon