From 0e24d1834aa1c082e686de29e84a1f4dea93854b Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Sat, 7 May 2005 21:22:32 +0000 Subject: [PATCH] Fix compilation with gcc40: Only use -fno-stack-protector with gcc versions which have propolice support. --- sys/boot/i386/boot2/Makefile | 9 +++++++-- sys/boot/pc32/boot2/Makefile | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile index 91ce6f2984..cd692042f2 100644 --- a/sys/boot/i386/boot2/Makefile +++ b/sys/boot/i386/boot2/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.47 2003/06/26 03:51:57 peter Exp $ -# $DragonFly: src/sys/boot/i386/boot2/Attic/Makefile,v 1.12 2004/09/12 18:37:15 dillon Exp $ +# $DragonFly: src/sys/boot/i386/boot2/Attic/Makefile,v 1.13 2005/05/07 21:22:32 corecode Exp $ PROG= boot2 NOMAN= @@ -51,7 +51,7 @@ BOOT2_UFS?= UFS1_ONLY # gcc3.x # -fno-guess-branch-probability # -mno-align-long-strings -CFLAGS= -elf -ffreestanding -Os -fno-builtin -fno-stack-protector \ +CFLAGS= -elf -ffreestanding -Os -fno-builtin \ -fomit-frame-pointer \ -D${BOOT2_UFS} \ -I${.CURDIR}/../../common \ @@ -83,6 +83,11 @@ MRTDFLAGS= CFLAGS+= -fno-unit-at-a-time .endif +# Disable propolice on gcc that support it +.if ${CCVER} == "gcc2" || ${CCVER} == "gcc34" +CFLAGS+= -fno-stack-protector +.endif + LDFLAGS=-nostdlib -static -N --gc-sections all: boot1 boot2 boot diff --git a/sys/boot/pc32/boot2/Makefile b/sys/boot/pc32/boot2/Makefile index 058fe49f62..30e269021f 100644 --- a/sys/boot/pc32/boot2/Makefile +++ b/sys/boot/pc32/boot2/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.47 2003/06/26 03:51:57 peter Exp $ -# $DragonFly: src/sys/boot/pc32/boot2/Makefile,v 1.12 2004/09/12 18:37:15 dillon Exp $ +# $DragonFly: src/sys/boot/pc32/boot2/Makefile,v 1.13 2005/05/07 21:22:32 corecode Exp $ PROG= boot2 NOMAN= @@ -51,7 +51,7 @@ BOOT2_UFS?= UFS1_ONLY # gcc3.x # -fno-guess-branch-probability # -mno-align-long-strings -CFLAGS= -elf -ffreestanding -Os -fno-builtin -fno-stack-protector \ +CFLAGS= -elf -ffreestanding -Os -fno-builtin \ -fomit-frame-pointer \ -D${BOOT2_UFS} \ -I${.CURDIR}/../../common \ @@ -83,6 +83,11 @@ MRTDFLAGS= CFLAGS+= -fno-unit-at-a-time .endif +# Disable propolice on gcc that support it +.if ${CCVER} == "gcc2" || ${CCVER} == "gcc34" +CFLAGS+= -fno-stack-protector +.endif + LDFLAGS=-nostdlib -static -N --gc-sections all: boot1 boot2 boot -- 2.41.0