I started to homemode Linux build using LFS book. I came to Part II. - Chapter 5 about "Constracting a Temporary System". I downloaded all needed sources to /mnt/lfs/sources. When i want to start build packages and install, i confused a thing.

I installed some packages from source on my past distro based systems. When we use make install to install compiled source, it's installing to system directories (or i know like that). So if i run make install for the lfs sources, will it install to host system's directory instead of lfs system directory?


Read everything in LFS book carefully!

Creating the $LFS/tools Directory

All programs compiled in Chapter 5 will be installed under $LFS/tools to keep them separate from the programs compiled in Chapter 6. ... Create the required directory by running the following as root:

mkdir -v $LFS/tools

The next step is to create a /tools symlink on the host system. This will point to the newly-created directory on the LFS partition. Run this command as root as well:

ln -sv $LFS/tools /


The files compiled in this chapter will be installed under the $LFS/tools directory to keep them separate from the files installed in the next chapter and the host production directories. Since the packages compiled here are temporary, we do not want them to pollute the soon-to-be LFS system.

Build of binutils (part 1)

Now prepare Binutils for compilation:

../configure --prefix=/tools            \
             --with-sysroot=$LFS        \
             --with-lib-path=/tools/lib \
             --target=$LFS_TGT          \
             --disable-nls              \

The meaning of the configure options:


This tells the configure script to prepare to install the Binutils programs in the /tools directory.


For cross compilation, this tells the build system to look in $LFS for the target system libraries as needed.

So if you do everything well (exactly as in LFS book) it should work well :)

  • Thanks! I understand now why we use symlinks. – user327827 Dec 24 '18 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy