mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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 <szuberskidamian@gmail.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Peter Levine <plevine457@gmail.com> Closes #13046
This commit is contained in:
committed by
Brian Behlendorf
parent
8e94ac0e36
commit
b66140c6ad
+7
-1
@@ -601,9 +601,15 @@ dnl #
|
||||
dnl # Used internally by ZFS_LINUX_TEST_{COMPILE,MODPOST}
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_LINUX_COMPILE], [
|
||||
AC_ARG_VAR([KERNEL_CC], [C compiler for
|
||||
building kernel modules])
|
||||
AC_ARG_VAR([KERNEL_LD], [Linker for
|
||||
building kernel modules])
|
||||
AC_ARG_VAR([KERNEL_LLVM], [Binary option to
|
||||
build kernel modules with LLVM/CLANG toolchain])
|
||||
AC_TRY_COMMAND([
|
||||
KBUILD_MODPOST_NOFINAL="$5" KBUILD_MODPOST_WARN="$6"
|
||||
make modules -k -j$TEST_JOBS -C $LINUX_OBJ $ARCH_UM
|
||||
make modules -k -j$TEST_JOBS ${KERNEL_CC:+CC=$KERNEL_CC} ${KERNEL_LD:+LD=$KERNEL_LD} ${KERNEL_LLVM:+LLVM=$KERNEL_LLVM} -C $LINUX_OBJ $ARCH_UM
|
||||
M=$PWD/$1 >$1/build.log 2>&1])
|
||||
AS_IF([AC_TRY_COMMAND([$2])], [$3], [$4])
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user