diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2018-07-27 22:10:47 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-30 12:44:35 +0100 |
commit | c40f535fbf173c5da2a9b3eeb73efc7385a9eeab (patch) | |
tree | e32505d2551ead6cdc663781d653ad34249eb1c2 /meta/recipes-devtools/valgrind | |
parent | c06cd35debf722c9d01536a912e8733ef6ebb36a (diff) | |
download | poky-c40f535fbf173c5da2a9b3eeb73efc7385a9eeab.tar.gz |
valgrind: fix compile ptest failure on mips32
- Pass mips32's CFLAGS to tests
- Fix broken inline asm in tests on mips32-linux
- Build mips n32 successfully, support it.
(From OE-Core rev: 23d9eba99d1180a0b859aadc23a10b391b8f6440)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/valgrind')
3 files changed, 131 insertions, 1 deletions
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-fix-opcode-not-supported-on-mips32-linux.patch b/meta/recipes-devtools/valgrind/valgrind/0001-fix-opcode-not-supported-on-mips32-linux.patch new file mode 100644 index 0000000000..39b624d9f6 --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind/0001-fix-opcode-not-supported-on-mips32-linux.patch | |||
@@ -0,0 +1,82 @@ | |||
1 | From fb5362f205b37c5060fcd764a7ed393abe4f2f3d Mon Sep 17 00:00:00 2001 | ||
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
3 | Date: Fri, 27 Jul 2018 17:39:37 +0800 | ||
4 | Subject: [PATCH 1/2] fix opcode not supported on mips32-linux | ||
5 | |||
6 | While build tests(`make check') on mips32-linux, there are | ||
7 | serial failures such as: | ||
8 | [snip] | ||
9 | | mips-wrsmllib32-linux-gcc -meb -mabi=32 -mhard-float -c | ||
10 | -o atomic_incs-atomic_incs.o `test -f 'atomic_incs.c' || echo | ||
11 | '../../../valgrind-3.13.0/memcheck/tests/'`atomic_incs.c | ||
12 | | /tmp/ccqrmINN.s: Assembler messages: | ||
13 | | /tmp/ccqrmINN.s:247: Error: opcode not supported on this | ||
14 | processor: mips1 (mips1) `ll $t3,0($t1)' | ||
15 | | /tmp/ccqrmINN.s:249: Error: opcode not supported on this | ||
16 | processor: mips1 (mips1) `sc $t3,0($t1)' | ||
17 | [snip] | ||
18 | |||
19 | Since the following commit applied, it defines CLFAGS for mips32, | ||
20 | but missed to pass them to tests which caused the above failure | ||
21 | ... | ||
22 | 3e344c57f Merge in a port for mips32-linux | ||
23 | ... | ||
24 | |||
25 | Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=396905] | ||
26 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
27 | --- | ||
28 | helgrind/tests/Makefile.am | 5 +++++ | ||
29 | memcheck/tests/Makefile.am | 5 +++++ | ||
30 | none/tests/mips32/Makefile.am | 4 ++++ | ||
31 | 3 files changed, 14 insertions(+) | ||
32 | |||
33 | diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am | ||
34 | index ad1af191a..6209d35a7 100644 | ||
35 | --- a/helgrind/tests/Makefile.am | ||
36 | +++ b/helgrind/tests/Makefile.am | ||
37 | @@ -214,6 +214,11 @@ check_PROGRAMS += annotate_rwlock | ||
38 | endif | ||
39 | |||
40 | AM_CFLAGS += $(AM_FLAG_M3264_PRI) | ||
41 | + | ||
42 | +if VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX | ||
43 | +AM_CFLAGS += $(AM_CFLAGS_MIPS32_LINUX) | ||
44 | +endif | ||
45 | + | ||
46 | AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) | ||
47 | |||
48 | LDADD = -lpthread | ||
49 | diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am | ||
50 | index 84e49405f..aff861a32 100644 | ||
51 | --- a/memcheck/tests/Makefile.am | ||
52 | +++ b/memcheck/tests/Makefile.am | ||
53 | @@ -443,6 +443,11 @@ check_PROGRAMS += reach_thread_register | ||
54 | endif | ||
55 | |||
56 | AM_CFLAGS += $(AM_FLAG_M3264_PRI) | ||
57 | + | ||
58 | +if VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX | ||
59 | +AM_CFLAGS += $(AM_CFLAGS_MIPS32_LINUX) | ||
60 | +endif | ||
61 | + | ||
62 | AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) | ||
63 | |||
64 | if VGCONF_PLATFORMS_INCLUDE_ARM_LINUX | ||
65 | diff --git a/none/tests/mips32/Makefile.am b/none/tests/mips32/Makefile.am | ||
66 | index d11591d45..602cd26f6 100644 | ||
67 | --- a/none/tests/mips32/Makefile.am | ||
68 | +++ b/none/tests/mips32/Makefile.am | ||
69 | @@ -99,6 +99,10 @@ check_PROGRAMS = \ | ||
70 | round_fpu64 \ | ||
71 | fpu_branches | ||
72 | |||
73 | +if VGCONF_PLATFORMS_INCLUDE_MIPS32_LINUX | ||
74 | +AM_CFLAGS += $(AM_CFLAGS_MIPS32_LINUX) | ||
75 | +endif | ||
76 | + | ||
77 | AM_CFLAGS += @FLAG_M32@ | ||
78 | AM_CXXFLAGS += @FLAG_M32@ | ||
79 | AM_CCASFLAGS += @FLAG_M32@ | ||
80 | -- | ||
81 | 2.17.1 | ||
82 | |||
diff --git a/meta/recipes-devtools/valgrind/valgrind/0002-fix-broken-inline-asm-in-tests-on-mips32-linux.patch b/meta/recipes-devtools/valgrind/valgrind/0002-fix-broken-inline-asm-in-tests-on-mips32-linux.patch new file mode 100644 index 0000000000..6df295f8a2 --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind/0002-fix-broken-inline-asm-in-tests-on-mips32-linux.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 63ce36396348e7c4c021cffa652d2e3d20f7963a Mon Sep 17 00:00:00 2001 | ||
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
3 | Date: Fri, 27 Jul 2018 17:51:54 +0800 | ||
4 | Subject: [PATCH 2/2] fix broken inline asm in tests on mips32-linux | ||
5 | |||
6 | While build tests(`make check') with gcc 8.1.0 on mips32-linux, | ||
7 | there is a failure | ||
8 | [snip] | ||
9 | |mips-wrsmllib32-linux-gcc -meb -mabi=32 -mhard-float -march=mips32 | ||
10 | -c -o tc08_hbl2-tc08_hbl2.o `test -f 'tc08_hbl2.c' || echo '../../../ | ||
11 | valgrind-3.13.0/helgrind/tests/'`tc08_hbl2.c | ||
12 | |/tmp/cc37aJxQ.s: Assembler messages: | ||
13 | |/tmp/cc37aJxQ.s:275: Error: symbol `L1xyzzy1main' is already defined | ||
14 | |Makefile:1323: recipe for target 'tc08_hbl2-tc08_hbl2.o' failed | ||
15 | [snip] | ||
16 | |||
17 | Remove the duplicated L1xyzzy1main, and use local symbol to replace. | ||
18 | http://tigcc.ticalc.org/doc/gnuasm.html#SEC46 | ||
19 | |||
20 | Upstream-Status: Submitted [https://bugs.kde.org/show_bug.cgi?id=396906] | ||
21 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
22 | --- | ||
23 | helgrind/tests/tc08_hbl2.c | 4 ++-- | ||
24 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
25 | |||
26 | diff --git a/helgrind/tests/tc08_hbl2.c b/helgrind/tests/tc08_hbl2.c | ||
27 | index 2a757a008..f660d82dd 100644 | ||
28 | --- a/helgrind/tests/tc08_hbl2.c | ||
29 | +++ b/helgrind/tests/tc08_hbl2.c | ||
30 | @@ -121,12 +121,12 @@ | ||
31 | #elif defined(PLAT_mips32_linux) || defined(PLAT_mips64_linux) | ||
32 | # define INC(_lval,_lqual) \ | ||
33 | __asm__ __volatile__ ( \ | ||
34 | - "L1xyzzy1" _lqual":\n" \ | ||
35 | + "1:\n" \ | ||
36 | " move $t0, %0\n" \ | ||
37 | " ll $t1, 0($t0)\n" \ | ||
38 | " addiu $t1, $t1, 1\n" \ | ||
39 | " sc $t1, 0($t0)\n" \ | ||
40 | - " beqz $t1, L1xyzzy1" _lqual \ | ||
41 | + " beqz $t1, 1b\n" \ | ||
42 | : /*out*/ : /*in*/ "r"(&(_lval)) \ | ||
43 | : /*trash*/ "t0", "t1", "memory" \ | ||
44 | ) | ||
45 | -- | ||
46 | 2.17.1 | ||
47 | |||
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.13.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.13.0.bb index d3af35e7f8..39ec6f5cc8 100644 --- a/meta/recipes-devtools/valgrind/valgrind_3.13.0.bb +++ b/meta/recipes-devtools/valgrind/valgrind_3.13.0.bb | |||
@@ -37,6 +37,8 @@ SRC_URI = "ftp://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \ | |||
37 | file://link-gz-tests.patch \ | 37 | file://link-gz-tests.patch \ |
38 | file://ppc-headers.patch \ | 38 | file://ppc-headers.patch \ |
39 | file://mask-CPUID-support-in-HWCAP-on-aarch64.patch \ | 39 | file://mask-CPUID-support-in-HWCAP-on-aarch64.patch \ |
40 | file://0001-fix-opcode-not-supported-on-mips32-linux.patch \ | ||
41 | file://0002-fix-broken-inline-asm-in-tests-on-mips32-linux.patch \ | ||
40 | " | 42 | " |
41 | SRC_URI[md5sum] = "817dd08f1e8a66336b9ff206400a5369" | 43 | SRC_URI[md5sum] = "817dd08f1e8a66336b9ff206400a5369" |
42 | SRC_URI[sha256sum] = "d76680ef03f00cd5e970bbdcd4e57fb1f6df7d2e2c071635ef2be74790190c3b" | 44 | SRC_URI[sha256sum] = "d76680ef03f00cd5e970bbdcd4e57fb1f6df7d2e2c071635ef2be74790190c3b" |
@@ -54,7 +56,6 @@ COMPATIBLE_HOST_linux-gnux32 = 'null' | |||
54 | COMPATIBLE_HOST_linux-muslx32 = 'null' | 56 | COMPATIBLE_HOST_linux-muslx32 = 'null' |
55 | 57 | ||
56 | # Disable for some MIPS variants | 58 | # Disable for some MIPS variants |
57 | COMPATIBLE_HOST_mipsarchn32 = 'null' | ||
58 | COMPATIBLE_HOST_mipsarchr6 = 'null' | 59 | COMPATIBLE_HOST_mipsarchr6 = 'null' |
59 | 60 | ||
60 | inherit autotools ptest multilib_header | 61 | inherit autotools ptest multilib_header |