From a7827ead44ae51493babff5475c7c6a1a4b2b8d685da91fcf18ac13146f9bf09 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 31 Jul 2014 15:39:20 +0000 Subject: [PATCH] Accepting request 243156 from home:coolo:branches:openSUSE:Factory - make it work by picking patches from Fedora - memtest doesn't like optimizations with newer compilers. See https://bugs.mageia.org/show_bug.cgi?id=11661 and fedora bugs. - Added patches (all from fedora pkg): memtest86+-5.01-array-size-fix.patch memtest86+-5.01-compile-fix.patch memtest86+-5.01-no-optimization.patch OBS-URL: https://build.opensuse.org/request/show/243156 OBS-URL: https://build.opensuse.org/package/show/Base:System/memtest86+?expand=0&rev=22 --- memtest86+-5.01-array-size-fix.patch | 20 ++++++++++++++++++++ memtest86+-5.01-compile-fix.patch | 20 ++++++++++++++++++++ memtest86+-5.01-no-optimization.patch | 11 +++++++++++ memtest86+.changes | 13 +++++++++++++ memtest86+.spec | 22 ++++++---------------- 5 files changed, 70 insertions(+), 16 deletions(-) create mode 100644 memtest86+-5.01-array-size-fix.patch create mode 100644 memtest86+-5.01-compile-fix.patch create mode 100644 memtest86+-5.01-no-optimization.patch diff --git a/memtest86+-5.01-array-size-fix.patch b/memtest86+-5.01-array-size-fix.patch new file mode 100644 index 0000000..cdfbb9f --- /dev/null +++ b/memtest86+-5.01-array-size-fix.patch @@ -0,0 +1,20 @@ +--- memtest86+-5.01/controller.c~ 2013-08-10 02:01:58.000000000 +0000 ++++ memtest86+-5.01/controller.c 2013-12-12 20:58:12.873555378 +0000 +@@ -292,7 +292,7 @@ + + /* First, locate the PCI bus where the MCH is located */ + +- for(i = 0; i < sizeof(possible_nhm_bus); i++) { ++ for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) { + pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid); + pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did); + vid &= 0xFFFF; +@@ -327,7 +327,7 @@ + ctrl.mode = ECC_NONE; + + /* First, locate the PCI bus where the MCH is located */ +- for(i = 0; i < sizeof(possible_nhm_bus); i++) { ++ for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) { + pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid); + pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did); + vid &= 0xFFFF; diff --git a/memtest86+-5.01-compile-fix.patch b/memtest86+-5.01-compile-fix.patch new file mode 100644 index 0000000..fee6c85 --- /dev/null +++ b/memtest86+-5.01-compile-fix.patch @@ -0,0 +1,20 @@ +--- memtest86+-5.01/io.h~ 2013-08-10 02:01:58.000000000 +0000 ++++ memtest86+-5.01/io.h 2014-01-08 01:29:12.404465515 +0000 +@@ -31,7 +31,7 @@ + */ + + #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) \ + __asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1" +@@ -43,7 +43,7 @@ + __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) \ + __asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0" diff --git a/memtest86+-5.01-no-optimization.patch b/memtest86+-5.01-no-optimization.patch new file mode 100644 index 0000000..018ba80 --- /dev/null +++ b/memtest86+-5.01-no-optimization.patch @@ -0,0 +1,11 @@ +--- memtest86+-5.01/Makefile~ 2014-01-08 01:30:11.355900076 +0000 ++++ memtest86+-5.01/Makefile 2014-01-08 01:31:19.387555469 +0000 +@@ -12,7 +12,7 @@ + AS=as -32 + CC=gcc + +-CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin \ ++CFLAGS= -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin \ + -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector + + OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \ diff --git a/memtest86+.changes b/memtest86+.changes index f41b632..aceb82b 100644 --- a/memtest86+.changes +++ b/memtest86+.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Thu Jul 31 12:26:33 UTC 2014 - coolo@suse.com + +- make it work by picking patches from Fedora - memtest doesn't like + optimizations with newer compilers. + + See https://bugs.mageia.org/show_bug.cgi?id=11661 and fedora bugs. + +- Added patches (all from fedora pkg): + memtest86+-5.01-array-size-fix.patch + memtest86+-5.01-compile-fix.patch + memtest86+-5.01-no-optimization.patch + ------------------------------------------------------------------- Thu Nov 7 10:57:28 UTC 2013 - duwe@suse.com diff --git a/memtest86+.spec b/memtest86+.spec index f1bfdb6..fdb6d60 100644 --- a/memtest86+.spec +++ b/memtest86+.spec @@ -16,7 +16,6 @@ # - Name: memtest86+ Version: 5.01 Release: 0 @@ -37,6 +36,9 @@ Provides: memtest86 > 3.2 Url: http://www.memtest.org Source: http://www.memtest.org/download/%{version}/%{name}-%{version}.tar.gz Patch0: fix-destdir +Patch1: memtest86+-5.01-no-optimization.patch +Patch2: memtest86+-5.01-compile-fix.patch +Patch3: memtest86+-5.01-array-size-fix.patch Summary: Memory Testing Image for x86 Architecture License: BSD-3-Clause Group: System/Boot @@ -45,24 +47,12 @@ Group: System/Boot Memtest86 is an image that can be booted instead of a real OS. Once booted, it can be used to test the computer's memory. - - -Authors: --------- - Samuel Demeulemeester - Original memtest86 package: - John Coffman - Werner Almesberger - PowerPC part: - Paul Mackeras - Cort Dougan - Benjamin Herrenschmidt - Memtest86: - Chris Brady - %prep %setup %patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build make