How to Check the Version of the Cross-Compilation Toolchain Installed in Linux

Embedded linux






In this article, we show how to check the version of the cross-compilation toolchain installed on your linux system.

If you're working with target devices, such as embedded systems, that are different than the processor of your host machine (your computer such as your laptop), then you'll need a cross-compilation toolchain.

A cross-compilation toolchain is a compiler which can compile code for a target machine different than the host machine.

The native compiler is compiler which compiles for the host machine.

If you are using a laptop, there's a good chance that it is running on an x86 CPU. This is common for general-purpose computers. x86 is a processor made by Intel for desktop and server applications.

Embedded systems are very different and obviously have different purposes. ARM (standing for Advanced RISC Machine) architecture is designed to be as basic as possible to maximize energy efficiency. It has a more basic instruction set, RISC (Reduced Instruction Set Computer), which utilizes less energy. Therefore, it is used heavily in devices where energy concerns are very important, such as embedded devices which mostly run on batteries. This includes smartphones and tablets.

A good article that describes these differences is shown at the following link, ARM vs Intel Processors.

ARM dominates embedded devices. Thus, if you are working with an embedded microcomputer such as Beaglebone board, this device has an ARM processor. Therefore, you will be working with the ARM architecture.

Therefore, you will need to work with a cross-compilation toolchain that is appropriate for your target device (such as beaglebone black device).

Now the question is, if you've already installed this toolchain maybe some time ago, how do you now check to see which version you have installed.

To do this, we explain below.

To check the cross-compilation toolchain for a 64-bit ARM machine, we can use the following code to do so.





Note that the 64-bit ARM backend/support in the Linux tree and GCC is called aarch64.

Now if you want to check the version of the cross-compilation toolchain that runs on 32-bit ARM machine, you would use the line of code below.





When I run this command on my computer, I can get the following output shown below.


Checking the version of the arm-linux-gnueabihf-gcc cross-compilation toolchain (32-bit ARM processors)


You can see that for 32-bit ARM machines, our cross-compiler is the Linaro GCC 7.5.0 version.

Lastly, you can check the native gcc compiler, which is the compiler used to compile code for the host machine.

This can be obtained through the line of code shown below.





Running this on my PC gives me the following output shown below.


Checking the version of the native gcc compiler in linux


You can see that the native gcc compiler for our host machine is Ubuntu 9.4.0.

So this is how to check the version of a cross-compiler toolchain in linux.



Related Resources





HTML Comment Box is loading comments...