GCC version mismatch warning when building out-of-tree kernel modules on Jetson R39.2.1 (13.2.0 vs 13.3.0)

Hi,

I’m doing a native compilation of an out-of-tree kernel module on Jetson R39.2.1 (L4T 39.2.1, kernel 6.8.12-1021-rt-tegra). During make modules, I get the following warning:

warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
  You are using:           gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0

Environment:

  • Jetson Linux R39.2.1 (JetPack 7.2.1) Native Compilation

  • Kernel: 6.8.12-1021-rt-tegra (PREEMPT_RT)

  • readlink /lib/modules/$(uname -r)/build points to:
    /usr/src/linux-headers-6.8.12-1021-rt-tegra-ubuntu24.04_aarch64/3rdparty/canonical/linux-noble

Questions:

  1. Is this warning safe to ignore for out-of-tree modules on the RT kernel, given the minor version difference (13.2.0 vs 13.3.0)?

Hi,
We don’t observe the issue. Please ensure your compiler version is for r39.

Here is a related topic for reference:
[R39.2] out-of-tree module build fails with -Werror=address due to toolchain upgrade (Crosstool-NG GCC 13.2.0) - #6 by DaneLLL

Thank you for the clarification. However, my use case is native compilation on the Jetson itself, not cross-compilation from an x86 host.

The Jetson is already running the NVIDIA R39.2.1 RT kernel:

6.8.12-1021-rt-tegra

and I am building an out-of-tree kernel module directly on the Jetson using:

/lib/modules/$(uname -r)/build

The warning is:

The kernel was built by: gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
You are using: gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0

Could you please clarify whether NVIDIA recommends using the R39 Crosstool-NG GCC 13.2 toolchain specifically for native OOT module compilation as well?

If so, how should the R39 GCC 13.2 toolchain be used for native compilation on the Jetson ARM64 itself? The aarch64-none-linux-gnu toolchain referenced in the Kernel Customization guide appears to be a cross-compiler intended for x86_64 hosts.

Alternatively, is GCC 13.3 supported for native OOT module compilation on an R39.2.1 Jetson, with the warning simply indicating that the compiler version differs from the kernel build compiler?

I would especially like to understand whether this mismatch has any known impact on module ABI/CRC compatibility or PREEMPT_RT behavior.

Hi,
We would suggest have a host PC in Ubuntu 22.04 or 20.04, and follow the steps to rebuilt RT kernel:

Kernel Customization — NVIDIA Jetson Linux Developer Guide

The steps are well validated.

Hi,

Thank you for the suggestion.

I would like to clarify my current setup and purpose.

I am already using the official NVIDIA RT Kernel provided for Jetson Linux R39.2, rather than building my own RT kernel from source. I installed the RT kernel packages provided by NVIDIA, including the RT kernel, kernel headers, and OOT module packages, following NVIDIA’s official documentation:

NVIDIA Jetson Linux R39.2 — Installing Real-Time Kernel

The system is currently running:

Linux 6.8.12-1021-rt-tegra

My purpose is not to rebuild or customize the RT kernel itself. Instead, I need to compile several third-party out-of-tree (OOT) kernel drivers against the NVIDIA-provided RT kernel.

During the OOT driver compilation, I received the following warning:

warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
  You are using:           gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0

Therefore, my question is specifically about building third-party OOT modules against the NVIDIA-provided RT kernel, rather than about rebuilding the RT kernel.

Could you please clarify:

  1. Is GCC 13.3 officially supported for compiling OOT kernel modules against the NVIDIA R39.2 RT kernel, or should the OOT modules be compiled with exactly GCC 13.2.0, which was used to build the NVIDIA RT kernel?

  2. If GCC 13.2.0 is required, is there an NVIDIA-provided ARM64 native GCC 13.2 toolchain/package that can be used directly on the Jetson device for native OOT module compilation? The NVIDIA cross-compilation toolchain is intended for an x86 host, while my OOT drivers are being compiled natively on the Jetson.

  3. Since I am using the official NVIDIA RT kernel and its corresponding headers/Module.symvers, is there any additional NVIDIA-specific procedure required for compiling third-party OOT modules, or should the standard Linux Kbuild external-module procedure be sufficient?

I am trying to avoid rebuilding the RT kernel because the objective is simply to develop and load third-party OOT drivers while keeping the NVIDIA-provided RT kernel unchanged.

Thanks for your clarification.

Hi,
It should be little practical risk in building the module with GCC 13.3.0 when the installed kernel was built with GCC 13.2.0. If the module can be built successfully and loaded correctly, you may ignore the warning about mismatched gcc versions.

Here is the reason why we compile it with an older toolchain:
JetPack Cross Compilation container for Jetpack 7 - #11 by AastaLLL

Hi, NV
For native kernel compilation on Jetson, is it recommended to use GCC 13.2 or the system default GCC 13.3?

Hi,

We think either version is fine.