Toolchain method

Luca liliana.perossa at
Sat Nov 18 09:19:10 PST 2006

Dan Nicholson wrote:
> On 11/18/06, Luca <liliana.perossa at> wrote:
>> Hi all!
>> A question about toolchain method, probably more lfs-dev related.
>> We have gcc-pass1, binutils-pass1, adjusting the toolchain, gcc-pass2
>> and binutils-pass2.
>> Question: instead of building packages twice, should be simpler to use
>> "--with-sysroot=/tools" method?
> Because that's cross-compiling and we do a native build in LFS. CLFS2
> is exactly what you're talking about and might be the right way
> forward in the future. But we've had a long and successful history on
> LFS with the two stage native build (for x86, anyway), so it's not
> changing in the forseeable future.
> Man, it's been a while since I flexed my brain on system bootstrapping.
> -- 
> Dan
I found out only yesterday about the change of clfs-sysroot while I've
been using this way from about two months.

>From Installing GCC: Configuration
Cross-Compiler-Specific Options

Tells GCC to consider dir as the root of a tree that contains a (subset
of) the root filesystem of the target operating system. Target system
headers, libraries and run-time object files will be searched in there.
The specified directory is not copied into the install tree, unlike the
options --with-headers and --with-libs that this option obsoletes. The
default value, in case --with-sysroot is not given an argument, is
${gcc_tooldir}/sys-root. If the specified directory is a subdirectory of
${exec_prefix}, then it will be found relative to the GCC binaries if
the installation tree is moved.
Tells GCC to consider dir as the system root (see --with-sysroot) while
building target libraries, instead of the directory specified with
--with-sysroot. This option is only useful when you are already using
--with-sysroot. You can use --with-build-sysroot when you are
configuring with --prefix set to a directory that is different from the
one in which you are installing GCC and your target libraries.
This option affects the system root for the compiler used to build
target libraries (which runs on the build system); it does not affect
the compiler which is used to build GCC itself.

Yes, it's under Cross-Compiler, but why not use the same directive for a
native build (or at least a pseudo-native). Really it specifies only to
set root to the target directory, this is not really meaning that my
target dir contains a cross-arch build; the toolchain system should be
revised to include glibc-headers before gcc and so on but no need of the
double passes or adjusting the toolchain pass.

I would say, just to make sure, that this was not a critic nor
everything else, but a simple question.


More information about the lfs-support mailing list