crosstool-ng, directory structure, and sysroot

For your first question, as toolchain installed directory:

  • bin/arm-unknown-linux-gnueabi-gcc
  • arm-unknown-linux-gnueabi/bin/gcc

They are the same, indeed hard links.

You can use arm-unknown-linux-gnueabi-gcc by CC=arm-unknown-linux-gnueabi-gcc, e.g.

export PATH=<toolchain installed dir>/bin:$PATH
CC=arm-unknown-linux-gnueabi-gcc ./configure 
make

Or

export PATH=<toolchain installed dir>/arm-unknown-linux-gnueabi/bin:$PATH
./configure 
make

I always used the first form, and I am not sure if the latter form works.

For your second question, in my experience, you don't need to concern about sysroot. cross-compiler will find the correct C header files in sysroot/usr/include automatically.

Except that you want to cross-compile some libraries and install them into sysroot, you can get it by

export PATH=<toolchain installed dir>/bin:$PATH
CC=arm-unknown-linux-gnueabi-gcc ./configure --prefix=<toolchain installed dir>/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot
make
make install