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