]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - gdb/patches/gdb-runtest-pie-override.patch
Merge remote-tracking branch 'stevee/audit'
[people/ms/ipfire-3.x.git] / gdb / patches / gdb-runtest-pie-override.patch
1 make check//unix/-fPIE/-pie RUNTESTFLAGS=solib-display.exp
2
3 gcc -fpic -c -fPIE -pie -o x.o x.c
4 /usr/lib/gcc/x86_64-redhat-linux/4.6.1/../../../../lib64/Scrt1.o: In function `_start':
5 (.text+0x20): undefined reference to `main'
6
7 => Change the order for overrides.
8
9 One has to also use -fPIC rather than -fPIE, -fPIC is stronger.
10
11 The correct way would be:
12 make check//unix RUNTESTFLAGS='CC_FOR_TARGET=gcc\ -fPIC\ -pie CXX_FOR_TARGET=g++\ -fPIC\ -pie solib-display.exp'
13
14 But there is a problem with testsuite.unix non-unique subdir name and also
15 a problem with make -j parallelization of the testsuite.
16
17 --- gdb-7.3.50.20110722/gdb/testsuite/lib/future.exp 2011-10-11 16:44:05.000000000 +0200
18 +++ gdb-7.3.50.20110722/gdb/testsuite/lib/future.exp2 2011-10-11 16:44:10.000000000 +0200
19 @@ -77,6 +77,10 @@ proc gdb_default_target_compile {source
20 set ldflags ""
21 set dest [target_info name]
22
23 + if {[board_info $dest exists multilib_flags]} {
24 + append add_flags " [board_info $dest multilib_flags]"
25 + }
26 +
27 if {[info exists CFLAGS_FOR_TARGET]} {
28 append add_flags " $CFLAGS_FOR_TARGET"
29 }
30 @@ -333,10 +337,6 @@ proc gdb_default_target_compile {source
31 }
32 }
33
34 - if {[board_info $dest exists multilib_flags]} {
35 - append add_flags " [board_info $dest multilib_flags]"
36 - }
37 -
38 verbose "doing compile"
39
40 set sources ""