From 3f5144b3edfca5187ce417da8929eea86c930ef0 Mon Sep 17 00:00:00 2001 From: Ben Kaduk Date: Wed, 30 Jun 2010 00:40:09 -0400 Subject: [PATCH] Disable red zones for amd64 FBSD kernel code The kernel has been compiled with -mno-red-zone since at least FreeBSD 5.0; when we compile libafs.ko with red zones enabled and interact with the red-zone-less kernel, we get occasional stack corruption, which manifests itself in a variety of unpleasant ways. The flags we pass to gcc for our module build currently differ substantially from those used during a kernel build (or modules built with the kernel); I hope to transition to a module build process involving bsd.kmod.mk in the relatively near future. Change-Id: I406e264c1f96e1d893b9d12b561f48a3cbfdf57c Reviewed-on: http://gerrit.openafs.org/2297 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/libafs/MakefileProto.FBSD.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libafs/MakefileProto.FBSD.in b/src/libafs/MakefileProto.FBSD.in index cce28dc..2035135 100644 --- a/src/libafs/MakefileProto.FBSD.in +++ b/src/libafs/MakefileProto.FBSD.in @@ -38,6 +38,8 @@ KSRC = @BSD_KERNEL_PATH@ KBLD = @BSD_KERNEL_BUILD@ KOPTS = -fPIC + +KOPTS += -mno-red-zone KDEFS=-Wall -nostdinc -I/usr/include -D_KERNEL -DKLD_MODULE \ -- 1.9.4