Compiling the linux kernel for the Xavier NX onboard (raid drivers) compiler issues

I need raid drivers on my NX, and after some research it appears the best way to fix this is to recompile the kernel :-/

I’m using this method, which seems like it uses all of the up to date systems.

Doing nothing else than the using the scripts, making the kernel fails due to a compiler issue :

drivers/base/dma-coherent.c:973:12: error: ‘shrink_thread’ defined but not used [-Werror=unused-function]
static int shrink_thread(void *arg)
^
drivers/base/dma-coherent.c:96:13: error: ‘dma_debugfs_init’ defined but not used [-Werror=unused-function]
static void dma_debugfs_init(struct device *dev, struct heap_info *heap)
^
drivers/base/dma-coherent.c:280:12: error: ‘declare_coherent_heap’ defined but not used [-Werror=unused-function]
static int declare_coherent_heap(struct device *dev, phys_addr_t base,
^
cc1: all warnings being treated as errors
scripts/Makefile.build:335: recipe for target ‘drivers/base/dma-coherent.o’ failed
make[2]: *** [drivers/base/dma-coherent.o] Error 1
scripts/Makefile.build:649: recipe for target ‘drivers/base’ failed
make[1]: *** [drivers/base] Error 2
Makefile:1121: recipe for target ‘drivers’ failed
make: *** [drivers] Error 2

Doing some research, it seemed like it’s a compiler mismatch. The version on my system (up-to-date) is 7.5.0 and the recommended version is 7.3.1 in the tool-chain instructions.

I tried downloading the toolchain and setting the cross_compile as per the instructions, but then I get exec format errors which seems to be a result of mismatched architecture? I’m not sure.

l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Exec format error
Kbuild:20: recipe for target ‘kernel/bounds.s’ failed
make[1]: *** [kernel/bounds.s] Error 2
Makefile:1166: recipe for target ‘prepare0’ failed

I would prefer not to have to compile this externally and reflash.

hello smith.stephen.mitchell,

please check developer guide, Building the NVIDIA Kernel.
you may follow the steps in this procedure to build the NVIDIA kernel.

may I also have more details about compile this driver on the target?
thanks