Subtleties dealing with cross compilers, libraries, etc.
Posted: Sat Mar 28, 2020 10:52 pm
I'm reading this: https://wiki.osdev.org/Meaty_Skeleton. I've already built a cross compiler, roughly following Barebones, and the cross compiler executable is present in ~/opt/cross. One question that I have is the difference between ~/opt/cross/bin and ~/opt/cross/i686-elf/bin. Also in this case, is ~/opt/cross/lib the directory where the standard library is supposed to be located? And ~/opt/cross/lib/gcc the place where the libgcc objects are present?
I have a few other questions -
I have a few other questions -
Alright, I understand that libgcc is a 'private library' that is used by gcc, i.e. It has significance only during the compilation process, when gcc is in use, kind of like a helper for gcc. Is this right? I understand that the machine I run gcc on is called the build machine, and the host machine is my own OS. What is the freestanding environment specified here? Since gcc runs on the build machine, libgcc must use the build machine libgcc I guess? Where does freestanding come into the picture?0. The GCC documentation explicitly states that libgcc requires the freestanding environment to supply the memcmp, memcpy, memmove, and memset functions, as well as abort on some platforms. We will satisfy this requirement by creating a special kernel C library (libk) that contains the parts of the user-space libc that are freestanding (doesn't require any kernel features) as opposed to hosted libc features that need to do system calls.