core: move rule to create basic directories
[buildroot-gz.git] / toolchain / toolchain-common.in
blob03fa880e21c9410498c3f6cfffb2f0cfc0e4bf3c
1 # Generic toolchain options
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"
8 # https://sourceware.org/bugzilla/show_bug.cgi?id=19405
9 config BR2_TOOLCHAIN_HAS_BINUTILS_BUG_19405
10         bool
12 config BR2_TOOLCHAIN_HAS_NATIVE_RPC
13         bool
15 config BR2_USE_WCHAR
16         bool
18 config BR2_ENABLE_LOCALE
19         bool
21 config BR2_INSTALL_LIBSTDCPP
22         bool
24 config BR2_TOOLCHAIN_HAS_FORTRAN
25         bool
27 config BR2_TOOLCHAIN_HAS_THREADS
28         bool
30 config BR2_TOOLCHAIN_HAS_THREADS_DEBUG
31         bool
33 config BR2_TOOLCHAIN_HAS_THREADS_NPTL
34         bool
36 config BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS
37         bool
39 config BR2_TOOLCHAIN_HAS_SSP
40         bool
42 config BR2_TOOLCHAIN_SUPPORTS_PIE
43         bool
45 config BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY
46         bool "Copy gconv libraries"
47         depends on BR2_TOOLCHAIN_USES_GLIBC
48         help
49           The gconv libraries are used to convert between different
50           character sets (charsets).
52           Say 'y' if you need to store and/or display different charsets.
54 config BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_LIST
55         string "Gconv libraries to copy"
56         depends on BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY
57         help
58           Set to the list of gconv libraries to copy.
59           Leave empty to copy all gconv libraries.
61           Specify only the basename of the libraries, leave
62           out the .so extension. Eg.:
63             IBM850 ISO8859-15 UNICODE
65           Note: the full set of gconv libs are ~8MiB (on ARM).
67 # glibc and eglibc directly include gettext, so a separatly compiled
68 # gettext isn't needed and shouldn't be built to avoid conflicts. Some
69 # packages always need gettext, other packages only need gettext when
70 # locale support is enabled. See the documentation for how packages
71 # should rely on the following two options.
73 config BR2_NEEDS_GETTEXT
74         bool
75         default y if BR2_TOOLCHAIN_USES_UCLIBC
77 config BR2_NEEDS_GETTEXT_IF_LOCALE
78         bool
79         default y if (BR2_NEEDS_GETTEXT && BR2_ENABLE_LOCALE)
81 config BR2_USE_MMU
82         bool "Enable MMU support" if BR2_ARCH_HAS_MMU_OPTIONAL
83         default y if BR2_ARCH_HAS_MMU_OPTIONAL || BR2_ARCH_HAS_MMU_MANDATORY
84         help
85           If your target has a MMU, you should say Y here.  If you
86           are unsure, just say Y.
88 config BR2_TARGET_OPTIMIZATION
89         string "Target Optimizations"
90         default ""
91         help
92           Optimizations to use when building for the target host.
93           NOTE: gcc optimization level is defined in build options.
95 config BR2_TARGET_LDFLAGS
96         string "Target linker options"
97         help
98           Extra options to pass to the linker when building for the target.
100           Note that options with a '$' sign (eg. -Wl,-rpath='$ORIGIN/../lib')
101           are not supported.
103 config BR2_ECLIPSE_REGISTER
104         bool "Register toolchain within Eclipse Buildroot plug-in"
105         help
106           This options tells Buildroot to generate the necessary
107           configuration files to make your toolchain appear within
108           Eclipse, through the Eclipse Buildroot plugin.
110 # Options for packages to depend on, if they require at least a
111 # specific version of the kernel headers.
112 # Toolchains should choose the adequate option (ie. the highest
113 # version, not all of them).
114 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
115         bool
117 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
118         bool
119         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
121 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
122         bool
123         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
125 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
126         bool
127         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
129 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4
130         bool
131         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
133 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
134         bool
135         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4
137 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6
138         bool
139         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
141 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
142         bool
143         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6
145 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
146         bool
147         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
149 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
150         bool
151         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
153 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
154         bool
155         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
157 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
158         bool
159         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
161 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
162         bool
163         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
165 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
166         bool
167         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
169 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14
170         bool
171         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
173 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15
174         bool
175         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14
177 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16
178         bool
179         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15
181 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17
182         bool
183         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16
185 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_18
186         bool
187         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17
189 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_19
190         bool
191         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_18
193 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0
194         bool
195         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_19
197 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_1
198         bool
199         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0
201 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_2
202         bool
203         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_1
205 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_3
206         bool
207         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_2
209 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4
210         bool
211         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_3
213 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5
214         bool
215         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4
217 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_6
218         bool
219         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5
221 config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
222         bool
223         select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_6
225 # This order guarantees that the highest version is set, as kconfig
226 # stops affecting a value on the first matching default.
227 config BR2_TOOLCHAIN_HEADERS_AT_LEAST
228         string
229         default "4.7"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
230         default "4.6"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_6
231         default "4.5"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5
232         default "4.4"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4
233         default "4.3"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_3
234         default "4.2"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_2
235         default "4.1"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_1
236         default "4.0"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0
237         default "3.19" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_19
238         default "3.18" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_18
239         default "3.17" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17
240         default "3.16" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16
241         default "3.15" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_15
242         default "3.14" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14
243         default "3.13" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_13
244         default "3.12" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12
245         default "3.11" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_11
246         default "3.10" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
247         default "3.9"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
248         default "3.8"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
249         default "3.7"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
250         default "3.6"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_6
251         default "3.5"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_5
252         default "3.4"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_4
253         default "3.3"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_3
254         default "3.2"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
255         default "3.1"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
256         default "3.0"  if BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
257         default "2.6"
259 config BR2_TOOLCHAIN_GCC_AT_LEAST_4_3
260         bool
262 config BR2_TOOLCHAIN_GCC_AT_LEAST_4_4
263         bool
264         select BR2_TOOLCHAIN_GCC_AT_LEAST_4_3
266 config BR2_TOOLCHAIN_GCC_AT_LEAST_4_5
267         bool
268         select BR2_TOOLCHAIN_GCC_AT_LEAST_4_4
270 config BR2_TOOLCHAIN_GCC_AT_LEAST_4_6
271         bool
272         select BR2_TOOLCHAIN_GCC_AT_LEAST_4_5
274 config BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
275         bool
276         select BR2_TOOLCHAIN_GCC_AT_LEAST_4_6
278 config BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
279         bool
280         select BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
282 config BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
283         bool
284         select BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
286 config BR2_TOOLCHAIN_GCC_AT_LEAST_5
287         bool
288         select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
290 config BR2_TOOLCHAIN_GCC_AT_LEAST_6
291         bool
292         select BR2_TOOLCHAIN_GCC_AT_LEAST_5
294 # This order guarantees that the highest version is set, as kconfig
295 # stops affecting a value on the first matching default.
296 config BR2_TOOLCHAIN_GCC_AT_LEAST
297         string
298         default "6"     if BR2_TOOLCHAIN_GCC_AT_LEAST_6
299         default "5"     if BR2_TOOLCHAIN_GCC_AT_LEAST_5
300         default "4.9"   if BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
301         default "4.8"   if BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
302         default "4.7"   if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
303         default "4.6"   if BR2_TOOLCHAIN_GCC_AT_LEAST_4_6
304         default "4.5"   if BR2_TOOLCHAIN_GCC_AT_LEAST_4_5
305         default "4.4"   if BR2_TOOLCHAIN_GCC_AT_LEAST_4_4
306         default "4.3"   if BR2_TOOLCHAIN_GCC_AT_LEAST_4_3
308 config BR2_TOOLCHAIN_HAS_SYNC_1
309         bool
310         default y
311         depends on !BR2_bfin
312         depends on !BR2_m68k_cf
313         depends on !BR2_microblaze
314         depends on !BR2_sparc
315         depends on !(BR2_arc && !BR2_ARC_ATOMIC_EXT)
317 config BR2_TOOLCHAIN_HAS_SYNC_2
318         bool
319         default y if BR2_TOOLCHAIN_HAS_SYNC_1
321 config BR2_TOOLCHAIN_HAS_SYNC_4
322         bool
323         default y
324         depends on !BR2_m68k_cf
325         depends on !BR2_sparc
326         depends on !(BR2_arc && !BR2_ARC_ATOMIC_EXT)
328 # The availability of __sync for 8-byte types on ARM is somewhat
329 # complicated:
331 #  - It appeared in gcc starting with gcc 4.7.
333 #  - On ARMv7, there is no problem, it can be directly implemented in
334 #    userspace.
336 #  - On < ARMv7, it requires help from the kernel. Unfortunately, the
337 #    libgcc code implementing 8-byte __sync with the help from the
338 #    kernel calls __write() when a failure occurs, which is a function
339 #    internal to glibc, not available in uClibc and musl. This means
340 #    that the 8-byte __sync operations are not available on < ARMv7
341 #    with uClibc and musl. This problem was fixed as part of gcc
342 #    PR68059, which was backported to the gcc 5 branch, but isn't yet
343 #    part of any gcc 5.x release.
345 config BR2_TOOLCHAIN_ARM_HAS_SYNC_8
346         bool
347         default y
348         depends on BR2_arm || BR2_armeb
349         depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
350         depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_ARM_CPU_ARMV7A
352 # 8-byte intrinsics available on most x86 CPUs, except a few old ones
353 config BR2_TOOLCHAIN_X86_HAS_SYNC_8
354         bool
355         default y
356         depends on BR2_i386
357         depends on !BR2_x86_i486
358         depends on !BR2_x86_c3
359         depends on !BR2_x86_winchip_c6
360         depends on !BR2_x86_winchip2
362 # 8-byte intrinsics available:
363 #  - On all 64 bits architecture
364 #  - On a certain combinations of ARM platforms
365 #  - On certain x86 32 bits CPUs
366 config BR2_TOOLCHAIN_HAS_SYNC_8
367         bool
368         default y if BR2_ARCH_IS_64
369         default y if BR2_TOOLCHAIN_ARM_HAS_SYNC_8
370         default y if BR2_TOOLCHAIN_X86_HAS_SYNC_8
372 # libatomic is available since gcc 4.8, when thread support is
373 # enabled. Also, libatomic doesn't recognize "uclinux" as a valid OS
374 # part of the tuple, and is therefore not build on uclinux targets,
375 # which is why BR2_BINFMT_FLAT configurations are excluded.
376 config BR2_TOOLCHAIN_HAS_LIBATOMIC
377         bool
378         default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 && \
379                 BR2_TOOLCHAIN_HAS_THREADS && \
380                 !BR2_BINFMT_FLAT
382 # __atomic intrinsics are available:
383 # - with gcc 4.8, either through built-ins or libatomic, on all
384 #   architectures. Since we don't want to separate the cases where
385 #   libatomic is needed vs. not needed, we simplify thing and only
386 #   support situations where libatomic is available, even if on some
387 #   architectures libatomic is not strictly needed as all __atomic
388 #   intrinsics might be built-in. The only case where libatomic is
389 #   missing entirely is when the toolchain does not have support for
390 #   threads. However, a package that does not need threads but still
391 #   uses atomics is quite a corner case, which does not warrant the
392 #   added complexity.
393 # - with gcc 4.7, libatomic did not exist, so only built-ins are
394 #   available. This means that __atomic can only be used in a subset
395 #   of the architectures
396 config BR2_TOOLCHAIN_HAS_ATOMIC
397         bool
398         default y if BR2_TOOLCHAIN_HAS_LIBATOMIC
399         default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_arm
400         default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_armeb
401         default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_xtensa
402         default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_ARCH_IS_64
404 # - libquadmath is not needed/available on all architectures (but gcc
405 #   correctly handles this already).
406 # - At least, libquadmath is available on:
407 #   - i*86
408 #   - x86_64
409 # - When available, libquadmath requires wchar support.
410 config BR2_TOOLCHAIN_HAS_LIBQUADMATH
411         bool
412         default y if BR2_i386 || BR2_x86_64