summaryrefslogtreecommitdiff
path: root/config/target.in
blob: 485c58762a4e86093abd24e48e36845f31286df1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# Target definition: architecture, optimisations, etc...

menu "Target options"

config ARCH
    string

source "config.gen/arch.in"

config ARCH_SUFFIX
    string
    prompt "Suffix to the arch-part"
    help
      Some architectures have multiple variants and being able to specify
      the variant instead of the arch is quite convenient. This is commonly
      seen for instance when "armv5tel-" is used as a prefix instead of the
      more generic "arm-", or with "alphaev6-" instead of "alpha-".
      
      Whatever you enter here will be appended to the architecture-part of the
      tuple, just before the first '-'. It will override any architecture-
      specific suffix that crosstool-NG may compute.
      
      If you are not sure about what this is, leave it blank.

#--------------------------------------
comment "Generic target options"

#--------------------------------------
config ARCH_REQUIRES_MULTILIB
    bool
    select MULTILIB

# Multilib requires 1st core pass (i.e., pass without building libgcc)
# to determine which target cflags vary with multilib and which must be
# passed from the arch configuration.
config MULTILIB
    bool
    prompt "Build a multilib toolchain (READ HELP!!!)"
    select CC_CORE_PASS_1_NEEDED
    help
      If you say 'y' here, then the toolchain will also contain the C library
      optimised for some variants of the selected architecture, besides the
      default settings.
      
      This means the build time of the C library will be in O(nb_variants).
      
      The list of variants is dependent on the architecture, and is hard-coded
      in gcc, so it is not possible to say what variants to support, only
      whether hard-coded variants should be supported or not.
      
      NOTE: The multilib feature in crosstool-NG is not well-tested.
            Use at your own risk, and report success and/or failure.

config DEMULTILIB
    bool "Attempt to combine libraries into a single directory"
    default y if !MULTILIB
    depends on !MULTILIB || EXPERIMENTAL
    help
      Normally, Crosstool-NG installs the libraries into the directories
      as the configure for these libraries determines appropriate. For
      example, for AArch64 glibc wants to install the libraries into
      /lib64 but the default dynamic linker path is /lib/ld-linux-aarch64.so.1
      (which is installed as a symlink to ../lib64/ld-VER.so).

      However, not all consumers of the toolchain can handle the libraries
      residing in multiple directories. To appease them, crosstool-NG can
      attempt to combine the libraries back into a single /lib directory and
      create all other directories as symlinks to /lib. This requires all
      the library names to be unique within each sysroot.

      Note that GCC may also use separate sysroots for different multilibs.
      Hence it may make sense to enable this option even for multilib toolchains.
      However, separate roots are rare (any other architecture aside from
      SuperH using them?) and hence not well tested in crosstool-NG; therefore,
      this option is experimental when MULTILIB is enabled.

#--------------------------------------
config ARCH_SUPPORTS_BOTH_MMU
    bool

config ARCH_DEFAULT_HAS_MMU
    bool

config ARCH_USE_MMU
    bool
    prompt "Use the MMU" if ARCH_SUPPORTS_BOTH_MMU
    default y if ARCH_DEFAULT_HAS_MMU
    help
      If your architecture has an MMU and you want to use it,
      say 'Y' here.
      
      OTOH, if you don't want to use the MMU, or your arch
      lacks an MMU, say 'N' here.
      
      Note that some architectures (eg. ARM) has variants that
      lacks an MMU (eg. ARM Cortex-M3), while other variants
      have one (eg. ARM Cortex-A8).

#--------------------------------------
config ARCH_SUPPORTS_BOTH_ENDIAN
    bool

config ARCH_DEFAULT_BE
    bool

config ARCH_DEFAULT_LE
    bool

choice
    bool
    prompt "Endianness:"
    depends on ARCH_SUPPORTS_BOTH_ENDIAN
    default ARCH_BE if ARCH_DEFAULT_BE
    default ARCH_LE if ARCH_DEFAULT_LE

