diff options
author | Peter Levine <[email protected]> | 2022-02-02 00:44:59 -0500 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2022-02-16 17:58:55 -0800 |
commit | c7fcf0091731e904aa26c1375348107b5ada984b (patch) | |
tree | c7e11c61c2f38d11720ff4421912bf5505fecf92 /module | |
parent | 52aae04c6a0a88d6af7b1cda27694414ae202822 (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.in | 4 |
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) |