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

f9426a
make check//unix/-fPIE/-pie RUNTESTFLAGS=solib-display.exp
f9426a
f9426a
gcc -fpic -c  -fPIE -pie -o x.o x.c
f9426a
/usr/lib/gcc/x86_64-redhat-linux/4.6.1/../../../../lib64/Scrt1.o: In function `_start':
f9426a
(.text+0x20): undefined reference to `main'
f9426a
f9426a
=> Change the order for overrides.
f9426a
f9426a
One has to also use -fPIC rather than -fPIE, -fPIC is stronger.
f9426a
f9426a
The correct way would be:
f9426a
make check//unix RUNTESTFLAGS='CC_FOR_TARGET=gcc\ -fPIC\ -pie CXX_FOR_TARGET=g++\ -fPIC\ -pie solib-display.exp'
f9426a
f9426a
But there is a problem with testsuite.unix non-unique subdir name and also
f9426a
a problem with make -j parallelization of the testsuite.
f9426a
f9426a
--- gdb-7.3.50.20110722/gdb/testsuite/lib/future.exp	2011-10-11 16:44:05.000000000 +0200
f9426a
+++ gdb-7.3.50.20110722/gdb/testsuite/lib/future.exp	2011-10-11 16:44:10.000000000 +0200
f9426a
@@ -77,6 +77,10 @@ proc gdb_default_target_compile {source
f9426a
     set ldflags ""
f9426a
     set dest [target_info name]
f9426a
 
f9426a
+    if {[board_info $dest exists multilib_flags]} {
f9426a
+	append add_flags " [board_info $dest multilib_flags]"
f9426a
+    }
f9426a
+
f9426a
     if {[info exists CFLAGS_FOR_TARGET]} {
f9426a
 	append add_flags " $CFLAGS_FOR_TARGET"
f9426a
     }
f9426a
@@ -333,10 +337,6 @@ proc gdb_default_target_compile {source
f9426a
 	}
f9426a
     }
f9426a
 
f9426a
-    if {[board_info $dest exists multilib_flags]} {
f9426a
-	append add_flags " [board_info $dest multilib_flags]"
f9426a
-    }
f9426a
-
f9426a
     verbose "doing compile"
f9426a
 
f9426a
     set sources ""