From 3bb00fafdcc1bf91b76ab428fe2b0077d5ba348b Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 24 Mar 2016 21:45:08 -0700 Subject: [PATCH] scoutfs: require sparse builds Now that we know that it's easy to fix sparse build failures against RHEL kernel headers we can require sparse builds when developing. Signed-off-by: Zach Brown --- kmod/Makefile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/kmod/Makefile b/kmod/Makefile index 07fbc001..1dbc498c 100644 --- a/kmod/Makefile +++ b/kmod/Makefile @@ -1,4 +1,33 @@ ALL: module +# +# SK_KSRC points to the kernel header build dir to build against. +# On a running machine this could be /lib/modules/$(uname -r)/build with +# the right kernel-headers package installed. I tend to build on other +# hosts so I extract the kernel-headers package for the target machine's +# kernel in a dir somehere. +# +# sparse is critical for avoiding endian mistakes. It should just work +# if the sparse package is installed. +# +# but sometimes kernel-headers are broken. For example, the +# rhel 3.10.0-327.el7.x86_64 kernel needs the following patch. +# We'll try to have a git tree with fixed headers. +# +# +# diff --git a/include/linux/rh_kabi.h b/include/linux/rh_kabi.h +# index 1767770..0a8e5f3 100644 +# --- a/include/linux/rh_kabi.h +# +++ b/include/linux/rh_kabi.h +# @@ -73,7 +73,6 @@ +# struct { \ +# _orig; \ +# } __UNIQUE_ID(rh_kabi_hide); \ +# - __RH_KABI_CHECK_SIZE_ALIGN(_orig, _new); \ +# } +# +# #define _RH_KABI_REPLACE_UNSAFE(_orig, _new) _new + module: make CONFIG_SCOUTFS_FS=m -C $(SK_KSRC) M=$(PWD)/src + make C=2 CF="-D__CHECK_ENDIAN__" CONFIG_SCOUTFS_FS=m -C $(SK_KSRC) M=$(PWD)/src