Facing the below errors while building the kernel for Javier NX module

I am getting this error “gcc: error: unrecognized command-line option ‘-mlittle-endian’” While trying the manual steps. Could you check?

NVIDIA team,

Can someone please help to build the kernel build?? I am really struggling to build this kernel for R-32.7.3.

I do not want any suggestions (all are not working). someone please try from your end and let me know

I am using ubuntu 18.04 image.

Your documentations are not working as expected.

Hi,
We have verified the steps on host PC in Ubuntu 18.04 and 16.04, so if you have host PC in same OS version, it is supposed to work. For the previous post, it looks like you use Ubuntu 22.04 and this may be the deviation triggering the failure.

Or you may try to build it directly on Xavier NX developer kit. See if this works at your end.

I removed the VMware and using the HOST-PC Ubuntu 18.04 version.

I do not want to use the kit. Since all the developer will use this ubuntu.

The problem is nothing is copied into “kernel_out” directory

Hi DaneLLL

Any updates??

Hi,
Please try the manual steps in developer guide

Share my PATH setup for reference:

$ export TEGRA_KERNEL_OUT=/home/danel/temp/jetp/jp463/Linux_for_Tegra/source/public/kernel_out/
$ export CROSS_COMPILE=/home/danel/gcc_tools/jp4/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
$ export LOCALVERSION=-tegra

My <kernel_source> is /home/danel/temp/jetp/jp463/Linux_for_Tegra/source/public/kernel/kernel-4.9

I compared the 35.2 and 32.7 release nvbuild.sh files and moved the diff. Now its compiling.

Now now doubts is in the nvidia documents Kernel Customization — Jetson Linux<br/>Developer Guide 34.1 documentation its mentioned to copy the files in the below path but in my case the file are in diff place, for ex:

Replace Linux_for_Tegra/rootfs/usr/lib/modules/$(uname -r)/kernel/drivers/gpu/nvgpu/nvgpu.ko with a copy of this file:
But I see in 32.7.3 this ko file is present in "./rootfs/lib/modules/4.9.299-tegra/kernel/drivers/gpu/nvgpu/nvgpu.ko

"

$kernel_out/arch/arm64/boot/dts/nvidia/

I do not see “nvidia” folder in my kernel build. Is the path correct or do I need to do anything?

I see dtb files are in this path only: ./kernel_out/arch/arm64/boot/dts/

There is no folder under this dir.


Hi,
It looks like the build script does not work properly on Jetpack 4 release. Please try the manual steps.

Hi DaneLL,

I followed the steps from the document. Facing the below errors in compilation. Could you check?
“gcc: error: unrecognized command-line option ‘-mlittle-endian’”

Compilation-Logs:

ayyappan@ayyappan-ubuntu:~/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel/kernel-4.9$ export CROSS_COMPILE=/home/ayyappan/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel/kernel-4.9/tool-chain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
ayyappan@ayyappan-ubuntu:~/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel/kernel-4.9$ export LOCALVERSION=-tegra
ayyappan@ayyappan-ubuntu:~/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel/kernel-4.9$ sudo mkdir -p $TEGRA_KERNEL_OUT
ayyappan@ayyappan-ubuntu:~/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel/kernel-4.9$ sudo make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_defconfig
make[1]: Entering directory ‘/home/ayyappan/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel_out’
HOSTCC scripts/basic/fixdep
GEN ./Makefile
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf

configuration written to .config

