0

I'm learning linux knowledges, when I compile binutils or gcc and install them, they always appear in two locations.

I think it must be a reason and I don't know why?

Actually I'm learning lfs. When I compile the pass I of binutils, the book's instructions is:

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

After I make && make install, it is installed in two locations: /tools/bin and /tools/$LFS_TGT/bin.

I want to why and the purpose of doing that.

Yong
  • 738
  • 6
  • 19
  • Which locations are you talking about? The default prefix when configuring `gcc` or `binutils` is `/usr/local/` but most Linuxes use `/usr/` as the prefix of their installed `gcc`, so the system binary is in `/usr/bin/gcc` but a default configured manually-compiled `gcc` build tree put it in `/usr/local/bin/gcc` – Basile Starynkevitch Oct 18 '12 at 07:46

1 Answers1

1

Essentially, the binary that is in /tools/$LFS_TGT/bin is the version of the tool that is specifically built for that particular $LFS_TGT. A second copy is placed in /tools/$LFS_TGT, because the tool is intended to replace the one that is already present there because you told it to do that using the --with-sysroot option

Anya Shenanigans
  • 91,618
  • 3
  • 107
  • 122