Meaty Skeleton: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
Line 82:
We use system roots already now because it will make it smoother to add a user-space when you get that far. This scheme is very convenient when you later [[Cross-Porting_Software|Port Third-Party Software by Cross-Compiling It]].
 
The <tt>-elf</tt> targets have no user-space and are incapable of having one. We configured the compiler with system root support, so it will look in <tt>${SYSROOT}/usr/lib</tt> as expected. We prevented the compiler from searching for a standard library using the --without-headers option when building <tt>i686-elf-gcc</tt>, so it will ''not'' look in <tt>${SYSROOT}/usr/include</tt>. (Once you add a user-space and a libc, you will configure your custom cross-gcc with <tt>--with-sysroot</tt> and it will look in <tt>${SYSROOT}/usr/include</tt>. As a temporary work-around until you get that far, we fix it by passing <tt>-isystem=/usr/include</tt>).
 
You can change the system root directory layout if you wish, but you have to modify some binutils and gcc source code and tell them [[OS Specific Toolchain|what your operating system is]]. This is advanced and not worth doing until you add a proper user-space. Note that the cross-linker currently looks in <tt>/lib</tt>, <tt>/usr/lib</tt> and <tt>/usr/local/lib</tt> by default, so you can move files there without changing binutils. Also note that we use the <tt>-isystem</tt> gcc option (as gcc was configured without a system include directory), so you can move that around freely.