Target makefile fragments can set these Makefile variables.
Floating Point Emulation
DPBITalong with a few rules as follows:
# We want fine grained libraries, so use the new code # to build the floating point emulation libraries. FPBIT = fp-bit.c DPBIT = dp-bit.c fp-bit.c: $(srcdir)/config/fp-bit.c echo '#define FLOAT' > fp-bit.c cat $(srcdir)/config/fp-bit.c >> fp-bit.c dp-bit.c: $(srcdir)/config/fp-bit.c cat $(srcdir)/config/fp-bit.c > dp-bit.c
You may need to provide additional #defines at the beginning of fp-bit.c and dp-bit.c to control target endianness and other options.
EXTRA-PARTS. See Initialization.
MULTILIB_OPTIONS macro lists the set of options for which
special versions of libgcc.a must be built. Write options that
are mutually incompatible side by side, separated by a slash. Write
options that may be used together separated by a space. The build
procedure will build all combinations of compatible options.
For example, if you set
MULTILIB_OPTIONS to ‘m68000/m68020
msoft-float’, Makefile will build special versions of
libgcc.a using the following sets of options: -m68000,
-m68020, -msoft-float, ‘-m68000 -msoft-float’, and
MULTILIB_OPTIONSis used, this variable specifies the directory names that should be used to hold the various libraries. Write one element in
MULTILIB_DIRNAMESfor each element in
MULTILIB_DIRNAMESis not used, the default value will be
MULTILIB_OPTIONS, with all slashes treated as spaces.
MULTILIB_DIRNAMES describes the multilib directories using GCC
conventions and is applied to directories that are part of the GCC
installation. When multilib-enabled, the compiler will add a
subdirectory of the form prefix/multilib before each
directory in the search path for libraries and crt files.
For example, if
MULTILIB_OPTIONS is set to ‘m68000/m68020
msoft-float’, then the default value of
‘m68000 m68020 msoft-float’. You may specify a different value if
you desire a different set of directory names.
MULTILIB_OPTIONS, GCC needs to know about any synonyms. In that case, set
MULTILIB_MATCHESto a list of items of the form ‘option=option’ to describe all relevant synonyms. For example, ‘m68000=mc68000 m68020=mc68020’.
MULTILIB_OPTIONSbeing specified, there are combinations that should not be built. In that case, set
MULTILIB_EXCEPTIONSto be all of the switch exceptions in shell case syntax that should not be built.
For example the ARM processor cannot execute both hardware floating
point instructions and the reduced size THUMB instructions at the same
time, so there is no need to build libraries with both of these
options enabled. Therefore
MULTILIB_EXCEPTIONS is set to:
MULTILIB_EXTRA_OPTSto be the list of options to be used for all builds. If you set this, you should probably set
CRTSTUFF_T_CFLAGSto a dash followed by it.
MULTILIB_OPTIONSis used, this variable specifies a list of subdirectory names, that are used to modify the search path depending on the chosen multilib. Unlike
MULTILIB_OSDIRNAMESdescribes the multilib directories using operating systems conventions, and is applied to the directories such as
libor those in the LIBRARY_PATH environment variable. The format is either the same as of
MULTILIB_DIRNAMES, or a set of mappings. When it is the same as
MULTILIB_DIRNAMES, it describes the multilib directories using operating system conventions, rather than GCC conventions. When it is a set of mappings of the form gccdir=osdir, the left side gives the GCC convention and the right gives the equivalent OS defined location. If the osdir part begins with a ‘!’, GCC will not search in the non-multilib directory and use exclusively the multilib directory. Otherwise, the compiler will examine the search path for libraries and crt files twice; the first time it will add multilib to each directory in the search path, the second it will not.
For configurations that support both multilib and multiarch,
MULTILIB_OSDIRNAMES also encodes the multiarch name, thus
MULTIARCH_DIRNAME. The multiarch name is appended to
each directory name, separated by a colon (e.g.
Each multiarch subdirectory will be searched before the corresponding OS
multilib directory, for example ‘/lib/i386-linux-gnu’ before
‘/lib/../lib32’. The multiarch name will also be used to modify the
system header search path, as explained for
The multiarch name is used to augment the search path for libraries, crt
files and system header files with additional locations. The compiler
will add a multiarch subdirectory of the form
prefix/multiarch before each directory in the library and
crt search path. It will also add two directories
NATIVE_SYSTEM_HEADER_DIR/multiarch) to the system header
search path, respectively before
MULTIARCH_DIRNAME is not used for configurations that support
both multilib and multiarch. In that case, multiarch names are encoded
More documentation about multiarch can be found at http://wiki.debian.org/Multiarch.
MULTILIB_EXTRA_OPTSis not enough, since it does not affect the build of target libraries, at least not the build of the default multilib. One possible work-around is to use
DRIVER_SELF_SPECSto bring options from the specs file as if they had been passed in the compiler driver command line. However, you don't want to be adding these options after the toolchain is installed, so you can instead tweak the specs file that will be used during the toolchain build, while you still install the original, built-in specs. The trick is to set
SPECSto some other filename (say specs.install), that will then be created out of the built-in specs, and introduce a Makefile rule to generate the specs file that's going to be used at build time out of your specs.install.