public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [testsuite] Pass -pie in ldflags
@ 2017-11-17 15:22 Yao Qi
  2017-11-17 16:41 ` Simon Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2017-11-17 15:22 UTC (permalink / raw)
  To: gdb-patches

-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
 }
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [testsuite] Pass -pie in ldflags
  2017-11-17 15:22 [PATCH] [testsuite] Pass -pie in ldflags Yao Qi
@ 2017-11-17 16:41 ` Simon Marchi
  2017-11-22 14:37   ` Yao Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2017-11-17 16:41 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] [testsuite] Pass -pie in ldflags
  2017-11-17 16:41 ` Simon Marchi
@ 2017-11-22 14:37   ` Yao Qi
  0 siblings, 0 replies; 3+ messages in thread
From: Yao Qi @ 2017-11-22 14:37 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

On 17-11-17 11:41:12, Simon Marchi wrote:
> 
> LGTM, but out of curiosity, does break-interp.exp work for you (before this
> patch)?  I am seeing many failures, even with GCC.
>

No, there are many fails in break-interp.exp.  Patch is pushed in.
 
-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-22 14:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-17 15:22 [PATCH] [testsuite] Pass -pie in ldflags Yao Qi
2017-11-17 16:41 ` Simon Marchi
2017-11-22 14:37   ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).