OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [doc/] [fragments.texi] - Diff between revs 816 and 826

Only display areas with differences | Details | Blame | View Log

Rev 816 Rev 826
@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
@c 1999, 2000, 2001, 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
@c 1999, 2000, 2001, 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@c For copying conditions, see the file gcc.texi.
 
 
@node Fragments
@node Fragments
@chapter Makefile Fragments
@chapter Makefile Fragments
@cindex makefile fragment
@cindex makefile fragment
 
 
When you configure GCC using the @file{configure} script, it will
When you configure GCC using the @file{configure} script, it will
construct the file @file{Makefile} from the template file
construct the file @file{Makefile} from the template file
@file{Makefile.in}.  When it does this, it can incorporate makefile
@file{Makefile.in}.  When it does this, it can incorporate makefile
fragments from the @file{config} directory.  These are used to set
fragments from the @file{config} directory.  These are used to set
Makefile parameters that are not amenable to being calculated by
Makefile parameters that are not amenable to being calculated by
autoconf.  The list of fragments to incorporate is set by
autoconf.  The list of fragments to incorporate is set by
@file{config.gcc} (and occasionally @file{config.build}
@file{config.gcc} (and occasionally @file{config.build}
and @file{config.host}); @xref{System Config}.
and @file{config.host}); @xref{System Config}.
 
 
Fragments are named either @file{t-@var{target}} or @file{x-@var{host}},
Fragments are named either @file{t-@var{target}} or @file{x-@var{host}},
depending on whether they are relevant to configuring GCC to produce
depending on whether they are relevant to configuring GCC to produce
code for a particular target, or to configuring GCC to run on a
code for a particular target, or to configuring GCC to run on a
particular host.  Here @var{target} and @var{host} are mnemonics
particular host.  Here @var{target} and @var{host} are mnemonics
which usually have some relationship to the canonical system name, but
which usually have some relationship to the canonical system name, but
no formal connection.
no formal connection.
 
 
If these files do not exist, it means nothing needs to be added for a
If these files do not exist, it means nothing needs to be added for a
given target or host.  Most targets need a few @file{t-@var{target}}
given target or host.  Most targets need a few @file{t-@var{target}}
fragments, but needing @file{x-@var{host}} fragments is rare.
fragments, but needing @file{x-@var{host}} fragments is rare.
 
 
@menu
@menu
* Target Fragment:: Writing @file{t-@var{target}} files.
* Target Fragment:: Writing @file{t-@var{target}} files.
* Host Fragment::   Writing @file{x-@var{host}} files.
* Host Fragment::   Writing @file{x-@var{host}} files.
@end menu
@end menu
 
 
@node Target Fragment
@node Target Fragment
@section Target Makefile Fragments
@section Target Makefile Fragments
@cindex target makefile fragment
@cindex target makefile fragment
@cindex @file{t-@var{target}}
@cindex @file{t-@var{target}}
 
 
Target makefile fragments can set these Makefile variables.
Target makefile fragments can set these Makefile variables.
 
 
@table @code
@table @code
@findex LIBGCC2_CFLAGS
@findex LIBGCC2_CFLAGS
@item LIBGCC2_CFLAGS
@item LIBGCC2_CFLAGS
Compiler flags to use when compiling @file{libgcc2.c}.
Compiler flags to use when compiling @file{libgcc2.c}.
 
 
@findex LIB2FUNCS_EXTRA
@findex LIB2FUNCS_EXTRA
@item LIB2FUNCS_EXTRA
@item LIB2FUNCS_EXTRA
A list of source file names to be compiled or assembled and inserted
A list of source file names to be compiled or assembled and inserted
into @file{libgcc.a}.
into @file{libgcc.a}.
 
 
@findex Floating Point Emulation
@findex Floating Point Emulation
@item Floating Point Emulation
@item Floating Point Emulation
To have GCC include software floating point libraries in @file{libgcc.a}
To have GCC include software floating point libraries in @file{libgcc.a}
define @code{FPBIT} and @code{DPBIT} along with a few rules as follows:
define @code{FPBIT} and @code{DPBIT} along with a few rules as follows:
@smallexample
@smallexample
# We want fine grained libraries, so use the new code
# We want fine grained libraries, so use the new code
# to build the floating point emulation libraries.
# to build the floating point emulation libraries.
FPBIT = fp-bit.c
FPBIT = fp-bit.c
DPBIT = dp-bit.c
DPBIT = dp-bit.c
 
 
 
 
fp-bit.c: $(srcdir)/config/fp-bit.c
fp-bit.c: $(srcdir)/config/fp-bit.c
        echo '#define FLOAT' > fp-bit.c
        echo '#define FLOAT' > fp-bit.c
        cat $(srcdir)/config/fp-bit.c >> fp-bit.c
        cat $(srcdir)/config/fp-bit.c >> fp-bit.c
 
 
dp-bit.c: $(srcdir)/config/fp-bit.c
dp-bit.c: $(srcdir)/config/fp-bit.c
        cat $(srcdir)/config/fp-bit.c > dp-bit.c
        cat $(srcdir)/config/fp-bit.c > dp-bit.c
@end smallexample
@end smallexample
 
 
You may need to provide additional #defines at the beginning of @file{fp-bit.c}
You may need to provide additional #defines at the beginning of @file{fp-bit.c}
and @file{dp-bit.c} to control target endianness and other options.
and @file{dp-bit.c} to control target endianness and other options.
 
 
 
 
@findex CRTSTUFF_T_CFLAGS
@findex CRTSTUFF_T_CFLAGS
@item CRTSTUFF_T_CFLAGS
@item CRTSTUFF_T_CFLAGS
Special flags used when compiling @file{crtstuff.c}.
Special flags used when compiling @file{crtstuff.c}.
@xref{Initialization}.
@xref{Initialization}.
 
 
@findex CRTSTUFF_T_CFLAGS_S
@findex CRTSTUFF_T_CFLAGS_S
@item CRTSTUFF_T_CFLAGS_S
@item CRTSTUFF_T_CFLAGS_S
Special flags used when compiling @file{crtstuff.c} for shared
Special flags used when compiling @file{crtstuff.c} for shared
linking.  Used if you use @file{crtbeginS.o} and @file{crtendS.o}
linking.  Used if you use @file{crtbeginS.o} and @file{crtendS.o}
in @code{EXTRA-PARTS}.
in @code{EXTRA-PARTS}.
@xref{Initialization}.
@xref{Initialization}.
 
 
@findex MULTILIB_OPTIONS
@findex MULTILIB_OPTIONS
@item MULTILIB_OPTIONS
@item MULTILIB_OPTIONS
For some targets, invoking GCC in different ways produces objects
For some targets, invoking GCC in different ways produces objects
that can not be linked together.  For example, for some targets GCC
that can not be linked together.  For example, for some targets GCC
produces both big and little endian code.  For these targets, you must
produces both big and little endian code.  For these targets, you must
arrange for multiple versions of @file{libgcc.a} to be compiled, one for
arrange for multiple versions of @file{libgcc.a} to be compiled, one for
each set of incompatible options.  When GCC invokes the linker, it
each set of incompatible options.  When GCC invokes the linker, it
arranges to link in the right version of @file{libgcc.a}, based on
arranges to link in the right version of @file{libgcc.a}, based on
the command line options used.
the command line options used.
 
 
The @code{MULTILIB_OPTIONS} macro lists the set of options for which
The @code{MULTILIB_OPTIONS} macro lists the set of options for which
special versions of @file{libgcc.a} must be built.  Write options that
special versions of @file{libgcc.a} must be built.  Write options that
are mutually incompatible side by side, separated by a slash.  Write
are mutually incompatible side by side, separated by a slash.  Write
options that may be used together separated by a space.  The build
options that may be used together separated by a space.  The build
procedure will build all combinations of compatible options.
procedure will build all combinations of compatible options.
 
 
For example, if you set @code{MULTILIB_OPTIONS} to @samp{m68000/m68020
For example, if you set @code{MULTILIB_OPTIONS} to @samp{m68000/m68020
msoft-float}, @file{Makefile} will build special versions of
msoft-float}, @file{Makefile} will build special versions of
@file{libgcc.a} using the following sets of options:  @option{-m68000},
@file{libgcc.a} using the following sets of options:  @option{-m68000},
@option{-m68020}, @option{-msoft-float}, @samp{-m68000 -msoft-float}, and
@option{-m68020}, @option{-msoft-float}, @samp{-m68000 -msoft-float}, and
@samp{-m68020 -msoft-float}.
@samp{-m68020 -msoft-float}.
 
 
@findex MULTILIB_DIRNAMES
@findex MULTILIB_DIRNAMES
@item MULTILIB_DIRNAMES
@item MULTILIB_DIRNAMES
If @code{MULTILIB_OPTIONS} is used, this variable specifies the
If @code{MULTILIB_OPTIONS} is used, this variable specifies the
directory names that should be used to hold the various libraries.
directory names that should be used to hold the various libraries.
Write one element in @code{MULTILIB_DIRNAMES} for each element in
Write one element in @code{MULTILIB_DIRNAMES} for each element in
@code{MULTILIB_OPTIONS}.  If @code{MULTILIB_DIRNAMES} is not used, the
@code{MULTILIB_OPTIONS}.  If @code{MULTILIB_DIRNAMES} is not used, the
default value will be @code{MULTILIB_OPTIONS}, with all slashes treated
default value will be @code{MULTILIB_OPTIONS}, with all slashes treated
as spaces.
as spaces.
 
 
For example, if @code{MULTILIB_OPTIONS} is set to @samp{m68000/m68020
For example, if @code{MULTILIB_OPTIONS} is set to @samp{m68000/m68020
msoft-float}, then the default value of @code{MULTILIB_DIRNAMES} is
msoft-float}, then the default value of @code{MULTILIB_DIRNAMES} is
@samp{m68000 m68020 msoft-float}.  You may specify a different value if
@samp{m68000 m68020 msoft-float}.  You may specify a different value if
you desire a different set of directory names.
you desire a different set of directory names.
 
 
@findex MULTILIB_MATCHES
@findex MULTILIB_MATCHES
@item MULTILIB_MATCHES
@item MULTILIB_MATCHES
Sometimes the same option may be written in two different ways.  If an
Sometimes the same option may be written in two different ways.  If an
option is listed in @code{MULTILIB_OPTIONS}, GCC needs to know about
option is listed in @code{MULTILIB_OPTIONS}, GCC needs to know about
any synonyms.  In that case, set @code{MULTILIB_MATCHES} to a list of
any synonyms.  In that case, set @code{MULTILIB_MATCHES} to a list of
items of the form @samp{option=option} to describe all relevant
items of the form @samp{option=option} to describe all relevant
synonyms.  For example, @samp{m68000=mc68000 m68020=mc68020}.
synonyms.  For example, @samp{m68000=mc68000 m68020=mc68020}.
 
 
@findex MULTILIB_EXCEPTIONS
@findex MULTILIB_EXCEPTIONS
@item MULTILIB_EXCEPTIONS
@item MULTILIB_EXCEPTIONS
Sometimes when there are multiple sets of @code{MULTILIB_OPTIONS} being
Sometimes when there are multiple sets of @code{MULTILIB_OPTIONS} being
specified, there are combinations that should not be built.  In that
specified, there are combinations that should not be built.  In that
case, set @code{MULTILIB_EXCEPTIONS} to be all of the switch exceptions
case, set @code{MULTILIB_EXCEPTIONS} to be all of the switch exceptions
in shell case syntax that should not be built.
in shell case syntax that should not be built.
 
 
For example the ARM processor cannot execute both hardware floating
For example the ARM processor cannot execute both hardware floating
point instructions and the reduced size THUMB instructions at the same
point instructions and the reduced size THUMB instructions at the same
time, so there is no need to build libraries with both of these
time, so there is no need to build libraries with both of these
options enabled.  Therefore @code{MULTILIB_EXCEPTIONS} is set to:
options enabled.  Therefore @code{MULTILIB_EXCEPTIONS} is set to:
@smallexample
@smallexample
*mthumb/*mhard-float*
*mthumb/*mhard-float*
@end smallexample
@end smallexample
 
 
@findex MULTILIB_EXTRA_OPTS
@findex MULTILIB_EXTRA_OPTS
@item MULTILIB_EXTRA_OPTS
@item MULTILIB_EXTRA_OPTS
Sometimes it is desirable that when building multiple versions of
Sometimes it is desirable that when building multiple versions of
@file{libgcc.a} certain options should always be passed on to the
@file{libgcc.a} certain options should always be passed on to the
compiler.  In that case, set @code{MULTILIB_EXTRA_OPTS} to be the list
compiler.  In that case, set @code{MULTILIB_EXTRA_OPTS} to be the list
of options to be used for all builds.  If you set this, you should
of options to be used for all builds.  If you set this, you should
probably set @code{CRTSTUFF_T_CFLAGS} to a dash followed by it.
probably set @code{CRTSTUFF_T_CFLAGS} to a dash followed by it.
 
 
@findex NATIVE_SYSTEM_HEADER_DIR
@findex NATIVE_SYSTEM_HEADER_DIR
@item NATIVE_SYSTEM_HEADER_DIR
@item NATIVE_SYSTEM_HEADER_DIR
If the default location for system headers is not @file{/usr/include},
If the default location for system headers is not @file{/usr/include},
you must set this to the directory containing the headers.  This value
you must set this to the directory containing the headers.  This value
should match the value of the @code{SYSTEM_INCLUDE_DIR} macro.
should match the value of the @code{SYSTEM_INCLUDE_DIR} macro.
 
 
@findex SPECS
@findex SPECS
@item SPECS
@item SPECS
Unfortunately, setting @code{MULTILIB_EXTRA_OPTS} is not enough, since
Unfortunately, setting @code{MULTILIB_EXTRA_OPTS} is not enough, since
it does not affect the build of target libraries, at least not the
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
build of the default multilib.  One possible work-around is to use
@code{DRIVER_SELF_SPECS} to bring options from the @file{specs} file
@code{DRIVER_SELF_SPECS} to bring options from the @file{specs} file
as if they had been passed in the compiler driver command line.
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
However, you don't want to be adding these options after the toolchain
is installed, so you can instead tweak the @file{specs} file that will
is installed, so you can instead tweak the @file{specs} file that will
be used during the toolchain build, while you still install the
be used during the toolchain build, while you still install the
original, built-in @file{specs}.  The trick is to set @code{SPECS} to
original, built-in @file{specs}.  The trick is to set @code{SPECS} to
some other filename (say @file{specs.install}), that will then be
some other filename (say @file{specs.install}), that will then be
created out of the built-in specs, and introduce a @file{Makefile}
created out of the built-in specs, and introduce a @file{Makefile}
rule to generate the @file{specs} file that's going to be used at
rule to generate the @file{specs} file that's going to be used at
build time out of your @file{specs.install}.
build time out of your @file{specs.install}.
 
 
@item T_CFLAGS
@item T_CFLAGS
These are extra flags to pass to the C compiler.  They are used both
These are extra flags to pass to the C compiler.  They are used both
when building GCC, and when compiling things with the just-built GCC@.
when building GCC, and when compiling things with the just-built GCC@.
This variable is deprecated and should not be used.
This variable is deprecated and should not be used.
@end table
@end table
 
 
@node Host Fragment
@node Host Fragment
@section Host Makefile Fragments
@section Host Makefile Fragments
@cindex host makefile fragment
@cindex host makefile fragment
@cindex @file{x-@var{host}}
@cindex @file{x-@var{host}}
 
 
The use of @file{x-@var{host}} fragments is discouraged.  You should only
The use of @file{x-@var{host}} fragments is discouraged.  You should only
use it for makefile dependencies.
use it for makefile dependencies.
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.