From: Simon Marchi <simon.marchi@polymtl.ca>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] [testsuite] Pass -pie in ldflags
Date: Fri, 17 Nov 2017 16:41:00 -0000 [thread overview]
Message-ID: <ebf98192deca703dcdc5df921cd26209@polymtl.ca> (raw)
In-Reply-To: <1510932126-11752-1-git-send-email-yao.qi@linaro.org>
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 <yao.qi@linaro.org>
>
> * 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
next prev parent reply other threads:[~2017-11-17 16:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-17 15:22 Yao Qi
2017-11-17 16:41 ` Simon Marchi [this message]
2017-11-22 14:37 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ebf98192deca703dcdc5df921cd26209@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox