xref: /OK3568_Linux_fs/buildroot/toolchain/Config.in (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1menu "Toolchain"
2
3# Invisible option that makes sure the toolchain package always gets
4# built
5config BR2_TOOLCHAIN
6	bool
7	default y
8
9config BR2_TOOLCHAIN_PREFER_CLANG
10	bool "Prefer to use clang"
11	default n
12	help
13	  Prefer to use clang when available.
14
15# Should be selected for glibc or eglibc
16config BR2_TOOLCHAIN_USES_GLIBC
17	bool
18	select BR2_USE_WCHAR
19	select BR2_ENABLE_LOCALE
20	select BR2_TOOLCHAIN_HAS_FULL_GETTEXT
21	select BR2_TOOLCHAIN_HAS_THREADS
22	select BR2_TOOLCHAIN_HAS_THREADS_DEBUG
23	select BR2_TOOLCHAIN_HAS_THREADS_NPTL
24	select BR2_TOOLCHAIN_HAS_UCONTEXT
25	select BR2_TOOLCHAIN_SUPPORTS_PIE
26
27config BR2_TOOLCHAIN_USES_UCLIBC
28	bool
29	# ucontext is only available for a subset of the supported
30	# architectures
31	select BR2_TOOLCHAIN_HAS_UCONTEXT if BR2_ARM_CPU_HAS_ARM || BR2_i386 \
32		|| BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el \
33		|| BR2_sparc || BR2_x86_64
34	select BR2_TOOLCHAIN_SUPPORTS_PIE if !BR2_m68k && !BR2_microblaze && !BR2_STATIC_LIBS
35
36config BR2_TOOLCHAIN_USES_MUSL
37	bool
38	select BR2_USE_WCHAR
39	select BR2_ENABLE_LOCALE
40	select BR2_TOOLCHAIN_HAS_THREADS
41	select BR2_TOOLCHAIN_HAS_THREADS_DEBUG
42	select BR2_TOOLCHAIN_HAS_THREADS_NPTL
43	select BR2_TOOLCHAIN_HAS_UCONTEXT
44	select BR2_TOOLCHAIN_SUPPORTS_PIE if !BR2_STATIC_LIBS
45
46choice
47	prompt "Toolchain type"
48	help
49	  Select whether to use the toolchain provided by buildroot
50	  or an external toolchain.
51
52	  Some vendors provide toolchains in binary form, some in
53	  source form.
54
55config BR2_TOOLCHAIN_BUILDROOT
56	bool "Buildroot toolchain"
57	depends on BR2_ARCH_HAS_TOOLCHAIN_BUILDROOT
58
59config BR2_TOOLCHAIN_EXTERNAL
60	bool "External toolchain"
61	help
62	  Select if you want to use an existing cross-compiling
63	  toolchain. Buildroot can either download automatically a
64	  toolchain, or use an already installed toolchain.
65
66endchoice
67
68source "toolchain/toolchain-buildroot/Config.in"
69source "toolchain/toolchain-external/Config.in"
70
71# Generic toolchain options
72
73# we want gdb config in the middle of both source and external
74# toolchains, but mconf won't let us source the same file twice,
75# so put it here instead
76source "package/gdb/Config.in.host"
77
78comment "Toolchain Generic Options"
79
80# https://sourceware.org/bugzilla/show_bug.cgi?id=21464
81# Affect toolchains built with binutils 2.31.1, still not fixed.
82config BR2_TOOLCHAIN_HAS_BINUTILS_BUG_21464
83	bool
84	default y if BR2_or1k
85
86# https://sourceware.org/bugzilla/show_bug.cgi?id=27597
87# Affect toolchains built with binutils 2.36.1, still not fixed.
88config BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
89	bool
90	default y if BR2_nios2
91
92# Atomic types can be:
93#  - never lock-free
94#  - sometimes lock-free
95#  - always lock-free
96# see https://en.cppreference.com/w/c/atomic/ATOMIC_LOCK_FREE_consts
97#
98# On most architectures, gcc provides "always lock-free" atomic types,
99# but a few architectures are limited to "sometimes lock-free"
100# types. This hidden option allows to know if the architecture
101# provides "always lock-free" atomic types.
102config BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS
103	bool
104	default y
105	depends on !BR2_nios2
106	depends on !BR2_ARM_CPU_ARMV4
107	depends on !BR2_ARM_CPU_ARMV5
108	depends on !BR2_sparc_v8
109	depends on !BR2_m68k_cf5208
110
111# GCC uses thunk functions to adjust the 'this' pointer when calling
112# C++ member functions in classes derived with multiple inheritance.
113# Generation of thunk functions requires support from the compiler
114# back end. In the absence of that support target-independent code
115# in the C++ front end is used to generate thunk functions, but it
116# does not support vararg functions.
117# or1k will support it in the gcc mainline starting with gcc-9.
118config BR2_TOOLCHAIN_SUPPORTS_VARIADIC_MI_THUNK
119	bool
120	default y
121	depends on !BR2_or1k
122	depends on !BR2_xtensa
123
124# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43744. This bug no
125# reappeared on gcc 9.x and is still not fixed on gcc 11.x
126config BR2_TOOLCHAIN_HAS_GCC_BUG_43744
127	bool
128	default y if BR2_sh4
129	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_8 || \
130		BR2_TOOLCHAIN_GCC_AT_LEAST_9 || \
131		BR2_TOOLCHAIN_GCC_AT_LEAST_10 || \
132		BR2_TOOLCHAIN_GCC_AT_LEAST_11
133
134# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63261. This bug no
135# longer exists in gcc 8.x.
136config BR2_TOOLCHAIN_HAS_GCC_BUG_63261
137	bool
138	default y if BR2_microblaze
139	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_8
140
141# Prior to gcc 7.x, exception_ptr, nested_exception and future from
142# libstdc++ would only be provided on architectures that support
143# always lock-free atomic ints. See
144# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735. This issue has
145# been removed in GCC 7.x, where exception propagation is now
146# supported without lock-free atomic int.
147config BR2_TOOLCHAIN_HAS_GCC_BUG_64735
148	bool
149	default y if !BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS && \
150		!BR2_TOOLCHAIN_GCC_AT_LEAST_7
151
152# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68485. This bug still
153# exists in gcc 9.x
154config BR2_TOOLCHAIN_HAS_GCC_BUG_68485
155	bool
156	default y if BR2_microblaze
157
158# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143
159# Error: invalid operands (*UND* and .text sections) for `-' on sh4.
160# This bug no longer exists in gcc 10.x but reappeared on gcc 11.x and
161# it still not been fixed yet.
162config BR2_TOOLCHAIN_HAS_GCC_BUG_83143
163	bool
164	default y if BR2_sh
165	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_10 || BR2_TOOLCHAIN_GCC_AT_LEAST_11
166
167# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85180. This bug no
168# longer exists in gcc 8.x.
169config BR2_TOOLCHAIN_HAS_GCC_BUG_85180
170	bool
171	default y if BR2_microblaze
172	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_8
173
174# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85862
175# An infinite loop exists in the find_base_term() logic of 6.x
176# on microblaze.  http://autobuild.buildroot.net/results/158e8ebb39713e1b436a5cc1a1916f46c30694df/
177config BR2_TOOLCHAIN_HAS_GCC_BUG_85862
178	bool
179	default y if BR2_microblaze
180	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_7
181
182# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90620
183# ICE: in do_output_reload, at reload1.c:7978 on microblaze.
184# This bug no longer exists in gcc 10.x
185config BR2_TOOLCHAIN_HAS_GCC_BUG_90620
186	bool
187	default y if BR2_microblaze
188	depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_10
189
190# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93847
191# ICE: compiler error: Segmentation fault on Nios II. This bug
192# no longer exists in gcc 9.x.
193config BR2_TOOLCHAIN_HAS_GCC_BUG_93847
194	bool
195	default y if BR2_nios2 && !BR2_TOOLCHAIN_GCC_AT_LEAST_9
196
197# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99410
198# Error: branch offset out of range on Nios II. This bug
199# no longer exists in gcc 8.x but reappeared on gcc 9.x and has been
200# fixed on gcc 10.x.
201config BR2_TOOLCHAIN_HAS_GCC_BUG_99140
202	bool
203	default y if !BR2_TOOLCHAIN_GCC_AT_LEAST_8
204	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_9 && !BR2_TOOLCHAIN_GCC_AT_LEAST_10
205	depends on BR2_nios2
206
207# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101737
208# ICE: SH4 -Os causes internal compiler error. This bug
209# still exists in gcc = 11.1.0
210config BR2_TOOLCHAIN_HAS_GCC_BUG_101737
211	bool
212	default y if BR2_sh4
213
214# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101915
215# ICE: in extract_insn, at recog.c:2294 on microblaze.
216# This bug still exists in gcc = 11.1.0
217config BR2_TOOLCHAIN_HAS_GCC_BUG_101915
218	bool
219	default y if BR2_microblaze
220
221# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101916
222# ICE: on SH4: Segmentation fault signal terminated program cc1.
223# This bug still exists in gcc = 11.1.0
224config BR2_TOOLCHAIN_HAS_GCC_BUG_101916
225	bool
226	default y if BR2_sh4
227
228# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101952
229# ICE: on SH4: unaligned opcodes detected in executable segment.
230# This bug still exists in gcc = 11.1.0
231config BR2_TOOLCHAIN_HAS_GCC_BUG_101952
232	bool
233	default y if BR2_sh4
234
235config BR2_TOOLCHAIN_HAS_NATIVE_RPC
236	bool
237
238config BR2_USE_WCHAR
239	bool
240
241config BR2_ENABLE_LOCALE
242	bool
243
244config BR2_INSTALL_LIBSTDCPP
245	bool
246
247config BR2_TOOLCHAIN_HAS_DLANG
248	bool
249
250config BR2_TOOLCHAIN_HAS_FORTRAN
251	bool
252
253config BR2_TOOLCHAIN_HAS_THREADS
254	bool
255
256config BR2_TOOLCHAIN_HAS_THREADS_DEBUG
257	bool
258
259config BR2_TOOLCHAIN_HAS_THREADS_NPTL
260	bool
261
262config BR2_TOOLCHAIN_HAS_SSP
263	bool
264
265config BR2_TOOLCHAIN_HAS_SSP_STRONG
266	bool
267	default y if BR2_TOOLCHAIN_HAS_SSP && BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
268
269config BR2_TOOLCHAIN_HAS_UCONTEXT
270	bool
271
272config BR2_TOOLCHAIN_HAS_OPENMP
273	bool
274
275config BR2_TOOLCHAIN_SUPPORTS_PIE
276	bool
277
278config BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY
279	bool "Copy gconv libraries"
280	depends on BR2_TOOLCHAIN_USES_GLIBC
281	help
282	  The gconv libraries are used to convert between different
283	  character sets (charsets).
284
285	  Say 'y' if you need to store and/or display different
286	  charsets.
287
288config BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_LIST
289	string "Gconv libraries to copy"
290	depends on BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY
291	help
292	  Set to the list of gconv libraries to copy.
293	  Leave empty to copy all gconv libraries.
294
295	  Specify only the basename of the libraries, leave
296	  out the .so extension. Eg.:
297	    IBM850 ISO8859-15 UNICODE
298
299	  Note: the full set of gconv libs are ~8MiB (on ARM).
300
301config BR2_TOOLCHAIN_EXTRA_LIBS
302	string "Extra toolchain libraries to be copied to target"
303	default BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS if BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS != "" # legacy
304	depends on !BR2_STATIC_LIBS
305	help
306	  If your toolchain provides extra libraries that need to be
307	  copied to the target filesystem, enter them here, separated
308	  by spaces. The library should not include a suffix or any
309	  type of pre/post wildcard.
310
311	  Examples where this can be useful is for adding debug
312	  libraries to the target like the GCC libsanitizer.
313	  e.g. "libasan liblsan libtsan libubsan"
314
315# This boolean is true if the toolchain provides a built-in full
316# featured gettext implementation (glibc), and false if only a stub
317# gettext implementation is provided (uclibc, musl)
318config BR2_TOOLCHAIN_HAS_FULL_GETTEXT
319	bool
320
321config BR2_USE_MMU
322	bool "Enable MMU support" if BR2_ARCH_HAS_MMU_OPTIONAL
323	default y if BR2_ARCH_HAS_MMU_OPTIONAL || BR2_ARCH_HAS_MMU_MANDATORY
324	help
325	  If your target has a MMU, you should say Y here.  If you
326	  are unsure, just say Y.
327
328config BR2_TARGET_OPTIMIZATION
329	string "Target Optimizations"
330	default ""
331	help
332	  Optimizations to use when building for the target host.
333	  NOTE: gcc optimization level is defined in build options.
334
335config BR2_TARGET_LDFLAGS
336	string "Target linker options"
337	help
338	  Extra options to pass to the linker when building for the
339	  target.
340
341	  Note that options with a '$' sign (eg.
342	  -Wl,-rpath='$ORIGIN/../lib') are not supported.
343
344config BR2_ECLIPSE_REGISTER
345	bool "Register toolchain within Eclipse Buildroot plug-in"
346	help
347	  This options tells Buildroot to generate the necessary
348	  configuration files to make your toolchain appear within
349	  Eclipse, through the Eclipse Buildroot plugin.
350
351# Options for packages to depend on, if they require at least a
352# specific version of the kernel headers.
353# Toolchains should choose the adequate option (ie. the highest
354# version, not all of them).
355config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
356	bool
357
358config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
359	bool
360	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
361
362config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
363	bool
364	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
365
366config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
367	bool
368	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
369
370config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4
371	bool
372	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
373
374config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
375	bool
376	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4
377
378config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6
379	bool
380	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
381
382config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
383	bool
384	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6
385
386config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
387	bool
388	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
389
390config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
391	bool
392	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
393
394config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
395	bool
396	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
397
398config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
399	bool
400	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
401
402config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
403	bool
404	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
405
406config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
407	bool
408	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
409
410config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14
411	bool
412	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
413
414config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15
415	bool
416	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14
417
418config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16
419	bool
420	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15
421
422config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17
423	bool
424	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16
425
426config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_18
427	bool
428	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17
429
430config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_19
431	bool
432	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_18
433
434config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0
435	bool
436	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_19
437
438config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_1
439	bool
440	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0
441
442config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_2
443	bool
444	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_1
445
446config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_3
447	bool
448	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_2
449
450config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4
451	bool
452	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_3
453
454config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5
455	bool
456	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4
457
458config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_6
459	bool
460	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5
461
462config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
463	bool
464	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_6
465
466config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8
467	bool
468	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
469
470config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_9
471	bool
472	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8
473
474config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_10
475	bool
476	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_9
477
478config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11
479	bool
480	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_10
481
482config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_12
483	bool
484	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11
485
486config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_13
487	bool
488	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_12
489
490config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14
491	bool
492	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_13
493
494config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
495	bool
496	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14
497
498config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_16
499	bool
500	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
501
502config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_17
503	bool
504	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_16
505
506config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18
507	bool
508	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_17
509
510config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
511	bool
512	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18
513
514config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
515	bool
516	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
517
518config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_0
519	bool
520	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
521
522config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1
523	bool
524	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_0
525
526config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_2
527	bool
528	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1
529
530config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_3
531	bool
532	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_2
533
534config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4
535	bool
536	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_3
537
538config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_5
539	bool
540	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4
541
542config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_6
543	bool
544	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_5
545
546config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_7
547	bool
548	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_6
549
550config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_8
551	bool
552	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_7
553
554config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_9
555	bool
556	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_8
557
558config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10
559	bool
560	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_9
561
562config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_11
563	bool
564	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10
565
566config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_12
567	bool
568	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_11
569
570config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_13
571	bool
572	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_12
573
574config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_14
575	bool
576	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_13
577
578config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_15
579	bool
580	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_14
581
582config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_16
583	bool
584	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_15
585
586config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_17
587	bool
588	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_16
589
590config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_18
591	bool
592	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_17
593
594config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_19
595	bool
596	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_18
597
598config BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_0
599	bool
600	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_19
601
602config BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_1
603	bool
604	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_0
605	select BR2_TOOLCHAIN_HEADERS_LATEST
606
607# This should be selected by the latest version, above, to indicate that
608# Buildroot does not know of more recent headers than the ones selected.
609# This allows using toolchains with headers more recent than Buildroot
610# knows about, while still enforcing strict check for older headers.
611config BR2_TOOLCHAIN_HEADERS_LATEST
612	bool
613
614# This order guarantees that the highest version is set, as kconfig
615# stops affecting a value on the first matching default.
616config BR2_TOOLCHAIN_HEADERS_AT_LEAST
617	string
618	default "6.1"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_1
619	default "6.0"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_6_0
620	default "5.19" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_19
621	default "5.18" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_18
622	default "5.17" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_17
623	default "5.16" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_16
624	default "5.15" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_15
625	default "5.14" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_14
626	default "5.13" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_13
627	default "5.12" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_12
628	default "5.11" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_11
629	default "5.10" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10
630	default "5.9"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_9
631	default "5.8"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_8
632	default "5.7"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_7
633	default "5.6"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_6
634	default "5.5"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_5
635	default "5.4"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4
636	default "5.3"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_3
637	default "5.2"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_2
638	default "5.1"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1
639	default "5.0"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_0
640	default "4.20" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
641	default "4.19" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
642	default "4.18" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18
643	default "4.17" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_17
644	default "4.16" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_16
645	default "4.15" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
646	default "4.14" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14
647	default "4.13" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_13
648	default "4.12" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_12
649	default "4.11" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_11
650	default "4.10" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_10
651	default "4.9"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_9
652	default "4.8"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8
653	default "4.7"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
654	default "4.6"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_6
655	default "4.5"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5
656	default "4.4"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4
657	default "4.3"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_3
658	default "4.2"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_2
659	default "4.1"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_1
660	default "4.0"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0
661	default "3.19" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_19
662	default "3.18" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_18
663	default "3.17" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17
664	default "3.16" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16
665	default "3.15" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15
666	default "3.14" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14
667	default "3.13" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
668	default "3.12" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
669	default "3.11" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
670	default "3.10" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
671	default "3.9"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
672	default "3.8"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
673	default "3.7"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
674	default "3.6"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6
675	default "3.5"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
676	default "3.4"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4
677	default "3.3"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
678	default "3.2"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
679	default "3.1"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
680	default "3.0"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
681	default "2.6"
682
683config BR2_TOOLCHAIN_GCC_AT_LEAST_4_3
684	bool
685
686config BR2_TOOLCHAIN_GCC_AT_LEAST_4_4
687	bool
688	select BR2_TOOLCHAIN_GCC_AT_LEAST_4_3
689
690config BR2_TOOLCHAIN_GCC_AT_LEAST_4_5
691	bool
692	select BR2_TOOLCHAIN_GCC_AT_LEAST_4_4
693
694config BR2_TOOLCHAIN_GCC_AT_LEAST_4_6
695	bool
696	select BR2_TOOLCHAIN_GCC_AT_LEAST_4_5
697
698config BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
699	bool
700	select BR2_TOOLCHAIN_GCC_AT_LEAST_4_6
701
702config BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
703	bool
704	select BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
705
706config BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
707	bool
708	select BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
709
710config BR2_TOOLCHAIN_GCC_AT_LEAST_5
711	bool
712	select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
713
714config BR2_TOOLCHAIN_GCC_AT_LEAST_6
715	bool
716	select BR2_TOOLCHAIN_GCC_AT_LEAST_5
717
718config BR2_TOOLCHAIN_GCC_AT_LEAST_7
719	bool
720	select BR2_TOOLCHAIN_GCC_AT_LEAST_6
721
722config BR2_TOOLCHAIN_GCC_AT_LEAST_8
723	bool
724	select BR2_TOOLCHAIN_GCC_AT_LEAST_7
725
726config BR2_TOOLCHAIN_GCC_AT_LEAST_9
727	bool
728	select BR2_TOOLCHAIN_GCC_AT_LEAST_8
729
730config BR2_TOOLCHAIN_GCC_AT_LEAST_10
731	bool
732	select BR2_TOOLCHAIN_GCC_AT_LEAST_9
733
734config BR2_TOOLCHAIN_GCC_AT_LEAST_11
735	bool
736	select BR2_TOOLCHAIN_GCC_AT_LEAST_10
737
738config BR2_TOOLCHAIN_GCC_AT_LEAST_12
739	bool
740	select BR2_TOOLCHAIN_GCC_AT_LEAST_11
741
742# This order guarantees that the highest version is set, as kconfig
743# stops affecting a value on the first matching default.
744config BR2_TOOLCHAIN_GCC_AT_LEAST
745	string
746	default "12"	if BR2_TOOLCHAIN_GCC_AT_LEAST_12
747	default "11"	if BR2_TOOLCHAIN_GCC_AT_LEAST_11
748	default "10"	if BR2_TOOLCHAIN_GCC_AT_LEAST_10
749	default "9"	if BR2_TOOLCHAIN_GCC_AT_LEAST_9
750	default "8"	if BR2_TOOLCHAIN_GCC_AT_LEAST_8
751	default "7"	if BR2_TOOLCHAIN_GCC_AT_LEAST_7
752	default "6"	if BR2_TOOLCHAIN_GCC_AT_LEAST_6
753	default "5"	if BR2_TOOLCHAIN_GCC_AT_LEAST_5
754	default "4.9"	if BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
755	default "4.8"	if BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
756	default "4.7"	if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
757	default "4.6"	if BR2_TOOLCHAIN_GCC_AT_LEAST_4_6
758	default "4.5"	if BR2_TOOLCHAIN_GCC_AT_LEAST_4_5
759	default "4.4"	if BR2_TOOLCHAIN_GCC_AT_LEAST_4_4
760	default "4.3"	if BR2_TOOLCHAIN_GCC_AT_LEAST_4_3
761
762config BR2_TOOLCHAIN_HAS_MNAN_OPTION
763	bool
764	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
765
766config BR2_TOOLCHAIN_HAS_SYNC_1
767	bool
768	default y
769	depends on !BR2_m68k_cf
770	depends on !BR2_microblaze
771	depends on !BR2_sparc
772	depends on !(BR2_arc && !BR2_ARC_ATOMIC_EXT)
773
774config BR2_TOOLCHAIN_HAS_SYNC_2
775	bool
776	default y if BR2_TOOLCHAIN_HAS_SYNC_1
777
778config BR2_TOOLCHAIN_HAS_SYNC_4
779	bool
780	default y
781	depends on !BR2_m68k_cf
782	depends on !BR2_sparc
783	depends on !(BR2_arc && !BR2_ARC_ATOMIC_EXT)
784
785# The availability of __sync for 8-byte types on ARM is somewhat
786# complicated:
787#
788#  - It appeared in gcc starting with gcc 4.7.
789#
790#  - On ARMv7, there is no problem, it can be directly implemented in
791#    userspace.
792#
793#  - On < ARMv7, it requires help from the kernel. Unfortunately, the
794#    libgcc code implementing 8-byte __sync with the help from the
795#    kernel calls __write() when a failure occurs, which is a function
796#    internal to glibc, not available in uClibc and musl. This means
797#    that the 8-byte __sync operations are not available on < ARMv7
798#    with uClibc and musl. This problem was fixed as part of gcc
799#    PR68059, which was backported to the gcc 5 branch, but isn't yet
800#    part of any gcc 5.x release.
801#
802config BR2_TOOLCHAIN_ARM_HAS_SYNC_8
803	bool
804	default y
805	depends on BR2_arm || BR2_armeb
806	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
807	depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_ARM_CPU_ARMV7A
808
809# 8-byte intrinsics available on most x86 CPUs, except a few old ones
810config BR2_TOOLCHAIN_X86_HAS_SYNC_8
811	bool
812	default y
813	depends on BR2_i386
814	depends on !BR2_x86_i486
815	depends on !BR2_x86_c3
816	depends on !BR2_x86_winchip_c6
817	depends on !BR2_x86_winchip2
818
819# 8-byte intrinsics available:
820#  - On all 64 bits architecture
821#  - On a certain combinations of ARM platforms
822#  - On certain x86 32 bits CPUs
823config BR2_TOOLCHAIN_HAS_SYNC_8
824	bool
825	default y if BR2_ARCH_IS_64
826	default y if BR2_TOOLCHAIN_ARM_HAS_SYNC_8
827	default y if BR2_TOOLCHAIN_X86_HAS_SYNC_8
828
829# libatomic is available since gcc 4.8, when thread support is
830# enabled. Also, libatomic doesn't recognize "uclinux" as a valid OS
831# part of the tuple, and is therefore not build on uclinux targets,
832# which is why BR2_BINFMT_FLAT configurations are excluded.
833config BR2_TOOLCHAIN_HAS_LIBATOMIC
834	bool
835	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 && \
836		!BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64 && \
837		BR2_TOOLCHAIN_HAS_THREADS && \
838		!BR2_BINFMT_FLAT
839
840# __atomic intrinsics are available:
841# - with gcc 4.8, either through built-ins or libatomic, on all
842#   architectures. Since we don't want to separate the cases where
843#   libatomic is needed vs. not needed, we simplify thing and only
844#   support situations where libatomic is available, even if on some
845#   architectures libatomic is not strictly needed as all __atomic
846#   intrinsics might be built-in. The only case where libatomic is
847#   missing entirely is when the toolchain does not have support for
848#   threads. However, a package that does not need threads but still
849#   uses atomics is quite a corner case, which does not warrant the
850#   added complexity.
851# - with gcc 4.7, libatomic did not exist, so only built-ins are
852#   available. This means that __atomic can only be used in a subset
853#   of the architectures
854config BR2_TOOLCHAIN_HAS_ATOMIC
855	bool
856	default y if BR2_TOOLCHAIN_HAS_LIBATOMIC
857	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_arm
858	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_armeb
859	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_xtensa
860	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_ARCH_IS_64
861
862# - libquadmath is not needed/available on all architectures (but gcc
863#   correctly handles this already).
864# - At least, libquadmath is available on:
865#   - i*86
866#   - x86_64
867# - When available, libquadmath requires wchar support.
868config BR2_TOOLCHAIN_HAS_LIBQUADMATH
869	bool
870	default y if BR2_i386 || BR2_x86_64
871
872endmenu
873