Building Kernel for Jetson AGX Orin module

I have referred the following links for toolchain and kernel build.

https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/SD/Kernel/KernelCustomization.html
https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/AT/JetsonLinuxToolchain.html#at-jetsonlinuxtoolchain

My host PC:

user:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal
user:~$

While building the kernel I am facing following error at the end.

/home/user/l4t-gcc/aarch64–glibc–stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: Unexpected GOT/PLT entries detected!
/home/user/l4t-gcc/aarch64–glibc–stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: Unexpected run-time procedure linkages detected!
/home/user/l4t-gcc/aarch64–glibc–stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: drivers/misc/eventlib/eventlib_flt.o: in function sync_clear_bit': /home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/misc/eventlib/eventlib_flt.h:170: undefined reference to __aarch64_ldclr4_acq_rel’
/home/user/l4t-gcc/aarch64–glibc–stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: drivers/misc/eventlib/eventlib_flt.o: in function sync_set_bit': /home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/misc/eventlib/eventlib_flt.h:165: undefined reference to __aarch64_ldset4_acq_rel’
/home/user/l4t-gcc/aarch64–glibc–stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: drivers/misc/eventlib/eventlib_flt.o: in function sync_test_and_set_bit': /home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/misc/eventlib/eventlib_flt.h:160: undefined reference to __aarch64_ldset4_acq_rel’
/home/user/l4t-gcc/aarch64–glibc–stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: drivers/misc/eventlib/eventlib_flt.o: in function sync_clear_bit': /home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/misc/eventlib/eventlib_flt.h:170: undefined reference to __aarch64_ldclr4_acq_rel’
/home/user/l4t-gcc/aarch64–glibc–stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/osi_hal.o: in function get_tx_ts': /home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/osi_hal.c:1781: undefined reference to __aarch64_ldadd4_acq_rel’
/home/user/l4t-gcc/aarch64–glibc–stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: /home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/osi_hal.c:1829: undefined reference to __aarch64_ldadd4_acq_rel' /home/user/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/osi_hal.o: in function osi_lock_irq_enabled’:
/home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/include/…/osi/common/common.h:127: undefined reference to __aarch64_cas4_acq_rel' /home/user/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/osi_hal.o: in function osi_unlock_irq_enabled’:
/home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/include/…/osi/common/common.h:156: undefined reference to __aarch64_cas4_acq_rel' /home/user/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/osi_hal.o: in function get_tx_ts’:
/home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/osi_hal.c:1783: undefined reference to __aarch64_ldadd4_acq_rel' /home/user/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/macsec.o: in function osi_lock_irq_enabled’:
/home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/include/…/osi/common/common.h:127: undefined reference to __aarch64_cas4_acq_rel' /home/user/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/macsec.o: in function osi_unlock_irq_enabled’:
/home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/include/…/osi/common/common.h:156: undefined reference to __aarch64_cas4_acq_rel' /home/user/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/eqos_core.o: in function eqos_pad_calibrate’:
/home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/eqos_core.c:169: undefined reference to __aarch64_cas4_acq_rel' /home/user/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: /home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/eqos_core.c:229: undefined reference to __aarch64_cas4_acq_rel’
/home/user/l4t-gcc/aarch64–glibc–stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/mgbe_core.o: in function mgbe_handle_mac_intrs': /home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/mgbe_core.c:2260: undefined reference to __aarch64_ldadd4_acq_rel’
/home/user/l4t-gcc/aarch64–glibc–stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: /home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/mgbe_core.c:2309: undefined reference to __aarch64_ldadd4_acq_rel' /home/user/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: /home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/mgbe_core.c:2262: undefined reference to __aarch64_ldadd4_acq_rel’
/home/user/l4t-gcc/aarch64–glibc–stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/core_common.o: in function osi_unlock_irq_enabled': /home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/include/../osi/common/common.h:156: undefined reference to __aarch64_cas4_acq_rel’
/home/user/l4t-gcc/aarch64–glibc–stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-ld: drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/osi/core/core_common.o: in function osi_lock_irq_enabled': /home/user/Orin/Linux_for_Tegra/source/public/kernel/nvidia/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm/include/../osi/common/common.h:127: undefined reference to __aarch64_cas4_acq_rel’
make[1]: *** [/home/user/Orin/Linux_for_Tegra/source/public/kernel/kernel-5.10/Makefile:1211: vmlinux] Error 1
make: *** [Makefile:213: __sub-make] Error 2

1 Like

I don’t feel like you are using the right toolchain for compiling.
Please use Bootlin Toolchain gcc 9.3, which is released in 2020.08.

1 Like

After downloading the toolchain (aarch64–glibc–stable-final.tar.gz) from the link shared in above post. The build was success.

I want to flash the Jetson AGX Orin module with the built kernel image.

I need to copy the following artifacts to Linux_for_Tegra/kernel (for Kernel Image) and Linux_for_Tegra/kernel/dtb/ (for device tree binary) ?

Linux_for_Tegra/source/public/kernel_out/arch/arm64/boot/Image
Linux_for_Tegra/source/public/kernel_out/arch/arm64/boot/dts/nvidia/tegra234-p3701-0000-p3737-0000.dtb
1 Like

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