]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - toolchain/toolchain-common.in
linux/linux.mk: use namespace for internal variables
[coffee/buildroot.git] / toolchain / toolchain-common.in
1 # Generic toolchain options
2
3 # we want gdb config in the middle of both source and external
4 # toolchains, but mconf won't let us source the same file twice,
5 # so put it here instead
6 source "package/gdb/Config.in.host"
7
8 comment "Toolchain Generic Options"
9
10 # https://sourceware.org/bugzilla/show_bug.cgi?id=19615
11 # Affect toolchains built with binutils 2.26 (fixed in binutils 2.26.1).
12 config BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19615
13         bool
14
15 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735
16 # exception_ptr, nested_exception, and future from libstdc++ are not
17 # available for architectures not supporting always lock-free atomic
18 # ints before GCC 7
19 config BR2_TOOLCHAIN_HAS_GCC_BUG_64735
20         bool
21         default y if BR2_nios2
22         default y if BR2_ARM_CPU_ARMV4
23         default y if BR2_ARM_CPU_ARMV5
24         default y if BR2_sparc_v8
25         default y if BR2_m68k_cf5208
26         depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_7
27
28 config BR2_TOOLCHAIN_HAS_NATIVE_RPC
29         bool
30
31 config BR2_USE_WCHAR
32         bool
33
34 config BR2_ENABLE_LOCALE
35         bool
36
37 config BR2_INSTALL_LIBSTDCPP
38         bool
39
40 config BR2_TOOLCHAIN_HAS_FORTRAN
41         bool
42
43 config BR2_TOOLCHAIN_HAS_THREADS
44         bool
45
46 config BR2_TOOLCHAIN_HAS_THREADS_DEBUG
47         bool
48
49 config BR2_TOOLCHAIN_HAS_THREADS_NPTL
50         bool
51
52 config BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS
53         bool
54
55 config BR2_TOOLCHAIN_HAS_SSP
56         bool
57
58 config BR2_TOOLCHAIN_SUPPORTS_PIE
59         bool
60
61 config BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY
62         bool "Copy gconv libraries"
63         depends on BR2_TOOLCHAIN_USES_GLIBC
64         help
65           The gconv libraries are used to convert between different
66           character sets (charsets).
67
68           Say 'y' if you need to store and/or display different charsets.
69
70 config BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_LIST
71         string "Gconv libraries to copy"
72         depends on BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY
73         help
74           Set to the list of gconv libraries to copy.
75           Leave empty to copy all gconv libraries.
76
77           Specify only the basename of the libraries, leave
78           out the .so extension. Eg.:
79             IBM850 ISO8859-15 UNICODE
80
81           Note: the full set of gconv libs are ~8MiB (on ARM).
82
83 # This boolean is true if the toolchain provides a built-in full
84 # featured gettext implementation (glibc), and false if only a stub
85 # gettext implementation is provided (uclibc, musl)
86 config BR2_TOOLCHAIN_HAS_FULL_GETTEXT
87         bool
88
89 config BR2_USE_MMU
90         bool "Enable MMU support" if BR2_ARCH_HAS_MMU_OPTIONAL
91         default y if BR2_ARCH_HAS_MMU_OPTIONAL || BR2_ARCH_HAS_MMU_MANDATORY
92         help
93           If your target has a MMU, you should say Y here.  If you
94           are unsure, just say Y.
95
96 config BR2_TARGET_OPTIMIZATION
97         string "Target Optimizations"
98         default ""
99         help
100           Optimizations to use when building for the target host.
101           NOTE: gcc optimization level is defined in build options.
102
103 config BR2_TARGET_LDFLAGS
104         string "Target linker options"
105         help
106           Extra options to pass to the linker when building for the target.
107
108           Note that options with a '$' sign (eg. -Wl,-rpath='$ORIGIN/../lib')
109           are not supported.
110
111 config BR2_ECLIPSE_REGISTER
112         bool "Register toolchain within Eclipse Buildroot plug-in"
113         help
114           This options tells Buildroot to generate the necessary
115           configuration files to make your toolchain appear within
116           Eclipse, through the Eclipse Buildroot plugin.
117
118 # Options for packages to depend on, if they require at least a
119 # specific version of the kernel headers.
120 # Toolchains should choose the adequate option (ie. the highest
121 # version, not all of them).
122 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
123         bool
124
125 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
126         bool
127         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
128
129 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
130         bool
131         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
132
133 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
134         bool
135         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
136
137 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4
138         bool
139         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
140
141 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
142         bool
143         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4
144
145 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6
146         bool
147         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
148
149 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
150         bool
151         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6
152
153 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
154         bool
155         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
156
157 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
158         bool
159         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
160
161 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
162         bool
163         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
164
165 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
166         bool
167         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
168
169 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
170         bool
171         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
172
173 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
174         bool
175         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
176
177 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14
178         bool
179         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
180
181 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15
182         bool
183         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14
184
185 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16
186         bool
187         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15
188
189 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17
190         bool
191         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16
192
193 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_18
194         bool
195         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17
196
197 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_19
198         bool
199         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_18
200
201 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0
202         bool
203         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_19
204
205 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_1
206         bool
207         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0
208
209 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_2
210         bool
211         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_1
212
213 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_3
214         bool
215         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_2
216
217 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4
218         bool
219         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_3
220
221 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5
222         bool
223         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4
224
225 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_6
226         bool
227         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5
228
229 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
230         bool
231         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_6
232
233 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8
234         bool
235         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
236
237 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_9
238         bool
239         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8
240
241 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_10
242         bool
243         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_9
244
245 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11
246         bool
247         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_10
248
249 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_12
250         bool
251         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11
252
253 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_13
254         bool
255         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_12
256
257 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14
258         bool
259         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_13
260
261 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
262         bool
263         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14
264
265 # This order guarantees that the highest version is set, as kconfig
266 # stops affecting a value on the first matching default.
267 config BR2_TOOLCHAIN_HEADERS_AT_LEAST
268         string
269         default "4.15" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
270         default "4.14" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14
271         default "4.13" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_13
272         default "4.12" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_12
273         default "4.11" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11
274         default "4.10" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_10
275         default "4.9"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_9
276         default "4.8"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8
277         default "4.7"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
278         default "4.6"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_6
279         default "4.5"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5
280         default "4.4"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4
281         default "4.3"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_3
282         default "4.2"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_2
283         default "4.1"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_1
284         default "4.0"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0
285         default "3.19" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_19
286         default "3.18" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_18
287         default "3.17" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17
288         default "3.16" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16
289         default "3.15" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15
290         default "3.14" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14
291         default "3.13" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
292         default "3.12" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
293         default "3.11" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
294         default "3.10" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
295         default "3.9"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
296         default "3.8"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
297         default "3.7"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
298         default "3.6"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6
299         default "3.5"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
300         default "3.4"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4
301         default "3.3"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
302         default "3.2"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
303         default "3.1"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
304         default "3.0"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
305         default "2.6"
306
307 config BR2_TOOLCHAIN_GCC_AT_LEAST_4_3
308         bool
309
310 config BR2_TOOLCHAIN_GCC_AT_LEAST_4_4
311         bool
312         select BR2_TOOLCHAIN_GCC_AT_LEAST_4_3
313
314 config BR2_TOOLCHAIN_GCC_AT_LEAST_4_5
315         bool
316         select BR2_TOOLCHAIN_GCC_AT_LEAST_4_4
317
318 config BR2_TOOLCHAIN_GCC_AT_LEAST_4_6
319         bool
320         select BR2_TOOLCHAIN_GCC_AT_LEAST_4_5
321
322 config BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
323         bool
324         select BR2_TOOLCHAIN_GCC_AT_LEAST_4_6
325
326 config BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
327         bool
328         select BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
329
330 config BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
331         bool
332         select BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
333
334 config BR2_TOOLCHAIN_GCC_AT_LEAST_5
335         bool
336         select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
337
338 config BR2_TOOLCHAIN_GCC_AT_LEAST_6
339         bool
340         select BR2_TOOLCHAIN_GCC_AT_LEAST_5
341
342 config BR2_TOOLCHAIN_GCC_AT_LEAST_7
343         bool
344         select BR2_TOOLCHAIN_GCC_AT_LEAST_6
345
346 # This order guarantees that the highest version is set, as kconfig
347 # stops affecting a value on the first matching default.
348 config BR2_TOOLCHAIN_GCC_AT_LEAST
349         string
350         default "7"     if BR2_TOOLCHAIN_GCC_AT_LEAST_7
351         default "6"     if BR2_TOOLCHAIN_GCC_AT_LEAST_6
352         default "5"     if BR2_TOOLCHAIN_GCC_AT_LEAST_5
353         default "4.9"   if BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
354         default "4.8"   if BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
355         default "4.7"   if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
356         default "4.6"   if BR2_TOOLCHAIN_GCC_AT_LEAST_4_6
357         default "4.5"   if BR2_TOOLCHAIN_GCC_AT_LEAST_4_5
358         default "4.4"   if BR2_TOOLCHAIN_GCC_AT_LEAST_4_4
359         default "4.3"   if BR2_TOOLCHAIN_GCC_AT_LEAST_4_3
360
361 config BR2_TOOLCHAIN_HAS_MNAN_OPTION
362         bool
363         default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
364
365 config BR2_TOOLCHAIN_HAS_SYNC_1
366         bool
367         default y
368         depends on !BR2_bfin
369         depends on !BR2_m68k_cf
370         depends on !BR2_microblaze
371         depends on !BR2_sparc
372         depends on !(BR2_arc && !BR2_ARC_ATOMIC_EXT)
373
374 config BR2_TOOLCHAIN_HAS_SYNC_2
375         bool
376         default y if BR2_TOOLCHAIN_HAS_SYNC_1
377
378 config BR2_TOOLCHAIN_HAS_SYNC_4
379         bool
380         default y
381         depends on !BR2_m68k_cf
382         depends on !BR2_sparc
383         depends on !(BR2_arc && !BR2_ARC_ATOMIC_EXT)
384
385 # The availability of __sync for 8-byte types on ARM is somewhat
386 # complicated:
387 #
388 #  - It appeared in gcc starting with gcc 4.7.
389 #
390 #  - On ARMv7, there is no problem, it can be directly implemented in
391 #    userspace.
392 #
393 #  - On < ARMv7, it requires help from the kernel. Unfortunately, the
394 #    libgcc code implementing 8-byte __sync with the help from the
395 #    kernel calls __write() when a failure occurs, which is a function
396 #    internal to glibc, not available in uClibc and musl. This means
397 #    that the 8-byte __sync operations are not available on < ARMv7
398 #    with uClibc and musl. This problem was fixed as part of gcc
399 #    PR68059, which was backported to the gcc 5 branch, but isn't yet
400 #    part of any gcc 5.x release.
401 #
402 config BR2_TOOLCHAIN_ARM_HAS_SYNC_8
403         bool
404         default y
405         depends on BR2_arm || BR2_armeb
406         depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
407         depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_ARM_CPU_ARMV7A
408
409 # 8-byte intrinsics available on most x86 CPUs, except a few old ones
410 config BR2_TOOLCHAIN_X86_HAS_SYNC_8
411         bool
412         default y
413         depends on BR2_i386
414         depends on !BR2_x86_i486
415         depends on !BR2_x86_c3
416         depends on !BR2_x86_winchip_c6
417         depends on !BR2_x86_winchip2
418
419 # 8-byte intrinsics available:
420 #  - On all 64 bits architecture
421 #  - On a certain combinations of ARM platforms
422 #  - On certain x86 32 bits CPUs
423 config BR2_TOOLCHAIN_HAS_SYNC_8
424         bool
425         default y if BR2_ARCH_IS_64
426         default y if BR2_TOOLCHAIN_ARM_HAS_SYNC_8
427         default y if BR2_TOOLCHAIN_X86_HAS_SYNC_8
428
429 # libatomic is available since gcc 4.8, when thread support is
430 # enabled. Also, libatomic doesn't recognize "uclinux" as a valid OS
431 # part of the tuple, and is therefore not build on uclinux targets,
432 # which is why BR2_BINFMT_FLAT configurations are excluded.
433 config BR2_TOOLCHAIN_HAS_LIBATOMIC
434         bool
435         default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 && \
436                 BR2_TOOLCHAIN_HAS_THREADS && \
437                 !BR2_BINFMT_FLAT
438
439 # __atomic intrinsics are available:
440 # - with gcc 4.8, either through built-ins or libatomic, on all
441 #   architectures. Since we don't want to separate the cases where
442 #   libatomic is needed vs. not needed, we simplify thing and only
443 #   support situations where libatomic is available, even if on some
444 #   architectures libatomic is not strictly needed as all __atomic
445 #   intrinsics might be built-in. The only case where libatomic is
446 #   missing entirely is when the toolchain does not have support for
447 #   threads. However, a package that does not need threads but still
448 #   uses atomics is quite a corner case, which does not warrant the
449 #   added complexity.
450 # - with gcc 4.7, libatomic did not exist, so only built-ins are
451 #   available. This means that __atomic can only be used in a subset
452 #   of the architectures
453 config BR2_TOOLCHAIN_HAS_ATOMIC
454         bool
455         default y if BR2_TOOLCHAIN_HAS_LIBATOMIC
456         default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_arm
457         default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_armeb
458         default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_xtensa
459         default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_ARCH_IS_64
460
461 # - libquadmath is not needed/available on all architectures (but gcc
462 #   correctly handles this already).
463 # - At least, libquadmath is available on:
464 #   - i*86
465 #   - x86_64
466 # - When available, libquadmath requires wchar support.
467 config BR2_TOOLCHAIN_HAS_LIBQUADMATH
468         bool
469         default y if BR2_i386 || BR2_x86_64