config: add choice for selecting the LLVM toolchain type
[openwrt/staging/nbd.git] / toolchain / Config.in
1 # Copyright (C) 2006-2013 OpenWrt.org
2 #
3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
5 #
6
7 menuconfig TARGET_OPTIONS
8 bool "Target Options" if DEVEL
9
10 config TARGET_OPTIMIZATION
11 string "Target Optimizations" if TARGET_OPTIONS
12 default DEFAULT_TARGET_OPTIMIZATION
13 help
14 Optimizations to use when building for the target host.
15
16 config SOFT_FLOAT
17 bool "Use software floating point by default" if TARGET_OPTIONS
18 default y if !HAS_FPU
19 depends on arm || armeb || powerpc || mipsel || mips || mips64el || mips64
20 help
21 If your target CPU does not have a Floating Point Unit (FPU) or a
22 kernel FPU emulator, but you still wish to support floating point
23 functions, then everything will need to be compiled with soft floating
24 point support (-msoft-float).
25
26 Most people will answer N.
27
28 config USE_MIPS16
29 bool "Build packages with MIPS16 instructions" if TARGET_OPTIONS
30 depends on HAS_MIPS16
31 default y
32 help
33 If your target CPU does support the MIPS16 instruction set
34 and you want to use it for packages, enable this option.
35 MIPS16 produces smaller binaries thus reducing pressure on
36 caches and TLB.
37
38 Most people will answer N.
39
40
41 choice BPF_TOOLCHAIN
42 prompt "BPF toolchain" if DEVEL
43 default BPF_TOOLCHAIN_NONE
44
45 config BPF_TOOLCHAIN_NONE
46 bool "None"
47
48 config BPF_TOOLCHAIN_HOST
49 bool "Use host LLVM toolchain"
50
51 config BPF_TOOLCHAIN_BUILD_LLVM
52 bool "Build LLVM toolchain for eBPF"
53 help
54 If enabled, a LLVM toolchain for building eBPF binaries will be built.
55 If this is not enabled, eBPF packages can only be built if the host
56 has a suitable toolchain
57 endchoice
58
59 config BPF_TOOLCHAIN_HOST_PATH
60 string
61 depends on BPF_TOOLCHAIN_HOST
62 prompt "Host LLVM toolchain path (prefix)" if DEVEL
63 default "/usr/local/opt/llvm" if HOST_OS_MACOS
64 default ""
65
66 menuconfig EXTERNAL_TOOLCHAIN
67 bool
68 prompt "Use external toolchain" if DEVEL
69 help
70 If enabled, the buildroot will compile using an existing toolchain instead of
71 compiling one.
72
73 config NATIVE_TOOLCHAIN
74 bool
75 prompt "Use host's toolchain" if DEVEL
76 depends on EXTERNAL_TOOLCHAIN
77 select NO_STRIP
78 help
79 If enabled, the buildroot will compile using the native toolchain for your
80 host instead of compiling one.
81
82 config TARGET_NAME
83 string
84 prompt "Target name" if DEVEL
85 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
86 default "aarch64-unknown-linux-gnu" if aarch64
87 default "aarch64_be-unknown-linux-gnu" if aarch64_be
88 default "arm-unknown-linux-gnu" if arm
89 default "armeb-unknown-linux-gnu" if armeb
90 default "i486-unknown-linux-gnu" if i386
91 default "mips-unknown-linux-gnu" if mips
92 default "mipsel-unknown-linux-gnu" if mipsel
93 default "powerpc-unknown-linux-gnu" if powerpc
94 default "x86_64-unknown-linux-gnu" if x86_64
95
96 config TOOLCHAIN_PREFIX
97 string
98 prompt "Toolchain prefix" if DEVEL
99 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
100 default "aarch64-unknown-linux-gnu" if aarch64
101 default "aarch64_be-unknown-linux-gnu" if aarch64_be
102 default "arm-unknown-linux-gnu-" if arm
103 default "armeb-unknown-linux-gnu-" if armeb
104 default "i486-unknown-linux-gnu-" if i386
105 default "mips-unknown-linux-gnu-" if mips
106 default "mipsel-unknown-linux-gnu-" if mipsel
107 default "powerpc-unknown-linux-gnu-" if powerpc
108 default "x86_64-unknown-linux-gnu-" if x86_64
109
110 config TOOLCHAIN_ROOT
111 string
112 prompt "Toolchain root" if DEVEL
113 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
114 default "/opt/cross/aarch64-unknown-linux-gnu" if aarch64
115 default "/opt/cross/aarch64_be-unknown-linux-gnu" if aarch64_be
116 default "/opt/cross/arm-unknown-linux-gnu" if arm
117 default "/opt/cross/armeb-unknown-linux-gnu" if armeb
118 default "/opt/cross/i486-unknown-linux-gnu" if i386
119 default "/opt/cross/mips-unknown-linux-gnu" if mips
120 default "/opt/cross/mipsel-unknown-linux-gnu" if mipsel
121 default "/opt/cross/powerpc-unknown-linux-gnu" if powerpc
122 default "/opt/cross/x86_64-unknown-linux-gnu" if x86_64
123
124 choice TOOLCHAIN_LIBC_TYPE
125 prompt "Toolchain libc" if DEVEL
126 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
127 default EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
128 help
129 Specify the libc type used by the external toolchain. The given value
130 is passed as -m flag to all gcc and g++ invocations. This is mainly
131 intended for multilib toolchains which support glibc and uclibc at
132 the same time. If no value is specified, no -m flag is passed.
133
134 config EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
135 bool "glibc"
136 select USE_GLIBC
137
138 config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
139 bool "musl"
140 select USE_MUSL
141
142 endchoice
143
144 config TOOLCHAIN_LIBC
145 string
146 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
147 default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
148 default "musl" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
149
150 config TOOLCHAIN_BIN_PATH
151 string
152 prompt "Toolchain program path" if DEVEL
153 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
154 default "./usr/bin ./bin"
155 help
156 Specify additional directories searched for toolchain binaries
157 (override PATH). Use ./DIR for directories relative to the root above.
158
159 config TOOLCHAIN_INC_PATH
160 string
161 prompt "Toolchain include path" if DEVEL
162 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
163 default "./usr/include ./include"
164 help
165 Specify additional directories searched for header files (override
166 CPPFLAGS). Use ./DIR for directories relative to the root above.
167
168 config TOOLCHAIN_LIB_PATH
169 string
170 prompt "Toolchain library path" if DEVEL
171 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
172 default "./usr/lib ./lib"
173 help
174 Specify additional directories searched for libraries (override LDFLAGS).
175 Use ./DIR for directories relative to the root above.
176
177 config NEED_TOOLCHAIN
178 bool
179 depends on DEVEL
180 default y if !EXTERNAL_TOOLCHAIN
181
182 menuconfig TOOLCHAINOPTS
183 bool "Toolchain Options" if DEVEL
184 depends on NEED_TOOLCHAIN
185
186 menuconfig EXTRA_TARGET_ARCH
187 bool
188 prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
189 depends on !sparc
190 default n
191 help
192 Some builds may require a 'biarch' toolchain. This option
193 allows you to specify an additional target arch.
194
195 Most people will answer N here.
196
197 config EXTRA_TARGET_ARCH_NAME
198 string
199 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
200 help
201 Specify the cpu name (eg powerpc64 or x86_64) of the
202 additional target architecture.
203
204 config EXTRA_TARGET_ARCH_OPTS
205 string
206 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
207 help
208 If you're specifying an addition target architecture,
209 you'll probably need to also provide options to make
210 the compiler use this alternate arch.
211
212 For example, if you're building a compiler that can build
213 both powerpc and powerpc64 binaries, you'll need to
214 specify -m64 here.
215
216
217 choice
218 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
219 default MIPS64_ABI_N64
220 help
221 MIPS64 supports 3 different user-land ABIs: o32 (legacy),
222 n32 and n64.
223
224 config MIPS64_ABI_N64
225 bool "n64"
226
227 config MIPS64_ABI_N32
228 depends on !LIBC_USE_MUSL
229 bool "n32"
230
231 config MIPS64_ABI_O32
232 bool "o32"
233
234 endchoice
235
236 comment "Binary tools"
237 depends on TOOLCHAINOPTS
238
239 source "toolchain/binutils/Config.in"
240
241 comment "Compiler"
242 depends on TOOLCHAINOPTS
243
244 source "toolchain/gcc/Config.in"
245
246 config NASM
247 bool
248 depends on ( i386 || x86_64 )
249 prompt "Build nasm" if TOOLCHAINOPTS
250 default y
251 help
252 Enable if you want to build nasm
253
254 comment "C Library"
255 depends on TOOLCHAINOPTS
256
257 choice
258 prompt "C Library implementation" if TOOLCHAINOPTS
259 default LIBC_USE_GLIBC if arc
260 default LIBC_USE_MUSL
261 help
262 Select the C library implementation.
263
264 config LIBC_USE_GLIBC
265 bool "Use glibc"
266 select USE_GLIBC
267
268 config LIBC_USE_MUSL
269 select USE_MUSL
270 bool "Use musl"
271 depends on !arc
272
273 endchoice
274
275 source "toolchain/musl/Config.in"
276
277 comment "Debuggers"
278 depends on TOOLCHAINOPTS
279
280 config GDB
281 bool
282 prompt "Build gdb" if TOOLCHAINOPTS
283 default y if !EXTERNAL_TOOLCHAIN
284 help
285 Enable if you want to build the gdb.
286
287 config GDB_PYTHON
288 bool
289 depends on GDB
290 prompt "Build gdb with python binding"
291
292 help
293 Enable the python bindings for GDB to allow using python in the gdb shell.
294
295 config USE_GLIBC
296 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
297 bool
298
299 config USE_MUSL
300 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc)
301 bool
302
303 config SSP_SUPPORT
304 default y if !PKG_CC_STACKPROTECTOR_NONE
305 bool
306
307 config USE_EXTERNAL_LIBC
308 bool
309 default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
310
311 source "toolchain/binutils/Config.version"
312 source "toolchain/gcc/Config.version"
313
314 config LIBC
315 string
316 default "glibc" if USE_GLIBC
317 default "musl" if USE_MUSL
318
319 config TARGET_SUFFIX
320 string
321 default "gnueabi" if USE_GLIBC && (arm || armeb)
322 default "gnu" if USE_GLIBC && !(arm || armeb)
323 default "muslgnueabi" if USE_MUSL && (arm || armeb)
324 default "musl" if USE_MUSL && !(arm || armeb)
325
326 config MIPS64_ABI
327 depends on mips64 || mips64el
328 string
329 default "64" if MIPS64_ABI_N64
330 default "n32" if MIPS64_ABI_N32
331 default "32" if MIPS64_ABI_O32
332 default "64"