From 1d8e5bde8f2ce2f4245703fc4baf22a9e80efcd6 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Wed, 23 Nov 2011 16:32:48 +0100 Subject: memtest86+: fix building with gcc-4.6 Signed-off-by: Michael Olbrich --- .../0001-Remove-hardcoded-cc-variable.patch | 47 ++++++++++++++++++++++ ...se-serial-port-addresses-provided-by-BIOS.patch | 33 +++++++++++++++ .../memtest86+-4.10-hardcoded_cc.patch | 39 ------------------ patches/memtest86+-4.20/serial_base.patch | 26 ------------ patches/memtest86+-4.20/series | 7 +++- 5 files changed, 85 insertions(+), 67 deletions(-) create mode 100644 patches/memtest86+-4.20/0001-Remove-hardcoded-cc-variable.patch create mode 100644 patches/memtest86+-4.20/0002-Use-serial-port-addresses-provided-by-BIOS.patch delete mode 100644 patches/memtest86+-4.20/memtest86+-4.10-hardcoded_cc.patch delete mode 100755 patches/memtest86+-4.20/serial_base.patch diff --git a/patches/memtest86+-4.20/0001-Remove-hardcoded-cc-variable.patch b/patches/memtest86+-4.20/0001-Remove-hardcoded-cc-variable.patch new file mode 100644 index 000000000..c10ce9333 --- /dev/null +++ b/patches/memtest86+-4.20/0001-Remove-hardcoded-cc-variable.patch @@ -0,0 +1,47 @@ +From: Alexander Stein +Date: Wed, 23 Nov 2011 16:30:13 +0100 +Subject: [PATCH] Remove hardcoded cc variable + +This patch is from Gentoo. +URL: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/memtest86+/files/memtest86+-4.10-hardcoded_cc.patch?revision=1.1 + +This patch cleans up the Makefile to allow overwrite CC and AS variable + +Signed-off-by: Alexander Stein +[mol: remove "-nopie", not available with gcc-4.6 here] +Signed-off-by: Michael Olbrich +--- + Makefile | 11 +++++------ + 1 files changed, 5 insertions(+), 6 deletions(-) + +diff --git a/Makefile b/Makefile +index f51b813..f8066d0 100644 +--- a/Makefile ++++ b/Makefile +@@ -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.o setup.o memtest.bin.lds + 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 test.c + + clean: + rm -f *.o *.s *.iso memtest.bin memtest memtest_shared memtest_shared.bin diff --git a/patches/memtest86+-4.20/0002-Use-serial-port-addresses-provided-by-BIOS.patch b/patches/memtest86+-4.20/0002-Use-serial-port-addresses-provided-by-BIOS.patch new file mode 100644 index 000000000..9747df736 --- /dev/null +++ b/patches/memtest86+-4.20/0002-Use-serial-port-addresses-provided-by-BIOS.patch @@ -0,0 +1,33 @@ +From: Alexander Stein +Date: Wed, 23 Nov 2011 16:30:13 +0100 +Subject: [PATCH] Use serial port addresses provided by BIOS + +Using this patch memtest86+ uses the serial port addresses provided by BIOS rather hardcoded defaults. + +Signed-off-by: Alexander Stein +--- + lib.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/lib.c b/lib.c +index d107039..91ea950 100644 +--- a/lib.c ++++ b/lib.c +@@ -24,7 +24,7 @@ short serial_cons = SERIAL_CONSOLE_DEFAULT; + #error Bad SERIAL_TTY. Only ttyS0 and ttyS1 are supported. + #endif + short serial_tty = SERIAL_TTY; +-const short serial_base_ports[] = {0x3f8, 0x2f8, 0x3e8, 0x2e8}; ++unsigned short serial_base_ports[] = {0x3f8, 0x2f8, 0x3e8, 0x2e8}; + + #if ((115200%SERIAL_BAUD_RATE) != 0) + #error Bad default baud rate +@@ -1112,6 +1112,8 @@ void serial_console_setup(char *param) + serial_baud_rate = (int) baud_rate; + save_tty: + serial_tty = (short) tty; ++ /* fetch I/O port address from BIOS data area */ ++ serial_base_ports[serial_tty] = ((const unsigned short *) 0x0400)[serial_tty]; + serial_cons = 1; + } + diff --git a/patches/memtest86+-4.20/memtest86+-4.10-hardcoded_cc.patch b/patches/memtest86+-4.20/memtest86+-4.10-hardcoded_cc.patch deleted file mode 100644 index 4841b1d15..000000000 --- a/patches/memtest86+-4.20/memtest86+-4.10-hardcoded_cc.patch +++ /dev/null @@ -1,39 +0,0 @@ -Subject: Remove hardcoded cc variable - -This patch is from Gentoo. -URL: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/memtest86+/files/memtest86+-4.10-hardcoded_cc.patch?revision=1.1 - -This patch cleans up the Makefile to allow overwrite CC and AS variable - -Signed-off-by: Alexander Stein - -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 diff --git a/patches/memtest86+-4.20/serial_base.patch b/patches/memtest86+-4.20/serial_base.patch deleted file mode 100755 index ea18382d4..000000000 --- a/patches/memtest86+-4.20/serial_base.patch +++ /dev/null @@ -1,26 +0,0 @@ -Subject: Use serial port addresses provided by BIOS - -Using this patch memtest86+ uses the serial port addresses provided by BIOS rather hardcoded defaults. - -Signed-off-by: Alexander Stein - ---- memtest86+-4.20/lib.c 2011-01-23 19:11:04.000000000 +0100 -+++ memtest86+-4.20/lib.c 2011-03-30 09:31:38.519674571 +0200 -@@ -24,7 +24,7 @@ - #error Bad SERIAL_TTY. Only ttyS0 and ttyS1 are supported. - #endif - short serial_tty = SERIAL_TTY; --const short serial_base_ports[] = {0x3f8, 0x2f8, 0x3e8, 0x2e8}; -+unsigned short serial_base_ports[] = {0x3f8, 0x2f8, 0x3e8, 0x2e8}; - - #if ((115200%SERIAL_BAUD_RATE) != 0) - #error Bad default baud rate -@@ -1112,6 +1112,8 @@ - serial_baud_rate = (int) baud_rate; - save_tty: - serial_tty = (short) tty; -+ /* fetch I/O port address from BIOS data area */ -+ serial_base_ports[serial_tty] = ((const unsigned short *) 0x0400)[serial_tty]; - serial_cons = 1; - } - diff --git a/patches/memtest86+-4.20/series b/patches/memtest86+-4.20/series index 70c0db89c..992ddd113 100644 --- a/patches/memtest86+-4.20/series +++ b/patches/memtest86+-4.20/series @@ -1,2 +1,5 @@ -memtest86+-4.10-hardcoded_cc.patch -serial_base.patch +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-Remove-hardcoded-cc-variable.patch +0002-Use-serial-port-addresses-provided-by-BIOS.patch +# ac32e21dd23823fda596f9b6028589c5 - git-ptx-patches magic -- cgit v1.2.3