From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- sys-freebsd/boot0/files/boot0-10.1-gcc46.patch | 67 ++++++++++++++++++++++ sys-freebsd/boot0/files/boot0-10.3-clang.patch | 30 ++++++++++ .../files/boot0-10.3-drop-unsupport-cflags.patch | 28 +++++++++ .../boot0/files/boot0-10.3-uefi-support.patch | 33 +++++++++++ sys-freebsd/boot0/files/boot0-11.0-gcc46.patch | 14 +++++ .../boot0/files/boot0-11.0-uefi-support.patch | 21 +++++++ .../boot0/files/boot0-8.2-zfsboot-makefile.patch | 13 +++++ sys-freebsd/boot0/files/boot0-9.2-gcc46.patch | 66 +++++++++++++++++++++ .../boot0/files/boot0-add-nossp-cflags.patch | 11 ++++ 9 files changed, 283 insertions(+) create mode 100644 sys-freebsd/boot0/files/boot0-10.1-gcc46.patch create mode 100644 sys-freebsd/boot0/files/boot0-10.3-clang.patch create mode 100644 sys-freebsd/boot0/files/boot0-10.3-drop-unsupport-cflags.patch create mode 100644 sys-freebsd/boot0/files/boot0-10.3-uefi-support.patch create mode 100644 sys-freebsd/boot0/files/boot0-11.0-gcc46.patch create mode 100644 sys-freebsd/boot0/files/boot0-11.0-uefi-support.patch create mode 100644 sys-freebsd/boot0/files/boot0-8.2-zfsboot-makefile.patch create mode 100644 sys-freebsd/boot0/files/boot0-9.2-gcc46.patch create mode 100644 sys-freebsd/boot0/files/boot0-add-nossp-cflags.patch (limited to 'sys-freebsd/boot0/files') diff --git a/sys-freebsd/boot0/files/boot0-10.1-gcc46.patch b/sys-freebsd/boot0/files/boot0-10.1-gcc46.patch new file mode 100644 index 000000000000..9b31e7c0d1ba --- /dev/null +++ b/sys-freebsd/boot0/files/boot0-10.1-gcc46.patch @@ -0,0 +1,67 @@ +diff --git a/sys/boot/i386/Makefile.inc b/sys/boot/i386/Makefile.inc +index 472b275..0c9409d 100644 +--- a/sys/boot/i386/Makefile.inc ++++ b/sys/boot/i386/Makefile.inc +@@ -13,8 +13,6 @@ LDFLAGS+= -nostdlib + .if ${MACHINE_CPUARCH} == "amd64" + CFLAGS+= -m32 + ACFLAGS+= -m32 +-# LD_FLAGS is passed directly to ${LD}, not via ${CC}: +-LD_FLAGS+= -m elf_i386_fbsd + AFLAGS+= --32 + .endif + +diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile +index 428950e..6a15450 100644 +--- a/sys/boot/i386/boot2/Makefile ++++ b/sys/boot/i386/boot2/Makefile +@@ -113,3 +113,10 @@ machine: + # XXX: clang integrated-as doesn't grok .codeNN directives yet + CFLAGS.boot1.S= ${CLANG_NO_IAS} + CFLAGS+= ${CFLAGS.${.IMPSRC:T}} ++ ++# gcc 4.6 or later version, -fno-asynchronous-unwind-tables is required to build. ++CFLAGS+= -fno-asynchronous-unwind-tables ++ ++.if ${MACHINE_CPUARCH} == "amd64" ++LD_FLAGS+= -m elf_i386_fbsd ++.endif +diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile +index a90e712..d60ae00 100644 +--- a/sys/boot/i386/gptboot/Makefile ++++ b/sys/boot/i386/gptboot/Makefile +@@ -81,3 +81,8 @@ machine: + # XXX: clang integrated-as doesn't grok .codeNN directives yet + CFLAGS.gptldr.S= ${CLANG_NO_IAS} + CFLAGS+= ${CFLAGS.${.IMPSRC:T}} ++ ++.if ${MACHINE_CPUARCH} == "amd64" ++LD_FLAGS+= -m elf_i386_fbsd ++.endif ++ +diff --git a/sys/boot/i386/gptzfsboot/Makefile b/sys/boot/i386/gptzfsboot/Makefile +index 5eb2383..c10a917 100644 +--- a/sys/boot/i386/gptzfsboot/Makefile ++++ b/sys/boot/i386/gptzfsboot/Makefile +@@ -78,3 +78,8 @@ machine: + # XXX: clang integrated-as doesn't grok .codeNN directives yet + CFLAGS.gptldr.S= ${CLANG_NO_IAS} + CFLAGS+= ${CFLAGS.${.IMPSRC:T}} ++ ++.if ${MACHINE_CPUARCH} == "amd64" ++LD_FLAGS+= -m elf_i386_fbsd ++.endif ++ +diff --git a/sys/boot/i386/zfsboot/Makefile b/sys/boot/i386/zfsboot/Makefile +index 149f43a..be1e46a 100644 +--- a/sys/boot/i386/zfsboot/Makefile ++++ b/sys/boot/i386/zfsboot/Makefile +@@ -91,3 +91,8 @@ machine: + # XXX: clang integrated-as doesn't grok .codeNN directives yet + CFLAGS.zfsldr.S= ${CLANG_NO_IAS} + CFLAGS+= ${CFLAGS.${.IMPSRC:T}} ++ ++.if ${MACHINE_CPUARCH} == "amd64" ++LD_FLAGS+= -m elf_i386_fbsd ++.endif ++ diff --git a/sys-freebsd/boot0/files/boot0-10.3-clang.patch b/sys-freebsd/boot0/files/boot0-10.3-clang.patch new file mode 100644 index 000000000000..4245e21a96e1 --- /dev/null +++ b/sys-freebsd/boot0/files/boot0-10.3-clang.patch @@ -0,0 +1,30 @@ +Gentoo Bug: https://bugs.gentoo.org/show_bug.cgi?id=542676 + +https://svnweb.freebsd.org/base/head/sys/boot/i386/boot2/Makefile?r1=272249&r2=276479 + +diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile +index 8a6e771..c030853 100644 +--- a/sys/boot/i386/boot2/Makefile ++++ b/sys/boot/i386/boot2/Makefile +@@ -22,8 +22,7 @@ BOOT2_UFS?= UFS1_AND_UFS2 + #BOOT2_UFS?= UFS2_ONLY + #BOOT2_UFS?= UFS1_ONLY + +-CFLAGS= -Os \ +- -fomit-frame-pointer \ ++CFLAGS= -fomit-frame-pointer \ + -mrtd \ + -mregparm=3 \ + -DUSE_XREAD \ +@@ -40,7 +39,10 @@ CFLAGS= -Os \ + -Winline \ + ${CLANG_OPT_SMALL} + +-CFLAGS.gcc+= -fno-guess-branch-probability \ ++CFLAGS.clang+= -Oz ++ ++CFLAGS.gcc+= -Os \ ++ -fno-guess-branch-probability \ + -fno-unit-at-a-time \ + --param max-inline-insns-single=100 + .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201 diff --git a/sys-freebsd/boot0/files/boot0-10.3-drop-unsupport-cflags.patch b/sys-freebsd/boot0/files/boot0-10.3-drop-unsupport-cflags.patch new file mode 100644 index 000000000000..af1d3512e7da --- /dev/null +++ b/sys-freebsd/boot0/files/boot0-10.3-drop-unsupport-cflags.patch @@ -0,0 +1,28 @@ +diff --git a/sys/boot/efi/libefi/Makefile b/sys/boot/efi/libefi/Makefile +index fc66e01..470453d 100644 +--- a/sys/boot/efi/libefi/Makefile ++++ b/sys/boot/efi/libefi/Makefile +@@ -17,9 +17,6 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand + # Pick up the bootstrap header for some interface items + CFLAGS+= -I${.CURDIR}/../../common + +- +-# Suppress warning from clang for FreeBSD %b and %D formats +-CFLAGS+= -fformat-extensions + CFLAGS+= -DTERM_EMU + + .include +diff --git a/sys/boot/i386/libi386/Makefile b/sys/boot/i386/libi386/Makefile +index 24cc4c1..e5d2bae 100644 +--- a/sys/boot/i386/libi386/Makefile ++++ b/sys/boot/i386/libi386/Makefile +@@ -55,9 +55,6 @@ CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../common \ + # the location of libstand + CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ + +-# Suppress warning from clang for FreeBSD %b and %D formats +-CFLAGS+= -fformat-extensions +- + .if ${MACHINE_CPUARCH} == "amd64" + CLEANFILES+= machine + machine: diff --git a/sys-freebsd/boot0/files/boot0-10.3-uefi-support.patch b/sys-freebsd/boot0/files/boot0-10.3-uefi-support.patch new file mode 100644 index 000000000000..fdafe74252bc --- /dev/null +++ b/sys-freebsd/boot0/files/boot0-10.3-uefi-support.patch @@ -0,0 +1,33 @@ +diff --git a/efi/Makefile b/efi/Makefile +index 30024e3..a33efb2 100644 +--- a/efi/Makefile ++++ b/efi/Makefile +@@ -2,15 +2,10 @@ + + .include + +-# In-tree GCC does not support __attribute__((ms_abi)). +-.if ${COMPILER_TYPE} != "gcc" +- + .if ${MACHINE_CPUARCH} == "amd64" + SUBDIR+= libefi loader boot1 + .endif + +-.endif # ${COMPILER_TYPE} != "gcc" +- + .if ${MACHINE_CPUARCH} == "ia64" + SUBDIR+= libefi + .endif +diff --git a/efi/boot1/Makefile b/efi/boot1/Makefile +index 4ffdfda..8ec0e00 100644 +--- a/efi/boot1/Makefile ++++ b/efi/boot1/Makefile +@@ -64,7 +64,7 @@ LDFLAGS+= -Wl,-znocombreloc + # Add libstand for required string and memory functions for all platforms. + # + DPADD+= ${LIBSTAND} +-LDADD+= -lstand ++LDADD+= ${LIBSTAND} + + DPADD+= ${LDSCRIPT} + diff --git a/sys-freebsd/boot0/files/boot0-11.0-gcc46.patch b/sys-freebsd/boot0/files/boot0-11.0-gcc46.patch new file mode 100644 index 000000000000..ec17d92b5790 --- /dev/null +++ b/sys-freebsd/boot0/files/boot0-11.0-gcc46.patch @@ -0,0 +1,14 @@ +diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile +index ead9ad1..af5e021 100644 +--- a/sys/boot/i386/boot2/Makefile ++++ b/sys/boot/i386/boot2/Makefile +@@ -45,6 +45,9 @@ CFLAGS.gcc+= -Os \ + .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201 + CFLAGS.gcc+= -mno-align-long-strings + .endif ++.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40600 ++CFLAGS.gcc+= -fno-asynchronous-unwind-tables ++.endif + + CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} + diff --git a/sys-freebsd/boot0/files/boot0-11.0-uefi-support.patch b/sys-freebsd/boot0/files/boot0-11.0-uefi-support.patch new file mode 100644 index 000000000000..c7a69d62aa8b --- /dev/null +++ b/sys-freebsd/boot0/files/boot0-11.0-uefi-support.patch @@ -0,0 +1,21 @@ +diff --git a/sys/boot/efi/Makefile b/sys/boot/efi/Makefile +index 79ee9a9..f7789f1 100644 +--- a/sys/boot/efi/Makefile ++++ b/sys/boot/efi/Makefile +@@ -4,7 +4,7 @@ + + # In-tree GCC does not support __attribute__((ms_abi)), but gcc newer + # than 4.5 supports it. +-.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 404500 ++.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 + + .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" + .if ${MK_FDT} != "no" +@@ -18,6 +18,6 @@ SUBDIR+= fdt + SUBDIR+= libefi loader boot1 + .endif + +-.endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 404500 ++.endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 + + .include diff --git a/sys-freebsd/boot0/files/boot0-8.2-zfsboot-makefile.patch b/sys-freebsd/boot0/files/boot0-8.2-zfsboot-makefile.patch new file mode 100644 index 000000000000..a3a33d5d7c5b --- /dev/null +++ b/sys-freebsd/boot0/files/boot0-8.2-zfsboot-makefile.patch @@ -0,0 +1,13 @@ +diff --git a/sys/boot/i386/zfsboot/Makefile b/sys/boot/i386/zfsboot/Makefile +index bb16ea3..7dedb49 100644 +--- a/sys/boot/i386/zfsboot/Makefile ++++ b/sys/boot/i386/zfsboot/Makefile +@@ -83,6 +83,8 @@ zfsboot.bin: zfsboot.out + zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o + ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} + ++drv.o: drv.c xreadorg.h ++ + zfsboot.o: zfsboot.s + + SRCS= zfsboot.c xreadorg.h diff --git a/sys-freebsd/boot0/files/boot0-9.2-gcc46.patch b/sys-freebsd/boot0/files/boot0-9.2-gcc46.patch new file mode 100644 index 000000000000..ffd9f4351d1f --- /dev/null +++ b/sys-freebsd/boot0/files/boot0-9.2-gcc46.patch @@ -0,0 +1,66 @@ +diff --git a/sys/boot/i386/Makefile.inc b/sys/boot/i386/Makefile.inc +index f5faec7..a9cf593 100644 +--- a/sys/boot/i386/Makefile.inc ++++ b/sys/boot/i386/Makefile.inc +@@ -12,7 +12,6 @@ LDFLAGS+= -nostdlib + .if ${MACHINE_CPUARCH} == "amd64" + CFLAGS+= -m32 + ACFLAGS+= -m32 +-LDFLAGS+= -m elf_i386_fbsd + AFLAGS+= --32 + .endif + +diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile +index 65815a5..61840dd 100644 +--- a/sys/boot/i386/boot2/Makefile ++++ b/sys/boot/i386/boot2/Makefile +@@ -109,3 +109,10 @@ machine: + # XXX: clang integrated-as doesn't grok .codeNN directives yet + CFLAGS.boot1.S= ${CLANG_NO_IAS} + CFLAGS+= ${CFLAGS.${.IMPSRC:T}} ++ ++# gcc 4.6 or later version, -fno-asynchronous-unwind-tables is required to build. ++CFLAGS+= -fno-asynchronous-unwind-tables ++ ++.if ${MACHINE_CPUARCH} == "amd64" ++LDFLAGS+= -m elf_i386_fbsd ++.endif +diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile +index e1a640a..29886cc 100644 +--- a/sys/boot/i386/gptboot/Makefile ++++ b/sys/boot/i386/gptboot/Makefile +@@ -78,3 +78,8 @@ machine: + # XXX: clang integrated-as doesn't grok .codeNN directives yet + CFLAGS.gptldr.S= ${CLANG_NO_IAS} + CFLAGS+= ${CFLAGS.${.IMPSRC:T}} ++ ++.if ${MACHINE_CPUARCH} == "amd64" ++LDFLAGS+= -m elf_i386_fbsd ++.endif ++ +diff --git a/sys/boot/i386/gptzfsboot/Makefile b/sys/boot/i386/gptzfsboot/Makefile +index a2b8fcc..107f531 100644 +--- a/sys/boot/i386/gptzfsboot/Makefile ++++ b/sys/boot/i386/gptzfsboot/Makefile +@@ -76,3 +76,8 @@ machine: + # XXX: clang integrated-as doesn't grok .codeNN directives yet + CFLAGS.gptldr.S= ${CLANG_NO_IAS} + CFLAGS+= ${CFLAGS.${.IMPSRC:T}} ++ ++.if ${MACHINE_CPUARCH} == "amd64" ++LDFLAGS+= -m elf_i386_fbsd ++.endif ++ +diff --git a/sys/boot/i386/zfsboot/Makefile b/sys/boot/i386/zfsboot/Makefile +index b2db778..252dc62 100644 +--- a/sys/boot/i386/zfsboot/Makefile ++++ b/sys/boot/i386/zfsboot/Makefile +@@ -89,3 +89,8 @@ machine: + # XXX: clang integrated-as doesn't grok .codeNN directives yet + CFLAGS.zfsldr.S= ${CLANG_NO_IAS} + CFLAGS+= ${CFLAGS.${.IMPSRC:T}} ++ ++.if ${MACHINE_CPUARCH} == "amd64" ++LDFLAGS+= -m elf_i386_fbsd ++.endif ++ diff --git a/sys-freebsd/boot0/files/boot0-add-nossp-cflags.patch b/sys-freebsd/boot0/files/boot0-add-nossp-cflags.patch new file mode 100644 index 000000000000..abc6a57bf4b0 --- /dev/null +++ b/sys-freebsd/boot0/files/boot0-add-nossp-cflags.patch @@ -0,0 +1,11 @@ +https://bugs.gentoo.org/show_bug.cgi?id=511698 + +diff --git a/sys/boot/Makefile.inc b/sys/boot/Makefile.inc +index e0039b9..533dea0 100644 +--- a/sys/boot/Makefile.inc ++++ b/sys/boot/Makefile.inc +@@ -1,3 +1,3 @@ + # $FreeBSD: release/10.0.0/sys/boot/Makefile.inc 188895 2009-02-21 15:04:31Z ru $ + +-SSP_CFLAGS= ++SSP_CFLAGS= -fno-stack-protector -- cgit v1.2.3