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