linux - LFS: What is the toolchain and why is it important? - Unix & Linux Stack Exchange
Courses about toolchain?
What exactly is a toolchain? - Stack Overflow
Anyone else hate spending an absurd amount of time just trying to set up an enviroment for software you are working on?
One of the places where Linux is better than windows. Setting up an environment to study a software is ridiculously easy in Linux as compared to windows.
More on reddit.comVideos
The toolchain is simply tools to build software (compiler, assembler, linker, libraries, and a few useful utilities).
In this case the important part is host-independent - that is independent of the tools downloaded.
There are several reasons why you might want to rebuild the tools:
- It is harder to sneak in backdoors (though not impossible)
- Compile parameters can be tweaked to fit your system and not just being a general binary.
- You get the newest version of the tools.
LFS rebuilds the toolchain (i.e. the compiler, the linker, the assembler, and the libraries used by all of them) three times:
- The first time uses the toolchain of the host system to build a new toolchain (
gcc,ld,binutils,glibc, etc)on the target system. These tools will be linked to shared libraries on the host system, which would not be present were you to boot into your target system at this time. So... - The second time the toolchain is built against the libraries installed on the target machine. This means the toolchain will work if you boot into the target system, but there is still some possibility things may be linked against the host system, and regardless the toolchain was still compiled with optimizations targeted at the host system, not the target system. So...
- The third time is the charm, and this time the toolchain will be completely "sanitized" of any links or attachments to your host system, and optimized for your target system.
This is perhaps the single most important part of building an LFS system, and it's very important to pay close attention to the instructions. In all of the LFS systems I've built (four to-date), this has been the one section where I've run into problems. Sometimes those problems didn't show up until much later, which as you can imagine is very frustrating.
I have always used some predefined toolchains that I didn’t create. So now I want to understand, create and modify different aspects of the toolchain - using ARM GCC and CMake, to be specific.
Which courses or books do you recommend to me? How about this one? https://www.udemy.com/course/toolchain-compiler-for-embedded-c-project/