config ARCH_BE
    bool
    prompt "Big endian"

config ARCH_LE
    bool
    prompt "Little endian"

endchoice

config ARCH_ENDIAN
    string
    depends on ARCH_SUPPORTS_BOTH_ENDIAN
    default "big"       if ARCH_BE
    default "little"    if ARCH_LE

#--------------------------------------
config ARCH_SUPPORTS_8
    bool

config ARCH_SUPPORTS_32
    bool

config ARCH_SUPPORTS_64
    bool

config ARCH_DEFAULT_8
    bool

config ARCH_DEFAULT_32
    bool

config ARCH_DEFAULT_64
    bool

config ARCH_BITNESS
    int
    default "8"     if ARCH_8
    default "32"    if ARCH_32
    default "64"    if ARCH_64

choice
    bool
    prompt "Bitness:"
    default ARCH_8  if ARCH_DEFAULT_8
    default ARCH_32 if ARCH_DEFAULT_32
    default ARCH_64 if ARCH_DEFAULT_64

config ARCH_8
    bool
    prompt "8-bit"
    depends on ARCH_SUPPORTS_8

config ARCH_32
    bool
    prompt "32-bit"
    depends on ARCH_SUPPORTS_32

config ARCH_64
    bool
    prompt "64-bit"
    depends on ARCH_SUPPORTS_64

endchoice

#--------------------------------------
comment "Target optimisations"

config ARCH_SUPPORTS_WITH_ARCH
    bool

config ARCH_SUPPORTS_WITH_ABI
    bool

config ARCH_SUPPORTS_WITH_CPU
    bool

config ARCH_SUPPORTS_WITH_TUNE
    bool

config ARCH_SUPPORTS_WITH_FLOAT
    bool

config ARCH_SUPPORTS_WITH_FPU
    bool

config ARCH_SUPPORTS_SOFTFP
    bool

config ARCH_EXCLUSIVE_WITH_CPU
    bool

config ARCH_ARCH
    string
    prompt "Architecture level"
    depends on ARCH_SUPPORTS_WITH_ARCH
    depends on !ARCH_EXCLUSIVE_WITH_CPU || ARCH_CPU = ""
    default ""
    help
      GCC uses this name to determine what kind of instructions it can emit
      when generating assembly code. This option can be used in conjunction
      with or instead of the ARCH_CPU option (above), or a (command-line)
      -mcpu= option.
      
      This is the configuration flag --with-arch=XXXX, and the runtime flag
      -march=XXX.
      
      Pick a value from the gcc manual for your choosen gcc version and your
      target CPU.
      
      Leave blank if you don't know, or if your target architecture does not
      offer this option.

config ARCH_ABI
    string
    prompt "Generate code for the specific ABI"
    depends on ARCH_SUPPORTS_WITH_ABI
    default ""
    help
      Generate code for the given ABI.

      This is the configuration flag --with-abi=XXXX, and the runtime flag
      -mabi=XXX.

      Pick a value from the gcc manual for your choosen gcc version and your
      target CPU.

      Leave blank if you don't know, or if your target architecture does not
      offer this option.

config ARCH_CPU
    string
    prompt "Emit assembly for CPU"
    depends on ARCH_SUPPORTS_WITH_CPU
    default ""
    help
      This specifies the name of the target processor. GCC uses this name
      to determine what kind of instructions it can emit when generating
      assembly code.
      
      This is the configuration flag --with-cpu=XXXX, and the runtime flag
      -mcpu=XXX.

      Pick a value from the gcc manual for your choosen gcc version and your
      target CPU.
      
      Leave blank if you don't know, or if your target architecture does not
      offer this option.

