HomeFreeBSD

Add support for $KERNEL_{CC,LD,LLVM} variables

Description

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

Details

Provenance
Peter Levine <plevine457@gmail.com>Authored on Feb 2 2022, 5:44 AM
Tony Hutter <hutter2@llnl.gov>Committed on Feb 17 2022, 1:58 AM
Parents
rG52aae04c6a0a: module: Makefile: simplify clean and install jobs
Branches
Unknown
Tags
Unknown

Event Timeline

Tony Hutter <hutter2@llnl.gov> committed rGc7fcf0091731: Add support for $KERNEL_{CC,LD,LLVM} variables (authored by Peter Levine <plevine457@gmail.com>).Feb 17 2022, 1:58 AM