Cross compiler in JetPack Cross Compilation container

Hi, I’ve downloaded JetPack Cross Compilation container from here.
And I found in /usr/bin there has been a cross-compiler aarch64-linux-gnu- with version 11.4.0.

root@ubuntu:/usr/bin# aarch64-linux-gnu-g++ -v
Using built-in specs.
COLLECT_GCC=aarch64-linux-gnu-g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/aarch64-linux-gnu/11/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --without-target-system-zlib --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=aarch64-linux-gnu --program-prefix=aarch64-linux-gnu- --includedir=/usr/aarch64-linux-gnu/include --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04) 

And I can also download another cross compiler from Jetpack Linux with version 11.3.0.
I tried to find the version of this compiler, it printed some error:

root@ubuntu:/workspaces/Code# /l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-g
nu-g++ -v
Using built-in specs.
COLLECT_GCC=/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-g++.br_real
COLLECT_LTO_WRAPPER=/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../libexec/gcc/aarch64-buildroot-linux-gnu/11.3.0/lto-wrapper
Target: aarch64-buildroot-linux-gnu
Configured with: ./configure --prefix=/sources/buildroot-source_toolchains.bootlin.com-2022.08.1/aarch64--glibc--stable-2022.08-1 --sysconfdir=/sources/buildroot-source_toolchains.bootlin.com-2022.08.1/aarch64--glibc--stable-2022.08-1/etc --enable-static --target=aarch64-buildroot-linux-gnu --with-sysroot=/sources/buildroot-source_toolchains.bootlin.com-2022.08.1/aarch64--glibc--stable-2022.08-1/aarch64-buildroot-linux-gnu/sysroot --enable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib --disable-decimal-float --enable-plugins --enable-lto --with-gmp=/sources/buildroot-source_toolchains.bootlin.com-2022.08.1/aarch64--glibc--stable-2022.08-1 --with-mpc=/sources/buildroot-source_toolchains.bootlin.com-2022.08.1/aarch64--glibc--stable-2022.08-1 --with-mpfr=/sources/buildroot-source_toolchains.bootlin.com-2022.08.1/aarch64--glibc--stable-2022.08-1 --with-pkgversion='Buildroot 2022.08' --with-bugurl=http://bugs.buildroot.net/ --without-zstd --disable-libquadmath --disable-libquadmath-support --enable-tls --enable-threads --without-isl --without-cloog --with-abi=lp64 --with-cpu=cortex-a53 --enable-languages=c,c++,fortran --with-build-time-tools=/sources/buildroot-source_toolchains.bootlin.com-2022.08.1/aarch64--glibc--stable-2022.08-1/aarch64-buildroot-linux-gnu/bin --enable-shared --enable-libgomp
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.3.0 (Buildroot 2022.08) 
COMPILER_PATH=/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../libexec/gcc/aarch64-buildroot-linux-gnu/11.3.0/:/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../libexec/gcc/:/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/
LIBRARY_PATH=/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/:/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../lib/gcc/:/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/lib/../lib64/:/l4t/toolchain/aarch64--glibc--stable-2022.08-1/aarch64-buildroot-linux-gnu/sysroot/lib/../lib64/:/l4t/toolchain/aarch64--glibc--stable-2022.08-1/aarch64-buildroot-linux-gnu/sysroot/usr/lib/../lib64/:/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/lib/:/l4t/toolchain/aarch64--glibc--stable-2022.08-1/aarch64-buildroot-linux-gnu/sysroot/lib/:/l4t/toolchain/aarch64--glibc--stable-2022.08-1/aarch64-buildroot-linux-gnu/sysroot/usr/lib/
COLLECT_GCC_OPTIONS='-fstack-protector-strong' '-fPIE' '-pie' '-v' '-shared-libgcc' '-mcpu=cortex-a53' '-mlittle-endian' '-mabi=lp64' '-dumpdir' 'a.'
 /l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../libexec/gcc/aarch64-buildroot-linux-gnu/11.3.0/collect2 -plugin /l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../libexec/gcc/aarch64-buildroot-linux-gnu/11.3.0/liblto_plugin.so -plugin-opt=/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../libexec/gcc/aarch64-buildroot-linux-gnu/11.3.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccRwpmLA.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/l4t/toolchain/aarch64--glibc--stable-2022.08-1/aarch64-buildroot-linux-gnu/sysroot --eh-frame-hdr -dynamic-linker /lib/ld-linux-aarch64.so.1 -X -EL -maarch64linux -pie /l4t/toolchain/aarch64--glibc--stable-2022.08-1/aarch64-buildroot-linux-gnu/sysroot/usr/lib/../lib64/Scrt1.o /l4t/toolchain/aarch64--glibc--stable-2022.08-1/aarch64-buildroot-linux-gnu/sysroot/usr/lib/../lib64/crti.o /l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/crtbeginS.o -L/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/11.3.0 -L/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../lib/gcc -L/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/lib/../lib64 -L/l4t/toolchain/aarch64--glibc--stable-2022.08-1/aarch64-buildroot-linux-gnu/sysroot/lib/../lib64 -L/l4t/toolchain/aarch64--glibc--stable-2022.08-1/aarch64-buildroot-linux-gnu/sysroot/usr/lib/../lib64 -L/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/lib -L/l4t/toolchain/aarch64--glibc--stable-2022.08-1/aarch64-buildroot-linux-gnu/sysroot/lib -L/l4t/toolchain/aarch64--glibc--stable-2022.08-1/aarch64-buildroot-linux-gnu/sysroot/usr/lib -z max-page-size=65536 -z common-page-size=65536 -z now -z relro -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/crtendS.o /l4t/toolchain/aarch64--glibc--stable-2022.08-1/aarch64-buildroot-linux-gnu/sysroot/usr/lib/../lib64/crtn.o