make[1]: Leaving directory ‘/home/ayyappan/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel_out’
ayyappan@ayyappan-ubuntu:~/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel/kernel-4.9$ sudo make ARCH=arm64 O=$TEGRA_KERNEL_OUT -j4
make[1]: Entering directory ‘/home/ayyappan/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel_out’
GEN ./Makefile
scripts/kconfig/conf --silentoldconfig Kconfig
arch/arm64/Makefile:49: LSE atomics not supported by binutils
CHK include/config/kernel.release
GEN ./Makefile
WRAP arch/arm64/include/generated/asm/bugs.h
WRAP arch/arm64/include/generated/asm/clkdev.h
WRAP arch/arm64/include/generated/asm/cputime.h
WRAP arch/arm64/include/generated/asm/delay.h
WRAP arch/arm64/include/generated/asm/div64.h
WRAP arch/arm64/include/generated/asm/dma.h
WRAP arch/arm64/include/generated/asm/dma-contiguous.h
WRAP arch/arm64/include/generated/asm/early_ioremap.h
CHK include/generated/uapi/linux/version.h
WRAP arch/arm64/include/generated/asm/emergency-restart.h
WRAP arch/arm64/include/generated/asm/errno.h
UPD include/generated/uapi/linux/version.h
UPD include/config/kernel.release
WRAP arch/arm64/include/generated/asm/hw_irq.h
WRAP arch/arm64/include/generated/asm/ioctl.h
WRAP arch/arm64/include/generated/asm/ioctls.h
WRAP arch/arm64/include/generated/asm/ipcbuf.h
WRAP arch/arm64/include/generated/asm/irq_regs.h
WRAP arch/arm64/include/generated/asm/kdebug.h
WRAP arch/arm64/include/generated/asm/kmap_types.h
WRAP arch/arm64/include/generated/asm/kvm_para.h
WRAP arch/arm64/include/generated/asm/local.h
WRAP arch/arm64/include/generated/asm/local64.h
WRAP arch/arm64/include/generated/asm/mcs_spinlock.h
WRAP arch/arm64/include/generated/asm/mm-arch-hooks.h
WRAP arch/arm64/include/generated/asm/mman.h
WRAP arch/arm64/include/generated/asm/msgbuf.h
WRAP arch/arm64/include/generated/asm/msi.h
WRAP arch/arm64/include/generated/asm/mutex.h
WRAP arch/arm64/include/generated/asm/poll.h
WRAP arch/arm64/include/generated/asm/preempt.h
WRAP arch/arm64/include/generated/asm/resource.h
WRAP arch/arm64/include/generated/asm/rwsem.h
WRAP arch/arm64/include/generated/asm/segment.h
WRAP arch/arm64/include/generated/asm/sembuf.h
WRAP arch/arm64/include/generated/asm/serial.h
WRAP arch/arm64/include/generated/asm/shmbuf.h
WRAP arch/arm64/include/generated/asm/simd.h
WRAP arch/arm64/include/generated/asm/sizes.h
WRAP arch/arm64/include/generated/asm/socket.h
WRAP arch/arm64/include/generated/asm/sockios.h
HOSTCC scripts/basic/fixdep
WRAP arch/arm64/include/generated/asm/swab.h
WRAP arch/arm64/include/generated/asm/switch_to.h
WRAP arch/arm64/include/generated/asm/termbits.h
WRAP arch/arm64/include/generated/asm/termios.h
WRAP arch/arm64/include/generated/asm/trace_clock.h
WRAP arch/arm64/include/generated/asm/types.h
WRAP arch/arm64/include/generated/asm/unaligned.h
WRAP arch/arm64/include/generated/asm/user.h
WRAP arch/arm64/include/generated/asm/vga.h
WRAP arch/arm64/include/generated/asm/xor.h
WRAP arch/arm64/include/generated/uapi/asm/kvm_para.h
HOSTCC scripts/basic/bin2c
Using /home/ayyappan/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel/kernel-4.9 as source for kernel
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
HOSTCC scripts/dtc/dtc.o
HOSTCC scripts/dtc/flattree.o
HOSTCC scripts/dtc/fstree.o
HOSTCC scripts/dtc/data.o
CC kernel/bounds.s
gcc: error: unrecognized command-line option ‘-mlittle-endian’
make[2]: *** [/home/ayyappan/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel/kernel-4.9/./Kbuild:21: kernel/bounds.s] Error 1
make[1]: *** [/home/ayyappan/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel/kernel-4.9/Makefile:1167: prepare0] Error 2
make[1]: *** Waiting for unfinished jobs…
HOSTCC scripts/dtc/livetree.o
HOSTCC scripts/dtc/treesource.o
HOSTCC scripts/genksyms/genksyms.o
HOSTCC scripts/dtc/srcpos.o
CC scripts/mod/empty.o
gcc: error: unrecognized command-line option ‘-mlittle-endian’
make[3]: *** [/home/ayyappan/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel/kernel-4.9/scripts/Makefile.build:339: scripts/mod/empty.o] Error 1
make[2]: *** [/home/ayyappan/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel/kernel-4.9/scripts/Makefile.build:652: scripts/mod] Error 2
make[2]: *** Waiting for unfinished jobs…
SHIPPED scripts/genksyms/parse.tab.c
SHIPPED scripts/genksyms/lex.lex.c
SHIPPED scripts/genksyms/keywords.hash.c
HOSTCC scripts/dtc/checks.o
SHIPPED scripts/genksyms/parse.tab.h
HOSTCC scripts/genksyms/parse.tab.o
HOSTCC scripts/genksyms/lex.lex.o
HOSTCC scripts/dtc/util.o
SHIPPED scripts/dtc/dtc-lexer.lex.c
SHIPPED scripts/dtc/dtc-parser.tab.h
SHIPPED scripts/dtc/dtc-parser.tab.c
HOSTCC scripts/dtc/dtc-lexer.lex.o
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTLD scripts/genksyms/genksyms
HOSTLD scripts/dtc/dtc
make[1]: *** [/home/ayyappan/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel/kernel-4.9/Makefile:589: scripts] Error 2
make[1]: Leaving directory ‘/home/ayyappan/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel_out’
make: *** [Makefile:171: sub-make] Error 2