config ARCH_TUNE
    string
    prompt "Tune for CPU"
    depends on ARCH_SUPPORTS_WITH_TUNE
    depends on !ARCH_EXCLUSIVE_WITH_CPU || ARCH_CPU = ""
    default ""
    help
      This option is very similar to the ARCH_CPU option (above), except
      that instead of specifying the actual target processor type, and hence
      restricting which instructions can be used, it specifies that GCC should
      tune the performance of the code as if the target were of the type
      specified in this option, but still choosing the instructions that it
      will generate based on the cpu specified by the ARCH_CPU option
      (above), or a (command-line) -mcpu= option.
      
      This is the configuration flag --with-tune=XXXX, and the runtime flag
      -mtune=XXX.
      
      Pick a value from the gcc manual for your choosen gcc version and your
      target CPU.
      
      Leave blank if you don't know, or if your target architecture does not
      offer this option.

config ARCH_FPU
    string
    prompt "Use specific FPU"
    depends on ARCH_SUPPORTS_WITH_FPU
    default ""
    help
      On some targets (eg. ARM), you can specify the kind of FPU to emit
      code for.

      This is the configuration flag --with-fpu=XXX, and the runtime flag
      -mfpu=XXX.
      
      See below wether to actually emit FP opcodes, or to emulate them.
      
      Pick a value from the gcc manual for your choosen gcc version and your
      target CPU.
      
      Leave blank if you don't know, or if your target architecture does not
      offer this option.

choice
    bool
    prompt "Floating point:"
    depends on ARCH_SUPPORTS_WITH_FLOAT

config ARCH_FLOAT_AUTO
    bool
    prompt "auto (let gcc decide)"
    help
      Instead of explicitly passing a float option, don't
      pass any float options and let gcc figure it out.

      For multilib configurations, this may help.

config ARCH_FLOAT_HW
    bool
    prompt "hardware (FPU)"
    help
      Emit hardware floating point opcodes.
      
      If you've got a processor with a FPU, then you want that.
      If your hardware has no FPU, you still can use HW floating point, but
      need to compile support for FPU emulation in your kernel. Needless to
      say that emulating the FPU is /slooowwwww/...
      
      One situation you'd want HW floating point without a FPU is if you get
      binary blobs from different vendors that are compiling this way and
      can't (don't wan't to) change.

config ARCH_FLOAT_SOFTFP
    bool
    prompt "softfp (FPU)"
    depends on ARCH_SUPPORTS_SOFTFP
    help
      Emit hardware floating point opcodes but use the software
      floating point calling convention.

      Architectures such as ARM use different registers for passing
      floating point values depending on if they're in software mode
      or hardware mode.  softfp emits FPU instructions but uses the
      software FP calling convention allowing softfp code to
      interoperate with legacy software only code.

      If in doubt, use 'software' or 'hardware' mode instead.

config ARCH_FLOAT_SW
    bool
    prompt "software (no FPU)"
    help
      Do not emit any hardware floating point opcode.
      
      If your processor has no FPU, then you most probably want this, as it
      is faster than emulating the FPU in the kernel.

endchoice

config TARGET_CFLAGS
    string
    prompt "Target CFLAGS"
    default ""
    help
      Used to add specific options when compiling libraries of the toolchain,
      that will run on the target (eg. libc.so).
      
      Note that the options above for ARCH, ABI, CPU, TUNE and FPU will be
      automatically used. You don't need to specify them here.
      
      Leave blank if you don't know better.

config TARGET_LDFLAGS
    string
    prompt "Target LDFLAGS"
    default ""
    help
      Used to add specific options when linking libraries of the toolchain,
      that will run on your target.
      
      Leave blank if you don't know better.

config ARCH_FLOAT
    string
    default ""       if ! ARCH_SUPPORTS_WITH_FLOAT
    default "auto"   if ARCH_FLOAT_AUTO
    default "hard"   if ARCH_FLOAT_HW
    default "soft"   if ARCH_FLOAT_SW
    default "softfp" if ARCH_FLOAT_SOFTFP

source "config.gen/arch.in.2"

endmenu