commit: 073fa98637f186287e871249302badd0893f5f15 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> AuthorDate: Wed Dec 16 20:28:58 2015 +0000 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> CommitDate: Wed Dec 16 20:29:39 2015 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=073fa986
sys-apps/memtest86: add fixes from memtest86+ #568292 This fixes building w/gcc-5 and parallel build races. .../files/memtest86-4.3.7-io-extern-inline.patch | 29 ++++++++++++++++++++++ .../memtest86/files/memtest86-4.3.7-no-clean.patch | 16 ++++++++++++ .../files/memtest86-4.3.7-reboot-def.patch | 13 ++++++++++ sys-apps/memtest86/memtest86-4.3.7.ebuild | 3 +++ 4 files changed, 61 insertions(+) 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 new file mode 100644 index 0000000..3e6754d --- /dev/null +++ b/sys-apps/memtest86/files/memtest86-4.3.7-io-extern-inline.patch @@ -0,0 +1,29 @@ +the meaning of extern inline changed between standards. use static inline +for these tiny I/O functions everywhere to keep things simple. + +--- a/io.h ++++ b/io.h +@@ -31,6 +31,6 @@ + */ + + #define __OUT1(s,x) \ +-extern inline void __out##s(unsigned x value, unsigned short port) { ++static inline void __out##s(unsigned x value, unsigned short port) { + + #define __OUT2(s,s1,s2) \ +@@ -43,6 +43,6 @@ + __OUT1(s##c_p,x) __OUT2(s,s1,"") : : "a" (value), "id" (port)); SLOW_DOWN_IO; } + + #define __IN1(s) \ +-extern inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v; ++static inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v; + + #define __IN2(s,s1,s2) \ +@@ -55,6 +55,6 @@ + __IN1(s##c_p) __IN2(s,s1,"") : "=a" (_v) : "id" (port) ,##i ); SLOW_DOWN_IO; return _v; } + + #define __OUTS(s) \ +-extern inline void outs##s(unsigned short port, const void * addr, unsigned long count) \ ++static inline void outs##s(unsigned short port, const void * addr, unsigned long count) \ + { __asm__ __volatile__ ("cld ; rep ; outs" #s \ + : "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); } 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 new file mode 100644 index 0000000..cd8fc66 --- /dev/null +++ b/sys-apps/memtest86/files/memtest86-4.3.7-no-clean.patch @@ -0,0 +1,16 @@ +don't run the clean target when building all as we run into parallel races: + - memtest kicks off building of a bunch of .o files + - clean runs in parallel which runs `rm` and deletes some of the new .o + - memtest goes to link and fails because objects are missing + +--- a/Makefile ++++ b/Makefile +@@ -19,7 +19,7 @@ + OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \ + config.o memsize.o error.o smp.o cpuid.o vmem.o random.o + +-all: clean memtest.bin memtest ++all: memtest.bin memtest + + # Link it statically once so I know I don't have undefined + # symbols and then link it dynamically so I have full 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 new file mode 100644 index 0000000..be9e353 --- /dev/null +++ b/sys-apps/memtest86/files/memtest86-4.3.7-reboot-def.patch @@ -0,0 +1,13 @@ +the reboot func is used elsewhere, so don't mark it inline + +--- a/lib.c ++++ b/lib.c +@@ -33,7 +33,7 @@ struct ascii_map_str { + int keycode; + }; + +-inline void reboot(void) ++void reboot(void) + { + + /* tell the BIOS to do a cold start */ diff --git a/sys-apps/memtest86/memtest86-4.3.7.ebuild b/sys-apps/memtest86/memtest86-4.3.7.ebuild index 7a54382..fd0ec26 100644 --- a/sys-apps/memtest86/memtest86-4.3.7.ebuild +++ b/sys-apps/memtest86/memtest86-4.3.7.ebuild @@ -20,6 +20,9 @@ BOOTDIR=/boot/memtest86 src_prepare() { epatch "${FILESDIR}"/${PN}-4.3.3-build-nopie.patch #66630 + #206726 + epatch "${FILESDIR}"/${PN}-4.3.7-io-extern-inline.patch #548312 #568292 + epatch "${FILESDIR}"/${PN}-4.3.7-reboot-def.patch #548312 #568292 + epatch "${FILESDIR}"/${PN}-4.3.7-no-clean.patch #557890 sed -i -e 's,0x10000,0x100000,' memtest.lds || die