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

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