1 |
commit: 073fa98637f186287e871249302badd0893f5f15 |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 16 20:28:58 2015 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 16 20:29:39 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=073fa986 |
7 |
|
8 |
sys-apps/memtest86: add fixes from memtest86+ #568292 |
9 |
|
10 |
This fixes building w/gcc-5 and parallel build races. |
11 |
|
12 |
.../files/memtest86-4.3.7-io-extern-inline.patch | 29 ++++++++++++++++++++++ |
13 |
.../memtest86/files/memtest86-4.3.7-no-clean.patch | 16 ++++++++++++ |
14 |
.../files/memtest86-4.3.7-reboot-def.patch | 13 ++++++++++ |
15 |
sys-apps/memtest86/memtest86-4.3.7.ebuild | 3 +++ |
16 |
4 files changed, 61 insertions(+) |
17 |
|
18 |
diff --git a/sys-apps/memtest86/files/memtest86-4.3.7-io-extern-inline.patch b/sys-apps/memtest86/files/memtest86-4.3.7-io-extern-inline.patch |
19 |
new file mode 100644 |
20 |
index 0000000..3e6754d |
21 |
--- /dev/null |
22 |
+++ b/sys-apps/memtest86/files/memtest86-4.3.7-io-extern-inline.patch |
23 |
@@ -0,0 +1,29 @@ |
24 |
+the meaning of extern inline changed between standards. use static inline |
25 |
+for these tiny I/O functions everywhere to keep things simple. |
26 |
+ |
27 |
+--- a/io.h |
28 |
++++ b/io.h |
29 |
+@@ -31,6 +31,6 @@ |
30 |
+ */ |
31 |
+ |
32 |
+ #define __OUT1(s,x) \ |
33 |
+-extern inline void __out##s(unsigned x value, unsigned short port) { |
34 |
++static inline void __out##s(unsigned x value, unsigned short port) { |
35 |
+ |
36 |
+ #define __OUT2(s,s1,s2) \ |
37 |
+@@ -43,6 +43,6 @@ |
38 |
+ __OUT1(s##c_p,x) __OUT2(s,s1,"") : : "a" (value), "id" (port)); SLOW_DOWN_IO; } |
39 |
+ |
40 |
+ #define __IN1(s) \ |
41 |
+-extern inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v; |
42 |
++static inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v; |
43 |
+ |
44 |
+ #define __IN2(s,s1,s2) \ |
45 |
+@@ -55,6 +55,6 @@ |
46 |
+ __IN1(s##c_p) __IN2(s,s1,"") : "=a" (_v) : "id" (port) ,##i ); SLOW_DOWN_IO; return _v; } |
47 |
+ |
48 |
+ #define __OUTS(s) \ |
49 |
+-extern inline void outs##s(unsigned short port, const void * addr, unsigned long count) \ |
50 |
++static inline void outs##s(unsigned short port, const void * addr, unsigned long count) \ |
51 |
+ { __asm__ __volatile__ ("cld ; rep ; outs" #s \ |
52 |
+ : "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); } |
53 |
|
54 |
diff --git a/sys-apps/memtest86/files/memtest86-4.3.7-no-clean.patch b/sys-apps/memtest86/files/memtest86-4.3.7-no-clean.patch |
55 |
new file mode 100644 |
56 |
index 0000000..cd8fc66 |
57 |
--- /dev/null |
58 |
+++ b/sys-apps/memtest86/files/memtest86-4.3.7-no-clean.patch |
59 |
@@ -0,0 +1,16 @@ |
60 |
+don't run the clean target when building all as we run into parallel races: |
61 |
+ - memtest kicks off building of a bunch of .o files |
62 |
+ - clean runs in parallel which runs `rm` and deletes some of the new .o |
63 |
+ - memtest goes to link and fails because objects are missing |
64 |
+ |
65 |
+--- a/Makefile |
66 |
++++ b/Makefile |
67 |
+@@ -19,7 +19,7 @@ |
68 |
+ OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \ |
69 |
+ config.o memsize.o error.o smp.o cpuid.o vmem.o random.o |
70 |
+ |
71 |
+-all: clean memtest.bin memtest |
72 |
++all: memtest.bin memtest |
73 |
+ |
74 |
+ # Link it statically once so I know I don't have undefined |
75 |
+ # symbols and then link it dynamically so I have full |
76 |
|
77 |
diff --git a/sys-apps/memtest86/files/memtest86-4.3.7-reboot-def.patch b/sys-apps/memtest86/files/memtest86-4.3.7-reboot-def.patch |
78 |
new file mode 100644 |
79 |
index 0000000..be9e353 |
80 |
--- /dev/null |
81 |
+++ b/sys-apps/memtest86/files/memtest86-4.3.7-reboot-def.patch |
82 |
@@ -0,0 +1,13 @@ |
83 |
+the reboot func is used elsewhere, so don't mark it inline |
84 |
+ |
85 |
+--- a/lib.c |
86 |
++++ b/lib.c |
87 |
+@@ -33,7 +33,7 @@ struct ascii_map_str { |
88 |
+ int keycode; |
89 |
+ }; |
90 |
+ |
91 |
+-inline void reboot(void) |
92 |
++void reboot(void) |
93 |
+ { |
94 |
+ |
95 |
+ /* tell the BIOS to do a cold start */ |
96 |
|
97 |
diff --git a/sys-apps/memtest86/memtest86-4.3.7.ebuild b/sys-apps/memtest86/memtest86-4.3.7.ebuild |
98 |
index 7a54382..fd0ec26 100644 |
99 |
--- a/sys-apps/memtest86/memtest86-4.3.7.ebuild |
100 |
+++ b/sys-apps/memtest86/memtest86-4.3.7.ebuild |
101 |
@@ -20,6 +20,9 @@ BOOTDIR=/boot/memtest86 |
102 |
|
103 |
src_prepare() { |
104 |
epatch "${FILESDIR}"/${PN}-4.3.3-build-nopie.patch #66630 + #206726 |
105 |
+ epatch "${FILESDIR}"/${PN}-4.3.7-io-extern-inline.patch #548312 #568292 |
106 |
+ epatch "${FILESDIR}"/${PN}-4.3.7-reboot-def.patch #548312 #568292 |
107 |
+ epatch "${FILESDIR}"/${PN}-4.3.7-no-clean.patch #557890 |
108 |
|
109 |
sed -i -e 's,0x10000,0x100000,' memtest.lds || die |