annotate gcc/doc/fragments.texi @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1 @c Copyright (C) 1988-2018 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 @c This is part of the GCC manual.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 @c For copying conditions, see the file gcc.texi.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 @node Fragments
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 @chapter Makefile Fragments
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 @cindex makefile fragment
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 When you configure GCC using the @file{configure} script, it will
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 construct the file @file{Makefile} from the template file
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 @file{Makefile.in}. When it does this, it can incorporate makefile
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 fragments from the @file{config} directory. These are used to set
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 Makefile parameters that are not amenable to being calculated by
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 autoconf. The list of fragments to incorporate is set by
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 @file{config.gcc} (and occasionally @file{config.build}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 and @file{config.host}); @xref{System Config}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 Fragments are named either @file{t-@var{target}} or @file{x-@var{host}},
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 depending on whether they are relevant to configuring GCC to produce
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 code for a particular target, or to configuring GCC to run on a
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 particular host. Here @var{target} and @var{host} are mnemonics
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 which usually have some relationship to the canonical system name, but
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 no formal connection.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 If these files do not exist, it means nothing needs to be added for a
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 given target or host. Most targets need a few @file{t-@var{target}}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 fragments, but needing @file{x-@var{host}} fragments is rare.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 @menu
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 * Target Fragment:: Writing @file{t-@var{target}} files.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 * Host Fragment:: Writing @file{x-@var{host}} files.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 @end menu
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 @node Target Fragment
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 @section Target Makefile Fragments
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 @cindex target makefile fragment
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 @cindex @file{t-@var{target}}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 Target makefile fragments can set these Makefile variables.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 @table @code
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 @findex LIBGCC2_CFLAGS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 @item LIBGCC2_CFLAGS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 Compiler flags to use when compiling @file{libgcc2.c}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 @findex LIB2FUNCS_EXTRA
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 @item LIB2FUNCS_EXTRA
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 A list of source file names to be compiled or assembled and inserted
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 into @file{libgcc.a}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 @findex CRTSTUFF_T_CFLAGS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 @item CRTSTUFF_T_CFLAGS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 Special flags used when compiling @file{crtstuff.c}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 @xref{Initialization}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 @findex CRTSTUFF_T_CFLAGS_S
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 @item CRTSTUFF_T_CFLAGS_S
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 Special flags used when compiling @file{crtstuff.c} for shared
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 linking. Used if you use @file{crtbeginS.o} and @file{crtendS.o}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 in @code{EXTRA-PARTS}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 @xref{Initialization}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 @findex MULTILIB_OPTIONS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 @item MULTILIB_OPTIONS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 For some targets, invoking GCC in different ways produces objects
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 that can not be linked together. For example, for some targets GCC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 produces both big and little endian code. For these targets, you must
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 arrange for multiple versions of @file{libgcc.a} to be compiled, one for
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 each set of incompatible options. When GCC invokes the linker, it
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 arranges to link in the right version of @file{libgcc.a}, based on
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 the command line options used.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 The @code{MULTILIB_OPTIONS} macro lists the set of options for which
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 special versions of @file{libgcc.a} must be built. Write options that
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 are mutually incompatible side by side, separated by a slash. Write
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 options that may be used together separated by a space. The build
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 procedure will build all combinations of compatible options.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 For example, if you set @code{MULTILIB_OPTIONS} to @samp{m68000/m68020
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 msoft-float}, @file{Makefile} will build special versions of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 @file{libgcc.a} using the following sets of options: @option{-m68000},
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 @option{-m68020}, @option{-msoft-float}, @samp{-m68000 -msoft-float}, and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 @samp{-m68020 -msoft-float}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 @findex MULTILIB_DIRNAMES
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 @item MULTILIB_DIRNAMES
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 If @code{MULTILIB_OPTIONS} is used, this variable specifies the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 directory names that should be used to hold the various libraries.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 Write one element in @code{MULTILIB_DIRNAMES} for each element in
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 @code{MULTILIB_OPTIONS}. If @code{MULTILIB_DIRNAMES} is not used, the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 default value will be @code{MULTILIB_OPTIONS}, with all slashes treated
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 as spaces.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93
111
kono
parents: 0
diff changeset
94 @code{MULTILIB_DIRNAMES} describes the multilib directories using GCC
kono
parents: 0
diff changeset
95 conventions and is applied to directories that are part of the GCC
kono
parents: 0
diff changeset
96 installation. When multilib-enabled, the compiler will add a
kono
parents: 0
diff changeset
97 subdirectory of the form @var{prefix}/@var{multilib} before each
kono
parents: 0
diff changeset
98 directory in the search path for libraries and crt files.
kono
parents: 0
diff changeset
99
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 For example, if @code{MULTILIB_OPTIONS} is set to @samp{m68000/m68020
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 msoft-float}, then the default value of @code{MULTILIB_DIRNAMES} is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 @samp{m68000 m68020 msoft-float}. You may specify a different value if
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 you desire a different set of directory names.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
104
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 @findex MULTILIB_MATCHES
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 @item MULTILIB_MATCHES
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 Sometimes the same option may be written in two different ways. If an
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 option is listed in @code{MULTILIB_OPTIONS}, GCC needs to know about
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 any synonyms. In that case, set @code{MULTILIB_MATCHES} to a list of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 items of the form @samp{option=option} to describe all relevant
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 synonyms. For example, @samp{m68000=mc68000 m68020=mc68020}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 @findex MULTILIB_EXCEPTIONS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 @item MULTILIB_EXCEPTIONS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 Sometimes when there are multiple sets of @code{MULTILIB_OPTIONS} being
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 specified, there are combinations that should not be built. In that
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 case, set @code{MULTILIB_EXCEPTIONS} to be all of the switch exceptions
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 in shell case syntax that should not be built.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 For example the ARM processor cannot execute both hardware floating
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 point instructions and the reduced size THUMB instructions at the same
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 time, so there is no need to build libraries with both of these
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 options enabled. Therefore @code{MULTILIB_EXCEPTIONS} is set to:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 @smallexample
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 *mthumb/*mhard-float*
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 @end smallexample
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127
111
kono
parents: 0
diff changeset
128 @findex MULTILIB_REQUIRED
kono
parents: 0
diff changeset
129 @item MULTILIB_REQUIRED
kono
parents: 0
diff changeset
130 Sometimes when there are only a few combinations are required, it would
kono
parents: 0
diff changeset
131 be a big effort to come up with a @code{MULTILIB_EXCEPTIONS} list to
kono
parents: 0
diff changeset
132 cover all undesired ones. In such a case, just listing all the required
kono
parents: 0
diff changeset
133 combinations in @code{MULTILIB_REQUIRED} would be more straightforward.
kono
parents: 0
diff changeset
134
kono
parents: 0
diff changeset
135 The way to specify the entries in @code{MULTILIB_REQUIRED} is same with
kono
parents: 0
diff changeset
136 the way used for @code{MULTILIB_EXCEPTIONS}, only this time what are
kono
parents: 0
diff changeset
137 required will be specified. Suppose there are multiple sets of
kono
parents: 0
diff changeset
138 @code{MULTILIB_OPTIONS} and only two combinations are required, one
kono
parents: 0
diff changeset
139 for ARMv7-M and one for ARMv7-R with hard floating-point ABI and FPU, the
kono
parents: 0
diff changeset
140 @code{MULTILIB_REQUIRED} can be set to:
kono
parents: 0
diff changeset
141 @smallexample
kono
parents: 0
diff changeset
142 @code{MULTILIB_REQUIRED} = mthumb/march=armv7-m
kono
parents: 0
diff changeset
143 @code{MULTILIB_REQUIRED} += march=armv7-r/mfloat-abi=hard/mfpu=vfpv3-d16
kono
parents: 0
diff changeset
144 @end smallexample
kono
parents: 0
diff changeset
145
kono
parents: 0
diff changeset
146 The @code{MULTILIB_REQUIRED} can be used together with
kono
parents: 0
diff changeset
147 @code{MULTILIB_EXCEPTIONS}. The option combinations generated from
kono
parents: 0
diff changeset
148 @code{MULTILIB_OPTIONS} will be filtered by @code{MULTILIB_EXCEPTIONS}
kono
parents: 0
diff changeset
149 and then by @code{MULTILIB_REQUIRED}.
kono
parents: 0
diff changeset
150
kono
parents: 0
diff changeset
151 @findex MULTILIB_REUSE
kono
parents: 0
diff changeset
152 @item MULTILIB_REUSE
kono
parents: 0
diff changeset
153 Sometimes it is desirable to reuse one existing multilib for different
kono
parents: 0
diff changeset
154 sets of options. Such kind of reuse can minimize the number of multilib
kono
parents: 0
diff changeset
155 variants. And for some targets it is better to reuse an existing multilib
kono
parents: 0
diff changeset
156 than to fall back to default multilib when there is no corresponding multilib.
kono
parents: 0
diff changeset
157 This can be done by adding reuse rules to @code{MULTILIB_REUSE}.
kono
parents: 0
diff changeset
158
kono
parents: 0
diff changeset
159 A reuse rule is comprised of two parts connected by equality sign. The left
kono
parents: 0
diff changeset
160 part is the option set used to build multilib and the right part is the option
kono
parents: 0
diff changeset
161 set that will reuse this multilib. Both parts should only use options
kono
parents: 0
diff changeset
162 specified in @code{MULTILIB_OPTIONS} and the equality signs found in options
kono
parents: 0
diff changeset
163 name should be replaced with periods. An explicit period in the rule can be
kono
parents: 0
diff changeset
164 escaped by preceding it with a backslash. The order of options in the left
kono
parents: 0
diff changeset
165 part matters and should be same with those specified in
kono
parents: 0
diff changeset
166 @code{MULTILIB_REQUIRED} or aligned with the order in @code{MULTILIB_OPTIONS}.
kono
parents: 0
diff changeset
167 There is no such limitation for options in the right part as we don't build
kono
parents: 0
diff changeset
168 multilib from them.
kono
parents: 0
diff changeset
169
kono
parents: 0
diff changeset
170 @code{MULTILIB_REUSE} is different from @code{MULTILIB_MATCHES} in that it
kono
parents: 0
diff changeset
171 sets up relations between two option sets rather than two options. Here is an
kono
parents: 0
diff changeset
172 example to demo how we reuse libraries built in Thumb mode for applications built
kono
parents: 0
diff changeset
173 in ARM mode:
kono
parents: 0
diff changeset
174 @smallexample
kono
parents: 0
diff changeset
175 @code{MULTILIB_REUSE} = mthumb/march.armv7-r=marm/march.armv7-r
kono
parents: 0
diff changeset
176 @end smallexample
kono
parents: 0
diff changeset
177
kono
parents: 0
diff changeset
178 Before the advent of @code{MULTILIB_REUSE}, GCC select multilib by comparing command
kono
parents: 0
diff changeset
179 line options with options used to build multilib. The @code{MULTILIB_REUSE} is
kono
parents: 0
diff changeset
180 complementary to that way. Only when the original comparison matches nothing it will
kono
parents: 0
diff changeset
181 work to see if it is OK to reuse some existing multilib.
kono
parents: 0
diff changeset
182
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
183 @findex MULTILIB_EXTRA_OPTS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
184 @item MULTILIB_EXTRA_OPTS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
185 Sometimes it is desirable that when building multiple versions of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
186 @file{libgcc.a} certain options should always be passed on to the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
187 compiler. In that case, set @code{MULTILIB_EXTRA_OPTS} to be the list
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
188 of options to be used for all builds. If you set this, you should
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
189 probably set @code{CRTSTUFF_T_CFLAGS} to a dash followed by it.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
190
111
kono
parents: 0
diff changeset
191 @findex MULTILIB_OSDIRNAMES
kono
parents: 0
diff changeset
192 @item MULTILIB_OSDIRNAMES
kono
parents: 0
diff changeset
193 If @code{MULTILIB_OPTIONS} is used, this variable specifies
kono
parents: 0
diff changeset
194 a list of subdirectory names, that are used to modify the search
kono
parents: 0
diff changeset
195 path depending on the chosen multilib. Unlike @code{MULTILIB_DIRNAMES},
kono
parents: 0
diff changeset
196 @code{MULTILIB_OSDIRNAMES} describes the multilib directories using
kono
parents: 0
diff changeset
197 operating systems conventions, and is applied to the directories such as
kono
parents: 0
diff changeset
198 @code{lib} or those in the @env{LIBRARY_PATH} environment variable.
kono
parents: 0
diff changeset
199 The format is either the same as of
kono
parents: 0
diff changeset
200 @code{MULTILIB_DIRNAMES}, or a set of mappings. When it is the same
kono
parents: 0
diff changeset
201 as @code{MULTILIB_DIRNAMES}, it describes the multilib directories
kono
parents: 0
diff changeset
202 using operating system conventions, rather than GCC conventions. When it is a set
kono
parents: 0
diff changeset
203 of mappings of the form @var{gccdir}=@var{osdir}, the left side gives
kono
parents: 0
diff changeset
204 the GCC convention and the right gives the equivalent OS defined
kono
parents: 0
diff changeset
205 location. If the @var{osdir} part begins with a @samp{!},
kono
parents: 0
diff changeset
206 GCC will not search in the non-multilib directory and use
kono
parents: 0
diff changeset
207 exclusively the multilib directory. Otherwise, the compiler will
kono
parents: 0
diff changeset
208 examine the search path for libraries and crt files twice; the first
kono
parents: 0
diff changeset
209 time it will add @var{multilib} to each directory in the search path,
kono
parents: 0
diff changeset
210 the second it will not.
kono
parents: 0
diff changeset
211
kono
parents: 0
diff changeset
212 For configurations that support both multilib and multiarch,
kono
parents: 0
diff changeset
213 @code{MULTILIB_OSDIRNAMES} also encodes the multiarch name, thus
kono
parents: 0
diff changeset
214 subsuming @code{MULTIARCH_DIRNAME}. The multiarch name is appended to
kono
parents: 0
diff changeset
215 each directory name, separated by a colon (e.g.
kono
parents: 0
diff changeset
216 @samp{../lib32:i386-linux-gnu}).
kono
parents: 0
diff changeset
217
kono
parents: 0
diff changeset
218 Each multiarch subdirectory will be searched before the corresponding OS
kono
parents: 0
diff changeset
219 multilib directory, for example @samp{/lib/i386-linux-gnu} before
kono
parents: 0
diff changeset
220 @samp{/lib/../lib32}. The multiarch name will also be used to modify the
kono
parents: 0
diff changeset
221 system header search path, as explained for @code{MULTIARCH_DIRNAME}.
kono
parents: 0
diff changeset
222
kono
parents: 0
diff changeset
223 @findex MULTIARCH_DIRNAME
kono
parents: 0
diff changeset
224 @item MULTIARCH_DIRNAME
kono
parents: 0
diff changeset
225 This variable specifies the multiarch name for configurations that are
kono
parents: 0
diff changeset
226 multiarch-enabled but not multilibbed configurations.
kono
parents: 0
diff changeset
227
kono
parents: 0
diff changeset
228 The multiarch name is used to augment the search path for libraries, crt
kono
parents: 0
diff changeset
229 files and system header files with additional locations. The compiler
kono
parents: 0
diff changeset
230 will add a multiarch subdirectory of the form
kono
parents: 0
diff changeset
231 @var{prefix}/@var{multiarch} before each directory in the library and
kono
parents: 0
diff changeset
232 crt search path. It will also add two directories
kono
parents: 0
diff changeset
233 @code{LOCAL_INCLUDE_DIR}/@var{multiarch} and
kono
parents: 0
diff changeset
234 @code{NATIVE_SYSTEM_HEADER_DIR}/@var{multiarch}) to the system header
kono
parents: 0
diff changeset
235 search path, respectively before @code{LOCAL_INCLUDE_DIR} and
kono
parents: 0
diff changeset
236 @code{NATIVE_SYSTEM_HEADER_DIR}.
kono
parents: 0
diff changeset
237
kono
parents: 0
diff changeset
238 @code{MULTIARCH_DIRNAME} is not used for configurations that support
kono
parents: 0
diff changeset
239 both multilib and multiarch. In that case, multiarch names are encoded
kono
parents: 0
diff changeset
240 in @code{MULTILIB_OSDIRNAMES} instead.
kono
parents: 0
diff changeset
241
kono
parents: 0
diff changeset
242 More documentation about multiarch can be found at
kono
parents: 0
diff changeset
243 @uref{https://wiki.debian.org/Multiarch}.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
244
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
245 @findex SPECS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
246 @item SPECS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
247 Unfortunately, setting @code{MULTILIB_EXTRA_OPTS} is not enough, since
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
248 it does not affect the build of target libraries, at least not the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
249 build of the default multilib. One possible work-around is to use
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
250 @code{DRIVER_SELF_SPECS} to bring options from the @file{specs} file
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
251 as if they had been passed in the compiler driver command line.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
252 However, you don't want to be adding these options after the toolchain
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
253 is installed, so you can instead tweak the @file{specs} file that will
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
254 be used during the toolchain build, while you still install the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
255 original, built-in @file{specs}. The trick is to set @code{SPECS} to
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 some other filename (say @file{specs.install}), that will then be
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
257 created out of the built-in specs, and introduce a @file{Makefile}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
258 rule to generate the @file{specs} file that's going to be used at
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
259 build time out of your @file{specs.install}.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
260
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
261 @item T_CFLAGS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
262 These are extra flags to pass to the C compiler. They are used both
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
263 when building GCC, and when compiling things with the just-built GCC@.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
264 This variable is deprecated and should not be used.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
265 @end table
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
266
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 @node Host Fragment
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268 @section Host Makefile Fragments
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
269 @cindex host makefile fragment
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
270 @cindex @file{x-@var{host}}
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
271
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 The use of @file{x-@var{host}} fragments is discouraged. You should only
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
273 use it for makefile dependencies.