Le 30/12/2011 08:46, Alex a écrit : > I tried using it myself and saw odd behavior when using sysroot with a > native gcc. The library search path ended up being /SYSROOT/ABSOLUTE/lib/ > instead of /SYSROOT/lib when the 'lib' directory was located at > /ABSOLUTE/lib. I added a 'hack' symlink "/SYSROOT/ABSOLUTE -> /" > which made it work but is not nice. The header and executable search > paths seemed to be correct (without modifying gcc sources). > > I was naievely thinking that the sysroot approach could be a lot cleaner > than patching gcc (especially to handle transitioning to new version in > the future) Hi,
It is clearly indicated in gcc's doc that sysroot should be used when building a cross compiler. The behavior for a native compiler is not documented. For a cross-compiler, all the library are supposed to reside on sysroot, and it seems natural that they are looked for in /SYSROOT/ABSOLUTE/lib if they are to reside in /ABSOLUTE/lib on the future, cross-built, system. In LFS, the first pass of gcc is building a cross-compiler, so sysroot could be used. But the second pass uses the cross-compiler to build a native compiler, for which the behavior when using sysroot is not defined. So that might be the reason why you observe a strange behavior, the strangeness of which is that the headers are not searched in /SYSROOT/ABSOLUTE...But maybe I did not understand what you meant. Cheers Pierre -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page
