3.2. Library Configurations

Sourcery G++ includes copies of run-time libraries that have been built with optimizations for different target architecture variants or other sets of build options. Each such set of libraries is referred to as a multilib. When you link a target application, Sourcery G++ selects the multilib matching the build options you have selected.

Sourcery G++ Lite includes linker scripts as well as runtime libraries for each multilib. You can find these files in multilib-specific subdirectories of the mips-sde-elf/lib directory of your Sourcery G++ install.

3.2.1. Included Libraries

The following library configurations are available in Sourcery G++ Lite for MIPS ELF.

MIPS32 revision 2 - Big-Endian, O32
Command-line option(s):default
Library subdirectory:./
MIPS32 revision 2 - Little-Endian, O32
Command-line option(s):-EL
Library subdirectory:el/
MIPS32 revision 2 - Big-Endian, O32, mips16
Command-line option(s):-mips16
Library subdirectory:mips16/
MIPS32 revision 2 - Big-Endian, O32, fp64
Command-line option(s):-mfp64
Library subdirectory:fp64/
MIPS32 revision 2 - Soft-Float, O32
Command-line option(s):-msoft-float
Library subdirectory:sof/
MIPS32 revision 2 - No-Float, O32
Command-line option(s):-mno-float
Library subdirectory:nof/
MIPS32 revision 2 - Big-Endian, O32, mips16, fp64
Command-line option(s):-mips16 -mfp64
Library subdirectory:mips16/fp64/
MIPS32 revision 2 - Big-Endian, O32, mips16, Soft-Float
Command-line option(s):-mips16 -msoft-float
Library subdirectory:mips16/sof/
MIPS32 revision 2 - Big-Endian, O32, mips16, No-Float
Command-line option(s):-mips16 -mno-float
Library subdirectory:mips16/nof/
MIPS32 revision 2 - Big-Endian, O32, mips16, code-readable=no
Command-line option(s):-mips16 -mcode-readable=no
Library subdirectory:mips16/spram/
MIPS32 revision 2 - Big-Endian, O32, mips16, fp64, code-readable=no
Command-line option(s):-mips16 -mfp64 -mcode-readable=no
Library subdirectory:mips16/fp64/spram/
MIPS32 revision 2 - Big-Endian, O32, mips16, Soft-Float, code-readable=no
Command-line option(s):-mips16 -msoft-float -mcode-readable=no
Library subdirectory:mips16/sof/spram/
MIPS32 revision 2 - Big-Endian, O32, mips16, No-Float, code-readable=no
Command-line option(s):-mips16 -mno-float -mcode-readable=no
Library subdirectory:mips16/nof/spram/
MIPS32 revision 2 - Little-Endian, O32, mips16
Command-line option(s):-EL -mips16
Library subdirectory:el/mips16/
MIPS32 revision 2 - Little-Endian, O32, fp64
Command-line option(s):-EL -mfp64
Library subdirectory:el/fp64/
MIPS32 revision 2 - Little-Endian, O32, Soft-Float
Command-line option(s):-EL -msoft-float
Library subdirectory:el/sof/
MIPS32 revision 2 - Little-Endian, O32, No-Float
Command-line option(s):-EL -mno-float
Library subdirectory:el/nof/
MIPS32 revision 2 - Little-Endian, O32, mips16, fp64
Command-line option(s):-EL -mips16 -mfp64
Library subdirectory:el/mips16/fp64/
MIPS32 revision 2 - Little-Endian, O32, mips16, Soft-Float
Command-line option(s):-EL -mips16 -msoft-float
Library subdirectory:el/mips16/sof/
MIPS32 revision 2 - Little-Endian, O32, mips16, No-Float
Command-line option(s):-EL -mips16 -mno-float
Library subdirectory:el/mips16/nof/
MIPS32 revision 2 - Little-Endian, O32, mips16, code-readable=no
Command-line option(s):-EL -mips16 -mcode-readable=no
Library subdirectory:el/mips16/spram/
MIPS32 revision 2 - Little-Endian, O32, mips16, fp64, code-readable=no
Command-line option(s):-EL -mips16 -mfp64 -mcode-readable=no
Library subdirectory:el/mips16/fp64/spram/
MIPS32 revision 2 - Little-Endian, O32, mips16, Soft-Float, code-readable=no
Command-line option(s):-EL -mips16 -msoft-float -mcode-readable=no
Library subdirectory:el/mips16/sof/spram/
MIPS32 revision 2 - Little-Endian, O32, mips16, No-Float, code-readable=no
Command-line option(s):-EL -mips16 -mno-float -mcode-readable=no
Library subdirectory:el/mips16/nof/spram/
MIPS32 revision 2 - Big-Endian, O32, micromips
Command-line option(s):-mmicromips
Library subdirectory:micromips/
MIPS32 revision 2 - Big-Endian, O32, micromips, Soft-Float
Command-line option(s):-mmicromips -msoft-float
Library subdirectory:micromips/sof/
MIPS32 revision 2 - Little-Endian, O32, micromips
Command-line option(s):-EL -mmicromips
Library subdirectory:el/micromips/
MIPS32 revision 2 - Little-Endian, O32, micromips, Soft-Float
Command-line option(s):-EL -mmicromips -msoft-float
Library subdirectory:el/micromips/sof/

3.2.2. Library Selection

A given multilib may be compatible with additional processors and build options beyond those listed above. However, even if a particular set of command-line options produces code compatible with one of the provided multilibs, those options may not be sufficient to identify the intended library to the linker. For example, on some targets, specifying only a processor option on the command line may imply architecture features or floating-point support for compilation, but not for library selection. The details of the mapping from command-line options to multilibs are target-specific and quite complex. Therefore, it is recommended that your link command line include exactly the options listed in the tables above for your intended target multilib. In some cases, you may need to supply different options for linking than for compilation.

If you are uncertain which multilib is selected by a particular set of command-line options, GCC can tell you if you invoke it with the -print-multi-directory option in addition to your other build options. For example:

> mips-sde-elf-gcc -print-multi-directory options...

The output of this command is a directory name for the multilib, which you can look up in the tables given previously.