]> git.ipfire.org Git - people/ms/ipfire-3.x.git/commitdiff
memtest86+: Updates on the build process. memtest86+
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 5 Feb 2012 14:54:53 +0000 (15:54 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 5 Feb 2012 14:56:04 +0000 (15:56 +0100)
Builds now an ELF image and a floppy image.

memtest86+/memtest86+.nm
memtest86+/patches/memtest86+-4.10-hardcoded_cc.patch [new file with mode: 0644]

index 0e5e44445a66a03d10504d03000aad2775cbac96..4405906096aa5a4d06aad324ed1bb20fa0e1eae7 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = memtest86+
 version    = 4.20
-release    = 4
+release    = 5
 sup_arches = i686 x86_64
 
 groups     = System/Base
@@ -23,16 +23,34 @@ end
 source_dl  =
 
 build
-       CFLAGS += -fno-builtin -ffreestanding
+       # Empty the CFLAGS.
+       CFLAGS =
+
+       prepare_cmds
+               # Dirty hack copied from xen.nm.
+               ln -s stubs-64.h /usr/include/gnu/stubs-32.h
+
+               sed -i -e 's/$(LD) -s /$(LD) /' -e 's/-nopie//' Makefile
+               sed -i memtest.lds -e 's,0x5000,0x100000,'
+
+               if [ "%{DISTRO_ARCH}" = "x86_64" ]; then
+                       sed -i Makefile \
+                               -e 's,$(LD) -s -T memtest.lds,$(LD) -s -T memtest.lds -z max-page-size=0x1000,'
+               fi
+       end
 
        build
-               make CC="gcc -fno-stack-protector -fno-PIE" \
-                       CFLAGS="%{CFLAGS}" memtest.bin %{PARALLELISMFLAGS}
+               make %{PARALLELISMFLAGS}
        end
 
        install
                mkdir -pv %{BUILDROOT}/boot
-               cp -vf memtest.bin %{BUILDROOT}/boot/memtest86+
+
+               # The ELF version.
+               install -m 644 -v memtest %{BUILDROOT}/boot/elf-%{name}-%{version}
+
+               # The floppy version.
+               install -m 644 -v memtest.bin %{BUILDROOT}/boot/%{name}-%{version}
 
                mkdir -pv %{BUILDROOT}/etc/grub.d
                cp -vf %{DIR_SOURCE}/%{name}.grub %{BUILDROOT}/etc/grub.d/20_%{name}
diff --git a/memtest86+/patches/memtest86+-4.10-hardcoded_cc.patch b/memtest86+/patches/memtest86+-4.10-hardcoded_cc.patch
new file mode 100644 (file)
index 0000000..ed0705c
--- /dev/null
@@ -0,0 +1,30 @@
+diff -Naurp memtest86+-4.10-orig/Makefile memtest86+-4.10/Makefile
+--- memtest86+-4.10-orig/Makefile      2010-06-24 00:27:22.864634431 +0200
++++ memtest86+-4.10/Makefile   2010-06-24 00:28:42.402478590 +0200
+@@ -8,10 +8,9 @@
+ #
+ FDISK=/dev/fd0
+-AS=as -32
+-CC=gcc
+-
+-CFLAGS= -Wall -march=i486 -m32 -O2 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC -fno-stack-protector
++CFLAGS=-Wall -march=i486 -m32 -O2 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC -fno-stack-protector
++CPPFLAGS=-m32
++ASFLAGS=-32
+ OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
+       config.o linuxbios.o memsize.o pci.o controller.o random.o spd.o \
+@@ -47,10 +46,10 @@ memtest.bin: memtest_shared.bin bootsect
+       memtest_shared.bin -o memtest.bin
+ reloc.o: reloc.c
+-      $(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c
++      $(CC) -c $(CFLAGS) -fno-strict-aliasing -fno-stack-protector reloc.c
+ test.o: test.c
+-      $(CC) -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding test.c
++      $(CC) -c -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fno-pie -nopie test.c
+ clean:
+       rm -f *.o *.s *.iso memtest.bin memtest memtest_shared memtest_shared.bin