[patch] Cleanup: pass "-pie" only to the linker
Paul Pluzhnikov
ppluzhnikov@google.com
Fri Jan 13 17:02:00 GMT 2012
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
More information about the Gdb-patches
mailing list