aboutsummaryrefslogtreecommitdiff
path: root/package/memtester/0002-fix-build-with-gcc-10.patch
blob: 8c9b3945bb75096428b2a6845a943f2b3349eeac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
From acd226cd4073b77abce8783e19c5ef3bbf8074ef Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Fri, 11 Sep 2020 21:39:03 +0200
Subject: [PATCH] fix build with gcc 10

Move mword8 and mword16 from types.h to tests.c to avoid the following
build failure with gcc 10 (which defaults to -fno-common):

/srv/storage/autobuild/run/instance-3/output-1/host/lib/gcc/arm-buildroot-linux-gnueabihf/10.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: tests.o: in function `.LANCHOR1':
tests.c:(.bss+0x4): multiple definition of `mword16'; memtester.o:memtester.c:(.bss+0xc): first defined here
/srv/storage/autobuild/run/instance-3/output-1/host/lib/gcc/arm-buildroot-linux-gnueabihf/10.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: tests.o: in function `.LANCHOR1':
tests.c:(.bss+0x0): multiple definition of `mword8'; memtester.o:memtester.c:(.bss+0x10): first defined here

Fixes:
 - http://autobuild.buildroot.org/results/e1c276603475a952847fd53724e56101cdccbbcb

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: sent to charlesc@pyropus.ca]
---
 tests.c | 10 ++++++++++
 types.h | 10 ----------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests.c b/tests.c
index be1b350..d3d25c7 100644
--- a/tests.c
+++ b/tests.c
@@ -22,6 +22,16 @@
 #include "sizes.h"
 #include "memtester.h"
 
+union {
+    unsigned char bytes[UL_LEN/8];
+    ul val;
+} mword8;
+
+union {
+    unsigned short u16s[UL_LEN/16];
+    ul val;
+} mword16;
+
 char progress[] = "-\\|/";
 #define PROGRESSLEN 4
 #define PROGRESSOFTEN 2500
diff --git a/types.h b/types.h
index ad7ce73..dca7fc0 100644
--- a/types.h
+++ b/types.h
@@ -24,13 +24,3 @@ struct test {
     char *name;
     int (*fp)();
 };
-
-union {
-    unsigned char bytes[UL_LEN/8];
-    ul val;
-} mword8;
-
-union {
-    unsigned short u16s[UL_LEN/16];
-    ul val;
-} mword16;
-- 
2.28.0