FYI, I am pointing a URL at the actual bootlin URL, which is the same content @DaneLLL is giving. Keep reading below, but realize there will be more information at the bootlin site. I’m starting with cross tool information, but it will help with looking for native content (perhaps at the bootlin web site, but it might be elsewhere). Technically, you could skip this first part which is cross compile, but the information is rather useful in understanding the difference between cross tools and native tools. You could skip to the end for the short question list.
A lot of this is just because other people look for the same information, so verbosity is on the high side.
For background, any program which uses a linked library needs a linker and it needs the library to link against. In the case of an x86 cross compile to aarch64 this implies (A) a cross linker, and (B) the aarch64 library in a proper location to find it. If you were to clone your Jetson and then loopback mount the raw clone on the host PC, I suspect that this would contain the libraries themselves. The cross linker is likely available via an apt-get
, although you might need to find the repository which has this and add it to the host PC (if you use the cross compile method). A raw clone is a very good idea even if you don’t cross compile.
Files which execute on x86_64, but produce aarch64 output will usually have a name prefix of “aarch64-something
”. The file gcc
is not a cross compiler, the file aarch64-linux-gcc
has the same output, but from another environment. The output won’t care if you use gcc
from that release or aarch64-linux-gcc
.
You can look at a binary executable like this (using the unpack location for a starting point):
./objdump -f ./aarch64--glibc--stable-2022.08-1/bin/aarch64-linux-gcc
(you will see “architecture: i386:x86-64
”; this is the execution environment, and the name prefix aarch64-
tells you the output format)
For native compile I found someone else who uses this, and they listed the URL (this is the same content which @DaneLLL just gave the URL for, but this one is at the bootlin provider’s web site):
https://toolchains.bootlin.com/downloads/releases/toolchains/aarch64/tarballs/aarch64–glibc–stable-2022.08-1.tar.bz2
If you download and unpack that you will find a “sysroot/
” subdirectory. Everything in sysroot/
is arm64/aarch64, and is what the linker would link against. Linking against a clone which has the actual files is better, although you are still in a cross compile environment. The sysroot/
is a bare bones subset of what the Jetson already has on it. If your Jetson is updated or customized, then the clone becomes a superior cross compile compared to a sysroot. Native compile and sysroot/
are the same thing if the bootlin content is a match for the libraries and linkers in the bootlin content.
The content outside of sysroot/
is used by the executables and utilities which produce aarch64, but run on x86_64. I haven’t looked at that documentation in quite some time, but basically a cross compile has a way to mention an alternate sysroot
(with an environment variable for the prefix to the path), and thus you could point at either the sysroot/
of the above unpacked tool, or you could point at a loopback mounted clone for the cross compile case.
If you compile natively on the Jetson, then you should already have the correct linker for aarch64/arm64, and no cross tool is required. Even the sysroot/
is present on the actual Jetson, but it is the o/s itself (everything related to a library or linker in the sysroot/
is in “/
” if going native). If something is missing, then it is either due to (A) needing a different major release version of something, or (B) needing a file to link against. The actual error you see when natively or cross compiling is important to knowing what is missing. Specific error messages can help look this up.
The trouble is that the compiler itself is of course x86_64, and not aarch64. You already have a clue though because we know this is gcc
version 11. If you cd
to the “aarch64--glibc--stable-2022.08-1/bin/
” subdirectory of the unpack, then you can run these commands (or for any other executable):
./aarch64-linux-gcc --version
./aarch64-buildroot-linux-gnu-gcc --version
Both will tell you:
(Buildroot 2021.11-4428-g6b6741b) 11.3.0
The date part is only important when multiple releases are available; usually anything 11.3.0
(or even 11.x
) will work, but getting actual 11.3.0
is best. When monthly builds are available, look for 2021.11
. As to the actual release version (this is native from an Orin, but it is using L4T R35.x and not R36.x):
# gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Copyright (C) 2019 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.
So the version is way too old under L4T R35.x. I do not have one with R36.x on it, so can you post the output on your R36.x of “gcc --version
”? Also, can you attach a copy of your Orin’s file “/etc/apt/sources.list
”? The goal is to find an Ubuntu repository which has what you need, and only then, if not found, move on to a native 11.3.0 (which may not exist without compiling the entire chain yourself from scratch).