L4T 34.1.1 Bootlin toolchain command line option error

Hi,
If you download the kernel code by executing source_sync.sh, there is a known issue of building the code. Please download the source code package, which also includes the kernel code. Please try to build this kernel code.

Hi,

Please follow the document to build your kernel source.

https://docs.nvidia.com/jetson/archives/r34.1/DeveloperGuide/text/SD/Kernel.html

Hi,
I downloaded all the files manually from:

  1. Driver - L4T BSP: Jetson_Linux_R34.1.1_aarch64.tbz2

  2. Driver - Sample RootFS: Tegra_Linux_Sample-Root Filesystem_R34.1.1_aarch64.tbz2

  3. Source - Kernel sources: public_sources.tbz2

  4. Tools - Bootlin Toolchain gcc 9.3: aarch64–glibc–stable-final.tar.gz

(I didn’t use the second toolchain file , Bootlin Toolchain Sources, 2020.08-1 , since it doesn’t contain bin folder. only tars and there are no instructions on how to use it)

I built the kernel successfully by export the env variable:
export CROSS_COMPILE_AARCH64_PATH=
as mentioned here:

and still this error remains

1 Like

The document has something wrong in the path prefix of the tool chain binary, please correct it on your side.

Hi,
I followed this document.
I built the custom kernel successfully.
The problem is when I want to compile my own .dts file.
I edited the makefile in:
Linux_for_Tegra/source/public/hardware/nvidia/platform/t19x/jakku/kernel-dts
to add my own .dts files
and follow this section in the guide:

To prepare a kernel source tree that is not built

by running the command:
sudo make ARCH=arm64 O=~/Desktop/Jetpack_5_0_1/Build/Workspace/Out/ -j2 modules_prepare

and I get the same error.
(When I did the same steps with the L4T 32.4.4 it worked fine)

What I am doing wrong?
Is it something to do with wrong toolchain or settings?

log:
make[1]: Entering directory ‘/home/bsplinux/Desktop/Jetpack_5_0_1/Build/Workspace/Out’
arch/arm64/Makefile:25: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
arch/arm64/Makefile:33: LSE atomics not supported by binutils
arch/arm64/Makefile:44: Detected assembler with broken .inst; disassembly will be unreliable
GEN Makefile
CC scripts/mod/empty.o
CC scripts/mod/devicetable-offsets.s
gcc: error: unrecognized command-line option ‘-mlittle-endian’
make[2]: *** [/home/bsplinux/Desktop/Jetpack_5_0_1/Build/Workspace/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/Makefile.build:281: scripts/mod/empty.o] Error 1
make[2]: *** Waiting for unfinished jobs…
gcc: error: unrecognized command-line option ‘-mlittle-endian’
make[2]: *** [/home/bsplinux/Desktop/Jetpack_5_0_1/Build/Workspace/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/Makefile.build:118: scripts/mod/devicetable-offsets.s] Error 1
make[1]: *** [/home/bsplinux/Desktop/Jetpack_5_0_1/Build/Workspace/Linux_for_Tegra/source/public/kernel/kernel-5.10/Makefile:1244: prepare0] Error 2
make[1]: Leaving directory ‘/home/bsplinux/Desktop/Jetpack_5_0_1/Build/Workspace/Out’
make: *** [Makefile:213: __sub-make] Error 2

Thank you,
What do you mean? can you elaborate?

at first I couldn’t build the kernel.
I followed this post:

and then I built the kernel successfully but my problem remained

Hi,

If you just build the pure source without adding anything new, then do you still hit error?

No

Ok, which steps do you hit error?

by running the command:
sudo make ARCH=arm64 O=~/Desktop/Jetpack_5_0_1/Build/Workspace/Out/ -j2 modules_prepare

I get the following error:

gcc: error: unrecognized command-line option ‘-mlittle-endian’
make[2]: *** [/home/bsplinux/Desktop/Jetpack_5_0_1/Build/Workspace/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/Makefile.build:281: scripts/mod/empty.o] Error 1
make[1]: *** [/home/bsplinux/Desktop/Jetpack_5_0_1/Build/Workspace/Linux_for_Tegra/source/public/kernel/kernel-5.10/Makefile:1244: prepare0] Error 2
make[1]: *** Waiting for unfinished jobs…

log:
make[1]: Entering directory ‘/home/bsplinux/Desktop/Jetpack_5_0_1/Build/Workspace/Out’
arch/arm64/Makefile:25: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
arch/arm64/Makefile:33: LSE atomics not supported by binutils
arch/arm64/Makefile:44: Detected assembler with broken .inst; disassembly will be unreliable
GEN Makefile
CC scripts/mod/empty.o
CC scripts/mod/devicetable-offsets.s
gcc: error: unrecognized command-line option ‘-mlittle-endian’
make[2]: *** [/home/bsplinux/Desktop/Jetpack_5_0_1/Build/Workspace/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/Makefile.build:281: scripts/mod/empty.o] Error 1
make[2]: *** Waiting for unfinished jobs…
gcc: error: unrecognized command-line option ‘-mlittle-endian’
make[2]: *** [/home/bsplinux/Desktop/Jetpack_5_0_1/Build/Workspace/Linux_for_Tegra/source/public/kernel/kernel-5.10/scripts/Makefile.build:118: scripts/mod/devicetable-offsets.s] Error 1
make[1]: *** [/home/bsplinux/Desktop/Jetpack_5_0_1/Build/Workspace/Linux_for_Tegra/source/public/kernel/kernel-5.10/Makefile:1244: prepare0] Error 2
make[1]: Leaving directory ‘/home/bsplinux/Desktop/Jetpack_5_0_1/Build/Workspace/Out’
make: *** [Makefile:213: __sub-make] Error 2

Ok, so if you just run nvbuild.sh, will you hit error?

No

ok. So this issue is only specific to this section, right?

Yes , and specific to this L4T (and toolchain versions) since when I performed the same steps with L4T 32.4.4 everything worked fine

Hi yoavrubin17,

Are you set the same toolchain path with me?

$ export CROSS_COMPILE_AARCH64_PATH=/home/nvidia/CROSS_COMPILE/toolchain_gcc_9.3/bin/aarch64-buildroot-linux-gnu-

No, I set it to “/home/nvidia/CROSS_COMPILE/toolchain_gcc_9.3” (According to your example) because of other post.

I tried to change to your format but I still get the error:
gcc: error: unrecognized command-line option ‘-mlittle-endian’

  1. Why this is happen?
  2. How can I fix it?

thanks

Hi,
Is your host Ubuntu 18.04 or 20.04?

22.04 lts

Hi,
It may be specific to using 22.04. We try on 18.04 and it works fine. Could you try 18.04 or 20.04?

I can try. I thought jetpack 5_0_1 requires 20.04 and above

1 Like