Error: Unrecognized command-line option '-mlittle-endian' when building Jetson Linux Kernel

I am following the Kernel Customization section of the Developer Guide for a Jetson Orin Nano. In the “Building the Jetson Linux Kernel” section, I fail at the make -C kernel step with the following output:

make: Entering directory '/home/skyfish/nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/source/kernel'
================================================================================
Building kernel-jammy-src sources
================================================================================
make \
	ARCH=arm64 \
	-C /home/skyfish/nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/source/kernel/kernel-jammy-src  \
	LOCALVERSION=-tegra \
	defconfig
make[1]: Entering directory '/home/skyfish/nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/source/kernel/kernel-jammy-src'
*** Default configuration is based on 'defconfig'
#
# No change to .config
#
make[1]: Leaving directory '/home/skyfish/nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/source/kernel/kernel-jammy-src'
make -j 4 \
	ARCH=arm64 \
	-C /home/skyfish/nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/source/kernel/kernel-jammy-src  \
	LOCALVERSION=-tegra \
	--output-sync=target Image
make[1]: Entering directory '/home/skyfish/nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/source/kernel/kernel-jammy-src'
arch/arm64/Makefile:36: Detected assembler with broken .inst; disassembly will be unreliable
make[1]: Leaving directory '/home/skyfish/nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/source/kernel/kernel-jammy-src'
make[1]: Entering directory '/home/skyfish/nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/source/kernel/kernel-jammy-src'
warning: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
warning: LSE atomics not supported by binutils
make[1]: Leaving directory '/home/skyfish/nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/source/kernel/kernel-jammy-src'
  CC      scripts/mod/devicetable-offsets.s
gcc: error: unrecognized command-line option ‘-mlittle-endian’
make[2]: *** [scripts/Makefile.build:122: scripts/mod/devicetable-offsets.s] Error 1
make[2]: *** Waiting for unfinished jobs....
  CC      scripts/mod/empty.o
gcc: error: unrecognized command-line option ‘-mlittle-endian’
make[2]: *** [scripts/Makefile.build:295: scripts/mod/empty.o] Error 1
make[1]: *** [Makefile:1265: prepare0] Error 2
make: *** [Makefile:31: kernel] Error 2
make: Leaving directory '/home/skyfish/nvidia/nvidia_sdk/JetPack_6.0_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/source/kernel'

What is the issue? The odd part is that I was able to successfully execute this step previously.

Hi,
It may be due to root permission of Linux_for_Tegra folder. Please check this and give it a try:
Building the kernel from kernel source jetpack 6 , jetson orin nx 16GB - #5 by DaneLLL

I am curious if this is being cross compiled from a PC? If so, which cross compiler? If natively compiled, which compiler version? Note that if you have more than one compiler you might need to specify a particular compiler, but generally speaking, this works to get the information:
gcc --version

Which L4T release? Check “head -n 1 /etc/nv_tegra_release”. Then go to the URL for that specific release and see if you have the correct versions of software installed:
https://developer.nvidia.com/linux-tegra

This vaguely sounds like an incorrect compiler or compiler setup version is being used. There are also some differences in options when cross compiling versus natively compiling. Official docs tend to center on cross compiling.

I redid the process with Jetpack 6.1 as a clean build and it worked. I am unsure what was incorrect along the way the first time.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.