Contents|Index|Previous|Next
 Tools and libraries for a cross-compiler   

If you have a cross-assembler and cross-linker available, you should install them now. Put them in the directory, /usr/local/target/bin. What follows are the tools you should put in this directory. The installation of GNU CC will find these programs in that directory, and copy or link them to the proper place to for the cross-compiler to find them when run later.

The easiest way to provide these files is to build the Binutils package and GAS. Configure them with the same ‘--host’ and ‘--target’ options that you use for configuring GNU CC, then build and install them. They install their executables automatically into the proper directory. Alas, they do not support all the targets that GNU CC supports.

If you want to install libraries to use with the cross-compiler, such as a standard C library, put them in the directory ‘/usr/local/target/lib’; installation of GNU CC copies all the files in that subdirectory into the proper place for GNU CC to find them and link with them.

The following example shows how to copy some libraries from a target-machine.

The precise set of libraries you’ll need, and their locations on the target machine, vary depending on its operating system.

Many targets require “start files” such as ‘crt0.o’ and ‘crtn.o’ which are linked into each executable. These too should be placed in ‘/usr/local/target/lib’. There may be several alternatives for ‘crt0.o’, for use with profiling or other compilation options. Check your target’s definition of STARTFILE_SPEC to find out what start files it uses.

The following is an example of copying these files from a target-machine.


Top|Contents|Index|Previous|Next