From cd44f5be37d994a59b6afac8eb3b3827ad63212f Mon Sep 17 00:00:00 2001 From: Matthew Macy Date: Tue, 24 Nov 2020 09:16:46 -0800 Subject: [PATCH] FreeBSD: decouple ZFS_DEBUG from kernel debug settings Reviewed-by: Martelli Nikola @martellini Reviewed-by: Ryan Moeller Signed-off-by: Matt Macy Closes #11213 --- module/Makefile.bsd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/module/Makefile.bsd b/module/Makefile.bsd index 1acf543ac..e7cddcc5b 100644 --- a/module/Makefile.bsd +++ b/module/Makefile.bsd @@ -39,7 +39,13 @@ CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_SSE2 -DHAVE_AVX512F -DHAVE_SSS .endif .if defined(WITH_DEBUG) && ${WITH_DEBUG} == "true" -CFLAGS+= -DINVARIANTS -DWITNESS -g -O0 -DZFS_DEBUG -DOPENSOLARIS_WITNESS +CFLAGS+= -DZFS_DEBUG -g +.if defined(WITH_INVARIANTS) && ${WITH_INVARIANTS} == "true" + CFLAGS+= -DINVARIANTS -DWITNESS -DOPENSOLARIS_WITNESS +.endif +.if defined(WITH_O0) && ${WITH_O0} == "true" + CFLAGS+= -O0 +.endif .else CFLAGS += -DNDEBUG .endif