Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: ppluzhnikov@google.com (Paul Pluzhnikov)
To: gdb-patches@sourceware.org
Cc: ppluzhnikov@google.com
Subject: [patch] Cleanup: pass "-pie" only to the linker
Date: Fri, 13 Jan 2012 17:02:00 -0000	[thread overview]
Message-ID: <20120113165503.02937190B08@elbrus2.mtv.corp.google.com> (raw)

Greetings,

When testing GDB with Clang, several compilations fail due to a warning:

  clang -fPIE -pie -c gdb.base/attach-pie-misread.c ...
  clang: warning: argument unused during compilation: '-pie'

(the test harness considers any STDERR output as a failed compilation).

Here is a fix.

Thanks,

--
Paul Pluzhnikov

testsuite/ChangeLog:

2012-01-13  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* gdb.base/attach-pie-misread.exp: Pass -pie only to the linker.
	* gdb.base/pie-execl.exp: Likewise.


Index: testsuite/gdb.base/attach-pie-misread.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/attach-pie-misread.exp,v
retrieving revision 1.5
diff -u -p -r1.5 attach-pie-misread.exp
--- testsuite/gdb.base/attach-pie-misread.exp	4 Jan 2012 08:17:45 -0000	1.5
+++ testsuite/gdb.base/attach-pie-misread.exp	13 Jan 2012 16:48:21 -0000
@@ -27,7 +27,7 @@ set genfile ${objdir}/${subdir}/${test}-
 set executable ${test}
 set binfile ${objdir}/${subdir}/${executable}
 
-if {[build_executable_own_libs ${test}.exp $executable $srcfile [list "additional_flags=-fPIE -pie"]] == ""} {
+if {[build_executable_own_libs ${test}.exp $executable $srcfile [list "additional_flags=-fPIE" "ldflags=-pie"]] == ""} {
     return -1
 }
 
@@ -97,7 +97,7 @@ if {$result == 0} {
     fail $test
 }
 
-set prelink_args [build_executable_own_libs ${test}.exp $executable $srcfile [list "additional_flags=-fPIE -pie -DGEN=\"$genfile\""]]
+set prelink_args [build_executable_own_libs ${test}.exp $executable $srcfile [list "additional_flags=-fPIE -DGEN=\"$genfile\"" "ldflags=-pie"]]
 if {$prelink_args == ""} {
     return -1
 }
Index: testsuite/gdb.base/pie-execl.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/pie-execl.exp,v
retrieving revision 1.4
diff -u -p -r1.4 pie-execl.exp
--- testsuite/gdb.base/pie-execl.exp	4 Jan 2012 08:17:46 -0000	1.4
+++ testsuite/gdb.base/pie-execl.exp	13 Jan 2012 16:48:21 -0000
@@ -37,7 +37,7 @@ set binfile2_test_msg OBJDIR/${subdir}/$
 # Use conditional compilation according to `BIN' as GDB remembers the source
 # file name of the breakpoint.
 
-set opts [list debug {additional_flags=-fPIE -pie}]
+set opts [list debug {"additional_flags=-fPIE" "ldflags=-pie"}]
 if {[build_executable ${testfile}.exp $executable1 $srcfile [concat $opts {additional_flags=-DBIN=1}]] == ""
     || [build_executable ${testfile}.exp $executable2 $srcfile [concat $opts {additional_flags=-DBIN=2}]] == ""} {
     return -1


             reply	other threads:[~2012-01-13 16:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13 17:02 Paul Pluzhnikov [this message]
2012-01-13 18:42 ` Jan Kratochvil
2012-01-13 19:59   ` Paul Pluzhnikov

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=20120113165503.02937190B08@elbrus2.mtv.corp.google.com \
    --to=ppluzhnikov@google.com \
    --cc=gdb-patches@sourceware.org \
    /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