Toolchain (cross-compiler) of Jetson TX2

4 questions

Is there any documentation on how to use toolchain?
Is it all used in command line?
Also, how can I check if I have toolchain?
I downloaded the SDK Manager, do I have to download toolchain separately?

Thanks in advance.

If you run the SDK Manager you’ll find you can enable or disable various install components. If you install just the host development tools, then this should be installed. If you check that you want to install samples on the Jetson itself, then what happens is that the host will cross compile those samples first before copying over to the Jetson…and thus if that happens, then you also know you have the cross tools.

Ubuntu does have cross tool packages, and what SDKM installs could be from that (I’m not actually sure), or there are also compatibility versions of older cross tools which could be added.

Typically, if you have a command in your PC’s search path, and you type part of it, then hit the tab key one or more times, then it’ll list possible choices. Try typing “aarch64”, and then hitting the tab key a couple of times…see what shows up (anything aarch64 is compatible with the TX2, and the host would consider that a non-native cross tool).

Below is what I got from doing that. The first one in the second column worked for cross compiling to the Jetson TX2.

$ aarch64-linux-gnu-
aarch64-linux-gnu-addr2line     aarch64-linux-gnu-g++           aarch64-linux-gnu-gcc-ranlib    aarch64-linux-gnu-gprof         aarch64-linux-gnu-readelf
aarch64-linux-gnu-ar            aarch64-linux-gnu-g++-7         aarch64-linux-gnu-gcc-ranlib-7  aarch64-linux-gnu-ld            aarch64-linux-gnu-size
aarch64-linux-gnu-as            aarch64-linux-gnu-gcc           aarch64-linux-gnu-gcov          aarch64-linux-gnu-ld.bfd        aarch64-linux-gnu-strings
aarch64-linux-gnu-c++filt       aarch64-linux-gnu-gcc-7         aarch64-linux-gnu-gcov-7       aarch64-linux-gnu-strip
aarch64-linux-gnu-cpp           aarch64-linux-gnu-gcc-ar        aarch64-linux-gnu-gcov-dump     aarch64-linux-gnu-nm            
aarch64-linux-gnu-cpp-7         aarch64-linux-gnu-gcc-ar-7      aarch64-linux-gnu-gcov-dump-7   aarch64-linux-gnu-objcopy       
aarch64-linux-gnu-dwp           aarch64-linux-gnu-gcc-nm        aarch64-linux-gnu-gcov-tool     aarch64-linux-gnu-objdump       
aarch64-linux-gnu-elfedit       aarch64-linux-gnu-gcc-nm-7      aarch64-linux-gnu-gcov-tool-7   aarch64-linux-gnu-ranlib

Basically the kernel is set up such that everything needing “gcc” is prefixed with “CROSS_COMPILE” if it is set. When not set, that means the native gcc is chosen. If set to something like “/usr/lib64/ccache/aarch64-linux-gnu-gcc”, then it uses that.

So you know you have “aarch-linux-gnu-gcc”. The question is where to find it. If you run the command “which aarch-linux-gnu-gcc”, then a full path will be visible. If the full path turns out to be “/usr/lib64/ccache/aarch64-linux-gnu-gcc”, then the prefix of “/usr/lib64/ccache/aarch64-linux-gnu-” (less “gcc”) would be valid for all of those tools, and a kernel build would use “CROSS_COMPILE=/usr/lib64/ccache/aarch64-linux-gnu-” along with “ARCH=arm64”.

Try to use just one forum thread, it can be tough to keep up with several. See also the answer here: