aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorPeter Levine <[email protected]>2022-02-02 00:44:59 -0500
committerBrian Behlendorf <[email protected]>2022-02-09 13:24:22 -0800
commitb66140c6ad481cb13e685465c6a732f7f2b9dc77 (patch)
treedd57c1127a27b18a55fe7387d4a7451775c37316 /module
parent8e94ac0e36c552ec1a852be8efc0a2811cef2932 (diff)
Add support for $KERNEL_{CC,LD,LLVM} variables
Currently, $(CC), $(LD), and $(LLVM) variables aren't passed to kbuild while building modules. This causes modules to build with the default GNU GCC toolchain and prevents experimenting with other toolchains such as CLANG/LLVM. It can also lead to build failure if the CFLAGS/LDFLAGS passed are incompatible with gcc/ld. Pass $KERNEL_CC, $KERNEL_LD, and $KERNEL_LLVM as $(CC), $(LD), and $(LLVM), respectively, to kbuild for each that is defined in the environment. This should take care of the majority of alternative toolchain use cases. Reviewed-by: Damian Szuberski <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Peter Levine <[email protected]> Closes #13046
Diffstat (limited to 'module')
-rw-r--r--module/Makefile.in4
1 files changed, 3 insertions, 1 deletions
diff --git a/module/Makefile.in b/module/Makefile.in
index 9cd075e68..b6338430e 100644
--- a/module/Makefile.in
+++ b/module/Makefile.in
@@ -52,7 +52,9 @@ FMAKE = env -u MAKEFLAGS make $(FMAKEFLAGS)
modules-Linux:
list='$(SUBDIR_TARGETS)'; for td in $$list; do $(MAKE) -C $$td; done
- $(MAKE) -C @LINUX_OBJ@ M="$$PWD" @KERNEL_MAKE@ CONFIG_ZFS=m modules
+ $(MAKE) -C @LINUX_OBJ@ $(if @KERNEL_CC@,CC=@KERNEL_CC@) \
+ $(if @KERNEL_LD@,LD=@KERNEL_LD@) $(if @KERNEL_LLVM@,LLVM=@KERNEL_LLVM@) \
+ M="$$PWD" @KERNEL_MAKE@ CONFIG_ZFS=m modules
modules-FreeBSD:
+$(FMAKE)