You are here

The GNU tools

The GNU tools used to build user programs from C or C++ source code traditionally have names such as:

  • gcc (the GNU C compiler)
  • g++ (the GNU C++ compiler)
  • cpp (the GNU C pre-processor)
  • ld (the GNU linker)
  • as (the GNU assembler)
  • ar (the GNU librarian)

On the Linux host system x86 PC, these executable names are already used by the native x86 Linux GNU tools. Therefore, to distinguish between the different sets of tools, the names of STLinux cross tools have a prefix of:

  • sh4-linux- for the ST40 Linux cross tools
  • armv5-linux- for the ARM version 5 Linux cross tools
  • armv7-linux- for the ARM version 7 Linux cross tools
  • st231-linux- for the ST231 Linux cross tools

For example, the cross version of gcc for the ST231 Linux system is called st231-linux-gcc and the for the ST40 Linux system it is called sh4-linux-gcc.

On the Linux target system, the tools have their own default names (for example, gcc), but for convenience when moving build scripts between the cross and the native environments, the cross names (for example, sh4-linux-gcc) are provided as synonyms. The executables referenced by these two names are identical.

Cross development

When working in cross development mode, the tools generate their output in the file system of the host machine. These executables are not x86 executables for the host machine but SoC executables for the target, and they must be made visible to the target Linux system before they can be loaded and executed. During development, the simplest way to do this is to place them within that part of the host PC file system that has been NFS mounted by the target system. This means that they are accessible from both the cross development host Linux system and the target Linux environment, and can be run from the shell of the target like any other user program.

Native development

When working in native target development mode, the tools operate in the familiar way; the target system is used directly as the development host.