I ask you to go through the steps necessary to create a basic toolchain sufficient to create a bootable Linux image and to discuss why you need to do what you offer .. p>
Pointers to existing documentation are also greatly appreciated. I looked at Linux from Scratch and had some experience creating Gentoo images using special distribution tools. I also reviewed the documentation for various tools used to create cross-compilation tools for embedded devices.
However, the documentation for these tools only discusses compiling the tools that actually use these tools, and not how they do it, and why not in a different way. Often these resources also mention that other tools do it differently (and, of course, worse), so I feel that just reading the source will only help me find out how this building tool works, and not give an idea of the process itself and maybe variations.
Therefore, I’m not very interested in discussing tools for automating the construction of a tool chain, but instead in the commented instructions on how to do this manually . Also note that at the moment I plan to create and run the image on the same machine, so I do not need to cross-compile. But I'm still interested in cross-compilation discussions, but the focus should probably be somewhere else. What else is needed and to create a boot image is not part of this question - just create a tool chain to get there.
To help you understand where I am here, there are some questions that I have and some things that I believe know: I understand that even when creating it, it’s important to separate the toolchain used to create the image from the image host to avoid links to libraries that may not be available later (other reasons?). I don’t know if it’s enough to adjust the environment variables appropriately (what?), Or if it’s best to build the tool chain, chroot and rebuild (what will I get from the recovery?). What could go wrong if you do the first? I read that building gcc twice (using the first to build the second) is redundant as the build system does this anyway. If so, what differences in the two assemblies might reveal why they matter? Surely something went wrong if the two assemblies are different from each other and what is done about it if they do it. Does cross-compilation, when executed correctly, produce exactly the same binaries as when they were originally made? And if not, why is it not so bad, and many projects never choose this path?
source share