/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: /l4t/toolchain/aarch64--glibc--stable-2022.08-1/aarch64-buildroot-linux-gnu/sysroot/usr/lib/../lib64/Scrt1.o: in function `_start':
(.text+0x1c): undefined reference to `main'
/l4t/toolchain/aarch64--glibc--stable-2022.08-1/bin/../lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: (.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status

And I also found that the compiler version on Jetson Orin AGX device (flashed by sdkmanager) is 11.4.0.

lumina@ubuntu:~$ aarch64-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/11/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.4.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)

My questions are:
Q1. Why does aarch64-buildroot-linux-gnu-g++ -v give error?
Q2. What’s the difference between these two cross compilers?
Q3. And which one should I use?

Thanks!

Hi,

For cross-compile, please use the jetpack-linux-aarch64-crosscompile-x86 to avoid compatibility issues.
But we will check why the tool downloaded from the website is different and provide more info to you.

Thanks.

@AastaLLL Thanks very much.
The compiler jetpack-linux-aarch64-crosscompile-x86 you mentioned is that one installed in the docker container (version 11.4.0). Right?

Thanks!

Hi,

Yes, please use tag 6.0 to cross-compile a JetPack 6.0 app.
nvcr.io/nvidia/jetpack-linux-aarch64-crosscompile-x86:6.0

Thanks.

1 Like

Hi @AastaLLL
I found aarch64-linux-gnu-gdb was not installed in the container. Where can I get aarch64-linux-gnu-gdb? And how to install it in container?

Thanks.

Hi,

gdb is available on the Jetson device.
The container is for cross-compiling, after that please copy the binary to Jetson for executing.

Thanks.

Hi, is there any update about this to share?

Thanks.

Hi,

We are still checking internally.
But we can build a kernel with the toolchain in the downloaded center.

$ ./aarch64--glibc--stable-2022.08-1/bin/aarch64-linux-gcc --version
aarch64-linux-gcc.br_real (Buildroot 2022.08) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks.

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