From 6e0f1c3b45102e7644d25cf34395ca980414317f Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 10 Jul 2019 12:42:54 -0500 Subject: [PATCH] LINUX: Honor --enable-checking for libafs When we build the kernel module on LINUX, we don't pass in any of our CFLAGS, since the Linux buildsystem itself figures out what flags are needed. However, this means that we don't pass in -Werror when --enable-checking is turned on, so warnings may not cause the build to fail. To fix this, create a new autoconf variable, called CFLAGS_WERROR, that only contains -Werror if --enable-checking is turned on. We then pass that into the Linux module buildsystem, so -Werror is given to the compiler when building our module. Change-Id: I0f1ec8b1a8096d10642c67b86314604c20ea2c60 Reviewed-on: https://gerrit.openafs.org/13682 Reviewed-by: Cheyenne Wills Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- src/cf/osconf.m4 | 2 ++ src/libafs/MakefileProto.LINUX.in | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 index c87abde..b737041 100644 --- a/src/cf/osconf.m4 +++ b/src/cf/osconf.m4 @@ -633,6 +633,7 @@ if test "x$GCC" = "xyes"; then fi if test "x$enable_checking" != "xno"; then XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Werror -fdiagnostics-show-option -Wpointer-arith" + CFLAGS_WERROR="-Werror" if test "x$enable_checking" != "xall"; then CFLAGS_NOERROR="-Wno-error" CFLAGS_NOUNUSED="-Wno-unused" @@ -713,6 +714,7 @@ AC_SUBST(CFLAGS_NOERROR) AC_SUBST(CFLAGS_NOSTRICT) AC_SUBST(CFLAGS_NOUNUSED) AC_SUBST(CFLAGS_NOOLDSTYLE) +AC_SUBST(CFLAGS_WERROR) AC_SUBST(XCFLAGS64) AC_SUBST(XLDFLAGS) AC_SUBST(XLDFLAGS64) diff --git a/src/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in index 7c057d1..8c659c7 100644 --- a/src/libafs/MakefileProto.LINUX.in +++ b/src/libafs/MakefileProto.LINUX.in @@ -126,7 +126,7 @@ EXTRA_CFLAGS = -I$(LINUX_KERNEL_PATH)/arch/um/include -I$(LINUX_KERNEL_PATH)/arc INCLUDES = -I. -I../ -I${TOP_OBJDIR}/src/config \ -I${TOP_SRCDIR}/rx -I${TOP_OBJDIR}/src/rxstat -CFLAGS = $(CCFLAGS) $(KERN_DBG) $(DEFINES) $(INCLUDES) +CFLAGS = $(CCFLAGS) $(KERN_DBG) $(DEFINES) $(INCLUDES) @CFLAGS_WERROR@ # Name of directory to hold object files and libraries. KOBJ = MODLOAD -- 1.9.4