From: Sascha Wildner Date: Thu, 31 Aug 2017 19:10:09 +0000 (+0200) Subject: sys/boot: Disable -fstack-protector for now. X-Git-Tag: v5.1.0~175 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/3738d8a80313dbd349ce50fff75859fc455c9ba8 sys/boot: Disable -fstack-protector for now. The rest of world builds fine with -fstack-protector* --- diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile index 3b43b28827..94c2199cab 100644 --- a/lib/libstand/Makefile +++ b/lib/libstand/Makefile @@ -23,6 +23,9 @@ LIBC_SRC= ${LIBSTAND_SRC}/../libc # Mostly OK, some of the libc imports are a bit noisy CFLAGS+= -ffreestanding +# Disable stack protector +CFLAGS+= -fno-stack-protector + .if (${CFLAGS:M-flto} && ${CCVER:Mgcc*}) CFLAGS+= -fno-builtin # LTO exposes too much stuff .endif diff --git a/sys/boot/dloader/Makefile b/sys/boot/dloader/Makefile index 5e9da61996..70fc8fb394 100644 --- a/sys/boot/dloader/Makefile +++ b/sys/boot/dloader/Makefile @@ -6,6 +6,9 @@ SRCS= subs.c cmds.c WORLD_CCOPTLEVEL= 1 # Force -O1, -O2 implodes +# Disable stack protector +CFLAGS+= -fno-stack-protector + # For i386, dloader32/Makefile takes care of the extra CFLAGS .if ${MACHINE_ARCH} != "i386" CFLAGS+= -fPIC -mno-red-zone diff --git a/sys/boot/efi/boot1/Makefile b/sys/boot/efi/boot1/Makefile index 2682283072..1ca65e8f12 100644 --- a/sys/boot/efi/boot1/Makefile +++ b/sys/boot/efi/boot1/Makefile @@ -16,6 +16,10 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica/source/include CFLAGS+= -I${.CURDIR}/../../../contrib/edk2/Include CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -DEFI_UFS_BOOT + +# Disable stack protector +CFLAGS+= -fno-stack-protector + .ifdef(EFI_DEBUG) CFLAGS+= -DEFI_DEBUG .endif diff --git a/sys/boot/efi/libefi/Makefile b/sys/boot/efi/libefi/Makefile index c5ade87a24..262c754d4b 100644 --- a/sys/boot/efi/libefi/Makefile +++ b/sys/boot/efi/libefi/Makefile @@ -18,6 +18,9 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand # Pick up the bootstrap header for some interface items CFLAGS+= -I${.CURDIR}/../../common +# Disable stack protector +CFLAGS+= -fno-stack-protector + # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} CFLAGS+= -DTERM_EMU diff --git a/sys/boot/efi/loader/arch/x86_64/Makefile.inc b/sys/boot/efi/loader/arch/x86_64/Makefile.inc index a41e2eecaa..e3a66777de 100644 --- a/sys/boot/efi/loader/arch/x86_64/Makefile.inc +++ b/sys/boot/efi/loader/arch/x86_64/Makefile.inc @@ -9,6 +9,9 @@ SRCS+= amd64_tramp.S \ SRCS+= nullconsole.c \ comconsole.c +# Disable stack protector +CFLAGS+= -fno-stack-protector + CFLAGS+= -fPIC CFLAGS+= -I${.CURDIR}/../../../contrib/edk2/Include LDFLAGS+= -Wl,-znocombreloc diff --git a/sys/boot/pc64/Makefile.inc b/sys/boot/pc64/Makefile.inc index 53202c8898..e7b90f6258 100644 --- a/sys/boot/pc64/Makefile.inc +++ b/sys/boot/pc64/Makefile.inc @@ -3,6 +3,9 @@ __pc64__: .MAKEFLAGS: MACHINE_ARCH=i386 MACHINE=i386 REALLY_X86_64=true +# Disable stack protector +CFLAGS+= -fno-stack-protector + CFLAGS+= -m32 LDFLAGS+= -m elf_i386 COMPILER_LDFLAGS+= -Wl,-m,elf_i386