OpenPlayer.org

  • Increase font size
  • Default font size
  • Decrease font size
Home ->> Resource ->> Tutorials ->> CS Multi-Library Tour

CS Multi-Library Tour

E-mail Print PDF

The Code Sourcery tool chains are multiple library builds. The libraries that will be used is determined by a sub-set of the options passed to gcc.

The path to the library files that will be used in a compilation is displayed by the gcc command:

mszick@deb2core:~$ mips-sde-elf-gcc -print-multi-lib
.;
el;@EL
mips16;@mips16
fp64;@mfp64
sof;@msoft-float
nof;@mno-float
mips16/fp64;@mips16@mfp64
mips16/sof;@mips16@msoft-float
mips16/nof;@mips16@mno-float
mips16/spram;@mips16@mcode-readable=no
mips16/fp64/spram;@mips16@mfp64@mcode-readable=no
mips16/sof/spram;@mips16@msoft-float@mcode-readable=no
mips16/nof/spram;@mips16@mno-float@mcode-readable=no
el/mips16;@EL@mips16
el/fp64;@EL@mfp64
el/sof;@EL@msoft-float
el/nof;@EL@mno-float
el/mips16/fp64;@EL@mips16@mfp64
el/mips16/sof;@EL@mips16@msoft-float
el/mips16/nof;@EL@mips16@mno-float
el/mips16/spram;@EL@mips16@mcode-readable=no
el/mips16/fp64/spram;@EL@mips16@mfp64@mcode-readable=no
el/mips16/sof/spram;@EL@mips16@msoft-float@mcode-readable=no
el/mips16/nof/spram;@EL@mips16@mno-float@mcode-readable=no

A few notes on the nameing shown:

  • mips16 - Read as: mips16e (mips16 is no longer produced)
  • sof - Soft Float
  • nof - No Float
  • Hard Float is the default.
  • The *64 things are describing the floating point unit, this is a 32bit tool chain
  • el - Little Endian - Big Endian is the default
  • Default code generation is: mixed 32bit and mips16e code - you have to turn off mips16e (or mips-32)
  • spram - placement of data and/or code in the cache scratchpad rams (minimal support in 4.3, explict support in 4.5)

You can display the multi-library path that is selected by a set of options by replacing the output and input filenames in your command with the --print-multi-dir option:

mszick@deb2core:~$ mips-sde-elf-gcc -EL -mno-mips16 -msoft-float --print-multi-dir
el/sof

mszick@deb2core:~$ mips-sde-elf-gcc -EL -msoft-float --print-multi-dir
el/sof

In this case, that displays you will be using the same library path for either mixed 32bit / mips16e code or pure 32bit code.

Nearly every MIPS-Revision 2 core supports the mips16e instruction set but it is not a requirement. So for code expected to run on an unknown core, disabling the generation of mips16e instructions is probably the best starting point.

The same reasoning applies to the disabling of hardware floating point. None of the various floating point units are a requirement, so telling the compiler to generate software floating point routines is the best starting point.

Adding the -Wl,-t option to the gcc command line will pass the -t (trace input file locations) to the linker. This will cause the linker to generate a list of the full path and filename to each file as it processes them.  Just in case there is a question of exactly which libraries in the multi-library set the linker acutally used.

 

Login