Blame SOURCES/gdb-runtest-pie-override.patch

b94e32
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
b94e32
From: Fedora GDB patches <invalid@email.com>
b94e32
Date: Fri, 27 Oct 2017 21:07:50 +0200
b94e32
Subject: gdb-runtest-pie-override.patch
b94e32
b94e32
;; Hack for proper PIE run of the testsuite.
b94e32
;;=fedoratest
b94e32
b94e32
make check//unix/-fPIE/-pie RUNTESTFLAGS=solib-display.exp
b94e32
b94e32
gcc -fpic -c  -fPIE -pie -o x.o x.c
b94e32
/usr/lib/gcc/x86_64-redhat-linux/4.6.1/../../../../lib64/Scrt1.o: In function `_start':
b94e32
(.text+0x20): undefined reference to `main'
b94e32
b94e32
=> Change the order for overrides.
b94e32
b94e32
One has to also use -fPIC rather than -fPIE, -fPIC is stronger.
b94e32
b94e32
The correct way would be:
b94e32
make check//unix RUNTESTFLAGS='CC_FOR_TARGET=gcc\ -fPIC\ -pie CXX_FOR_TARGET=g++\ -fPIC\ -pie solib-display.exp'
b94e32
b94e32
But there is a problem with testsuite.unix non-unique subdir name and also
b94e32
a problem with make -j parallelization of the testsuite.
b94e32
b94e32
diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp
b94e32
--- a/gdb/testsuite/lib/future.exp
b94e32
+++ b/gdb/testsuite/lib/future.exp
b94e32
@@ -197,6 +197,10 @@ proc gdb_default_target_compile_1 {source destfile type options} {
b94e32
     set ldflags ""
b94e32
     set dest [target_info name]
b94e32
 
b94e32
+    if {[board_info $dest exists multilib_flags]} {
b94e32
+	append add_flags " [board_info $dest multilib_flags]"
b94e32
+    }
b94e32
+
b94e32
     if {[info exists CFLAGS_FOR_TARGET]} {
b94e32
 	append add_flags " $CFLAGS_FOR_TARGET"
b94e32
     }
b94e32
@@ -531,10 +535,6 @@ proc gdb_default_target_compile_1 {source destfile type options} {
b94e32
 	}
b94e32
     }
b94e32
 
b94e32
-    if {[board_info $dest exists multilib_flags]} {
b94e32
-	append add_flags " [board_info $dest multilib_flags]"
b94e32
-    }
b94e32
-
b94e32
     verbose "doing compile"
b94e32
 
b94e32
     set sources ""