Hi,
Do you install the packages:

$ sudo apt install build-essential bc

yes. Installed.

I copied these env into kernel/Makefile. Now I am able to compile

export TEGRA_KERNEL_OUT=/home/ayyappan/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel_out
export CROSS_COMPILE=/home/ayyappan/nvidia/kernel_source/Linux_for_Tegra/source/public/kernel/kernel-4.9/tool-chain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export LOCALVERSION=-tegra

But, I did not see the nvidia folder inside kernel_out/arch/arm64/boot/dts/nvidia/

where Can I find the dtsi files for this build?

Hi,
dtsi files are built into dtb. You should see dtb files in

/home/danel/temp/jetp/jp463/Linux_for_Tegra/source/public/kernel_out/arch/arm64/boot/dts

Yes. its there. this is the right path?

Hi,
Yes, please check step 5 and 6:

5.Replace <release_packagep>/Linux_for_Tegra/kernel/Image with a copy of:
$TEGRA_KERNEL_OUT/arch/arm64/boot/Image
6.Replace the contents of Linux_for_Tegra/kernel/dtb/ with the contents of:
$TEGRA_KERNEL_OUT/arch/arm64/boot/dts/

Please remember to backup original files before the replacement.

Yes. Done. Now I am able to flash and the system comes up. But I am seeing the below AON clock errors.

I am actually trying to do the GPIO Application by following this Jetson Sensor Processing Engine (SPE) Developer Guide: GPIO Application (app/gpio-app.c) Link. I’ve configured the .cfg and .mk file as mentioned in this document. Any help here for this errors?

�clk_set_parent failed for clk i2c2, parent pll_aon (-22)
clk_set_parent failed for clk i2c8, parent pll_aon (-22)
clk_dt_late initialized
machine_check initialized
pm_post initialized

Full Logs:
teraterm_log.txt (30.8 KB)

Hi,
For further issue, please create a new topic. Would like to keep this topic for discussion of building kernel.

Created here. Could you route to topic to the relevant team?

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