Tool-chain installation and PATH settings
In this article, let’s learn how to set up the toolchain path. In the previous article, you have already downloaded the toolchain. We have to set the appropriate path. This will be helpful while compiling our source codes.
You have to add the toolchain binary path to the home directory .bashrc file.
Steps you have to follow.
- Go to your home directory
- Open .bashrc using a gedit text editor
- Copy the below export command with path information to the .bashrc file
export PATH = $PATH:<path_to_tool_chain_binaries>
- Save and close
Or simply we can do: echo “export PATH=$PATH:<path_to_tool_chain_binaries>” >> ~/.bashrc
Let’s go to the downloads folder and extract this toolchain. Right-click and use extract here as shown in Figure 1.
Next, open the .bashrc file using a text editor like Gedit. You can do this by entering the following command in your terminal.
Go inside this folder, and here you find the bin, go inside that as shown in Figure 2. You have to give this path in the path settings.
For that, let’s go to the command prompt and let’s head over to that folder, downloads, gcc-linaro.
And just type pwd, and this is a path, just select that path as shown in Figure 3.
And now come to your home directory, open .bashrc as shown in Figure 4.
And here, come at the end, type export. And after that, PATH= $PATH: and now paste that path as shown in Figure 5.
After that save and exit as shown in Figure 6.
Type the command source .bashrc. Just type three letters arm and hit double tab as shown in Figure 7.
Here we can see that the command prompt has detected our toolchain binaries.
For example, cross compiler, gcc for our ARM Cortex A8 architecture.
Assembler, cross compiler, and a linker, these are the tools used to analyze the elf file format; by using the nm command, you can analyze the symbols, object copy, you can used to convert elf to a different binary format, such as a .bin or .hex, like that.
Object dump is used to dump the contents of the elf file format and various tools we can use to analyze the kernel modules or any file, which is in the elf format. Reproduce this at your desk and let me know if you face any issues; I’ll see you in the following article.
Get the Full course on Linux Device Driver Here.
FastBit Embedded Brain Academy Courses
click here: https://fastbitlab.com/course1