1 # Copyright (C) 2006-2013 OpenWrt.org
3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
7 menuconfig TARGET_OPTIONS
8 bool "Target Options" if DEVEL
10 config TARGET_OPTIMIZATION
11 string "Target Optimizations" if TARGET_OPTIONS
12 default DEFAULT_TARGET_OPTIMIZATION
14 Optimizations to use when building for the target host.
17 bool "Use software floating point by default" if TARGET_OPTIONS
19 depends on arm || armeb || powerpc || mipsel || mips || mips64el || mips64
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).
26 Most people will answer N.
29 bool "Build packages with MIPS16 instructions" if TARGET_OPTIONS
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
38 Most people will answer N.
42 prompt "BPF toolchain" if DEVEL
43 default BPF_TOOLCHAIN_BUILD_LLVM if BUILDBOT
44 default BPF_TOOLCHAIN_PREBUILT if HAS_PREBUILT_LLVM_TOOLCHAIN
45 default BPF_TOOLCHAIN_NONE
47 config BPF_TOOLCHAIN_NONE
50 config BPF_TOOLCHAIN_PREBUILT
51 bool "Use prebuilt LLVM toolchain"
52 depends on HAS_PREBUILT_LLVM_TOOLCHAIN
53 select USE_LLVM_PREBUILT
55 config BPF_TOOLCHAIN_HOST
57 bool "Use host LLVM toolchain"
59 config BPF_TOOLCHAIN_BUILD_LLVM
61 bool "Build LLVM toolchain for eBPF"
63 If enabled, a LLVM toolchain for building eBPF binaries will be built.
64 If this is not enabled, eBPF packages can only be built if the host
65 has a suitable toolchain
68 config BPF_TOOLCHAIN_HOST_PATH
70 depends on BPF_TOOLCHAIN_HOST
71 prompt "Host LLVM toolchain path (prefix)" if DEVEL
72 default "/usr/local/opt/llvm" if HOST_OS_MACOS
75 menuconfig EXTERNAL_TOOLCHAIN
77 prompt "Use external toolchain" if DEVEL
79 If enabled, the buildroot will compile using an existing toolchain instead of
82 config NATIVE_TOOLCHAIN
84 prompt "Use host's toolchain" if DEVEL
85 depends on EXTERNAL_TOOLCHAIN
88 If enabled, the buildroot will compile using the native toolchain for your
89 host instead of compiling one.
93 prompt "Target name" if DEVEL
94 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
95 default "aarch64-unknown-linux-gnu" if aarch64
96 default "aarch64_be-unknown-linux-gnu" if aarch64_be
97 default "arm-unknown-linux-gnu" if arm
98 default "armeb-unknown-linux-gnu" if armeb
99 default "i486-unknown-linux-gnu" if i386
100 default "mips-unknown-linux-gnu" if mips
101 default "mipsel-unknown-linux-gnu" if mipsel
102 default "powerpc-unknown-linux-gnu" if powerpc
103 default "x86_64-unknown-linux-gnu" if x86_64
105 config TOOLCHAIN_PREFIX
107 prompt "Toolchain prefix" if DEVEL
108 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
109 default "aarch64-unknown-linux-gnu" if aarch64
110 default "aarch64_be-unknown-linux-gnu" if aarch64_be
111 default "arm-unknown-linux-gnu-" if arm
112 default "armeb-unknown-linux-gnu-" if armeb
113 default "i486-unknown-linux-gnu-" if i386
114 default "mips-unknown-linux-gnu-" if mips
115 default "mipsel-unknown-linux-gnu-" if mipsel
116 default "powerpc-unknown-linux-gnu-" if powerpc
117 default "x86_64-unknown-linux-gnu-" if x86_64
119 config TOOLCHAIN_ROOT
121 prompt "Toolchain root" if DEVEL
122 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
123 default "/opt/cross/aarch64-unknown-linux-gnu" if aarch64
124 default "/opt/cross/aarch64_be-unknown-linux-gnu" if aarch64_be
125 default "/opt/cross/arm-unknown-linux-gnu" if arm
126 default "/opt/cross/armeb-unknown-linux-gnu" if armeb
127 default "/opt/cross/i486-unknown-linux-gnu" if i386
128 default "/opt/cross/mips-unknown-linux-gnu" if mips
129 default "/opt/cross/mipsel-unknown-linux-gnu" if mipsel
130 default "/opt/cross/powerpc-unknown-linux-gnu" if powerpc
131 default "/opt/cross/x86_64-unknown-linux-gnu" if x86_64
133 choice TOOLCHAIN_LIBC_TYPE
134 prompt "Toolchain libc" if DEVEL
135 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
136 default EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
138 Specify the libc type used by the external toolchain. The given value
139 is passed as -m flag to all gcc and g++ invocations. This is mainly
140 intended for multilib toolchains which support glibc and uclibc at
141 the same time. If no value is specified, no -m flag is passed.
143 config EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
147 config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
153 config TOOLCHAIN_LIBC
155 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
156 default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
157 default "musl" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
159 config TOOLCHAIN_BIN_PATH
161 prompt "Toolchain program path" if DEVEL
162 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
163 default "./usr/bin ./bin"
165 Specify additional directories searched for toolchain binaries
166 (override PATH). Use ./DIR for directories relative to the root above.
168 config TOOLCHAIN_INC_PATH
170 prompt "Toolchain include path" if DEVEL
171 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
172 default "./usr/include ./include/fortify ./include" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
173 default "./usr/include ./include"
175 Specify additional directories searched for header files (override
176 CPPFLAGS). Use ./DIR for directories relative to the root above.
178 config TOOLCHAIN_LIB_PATH
180 prompt "Toolchain library path" if DEVEL
181 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
182 default "./usr/lib ./lib"
184 Specify additional directories searched for libraries (override LDFLAGS).
185 Use ./DIR for directories relative to the root above.
187 config NEED_TOOLCHAIN
190 default y if !EXTERNAL_TOOLCHAIN
192 menuconfig TOOLCHAINOPTS
193 bool "Toolchain Options" if DEVEL
194 depends on NEED_TOOLCHAIN
196 menuconfig EXTRA_TARGET_ARCH
198 prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
202 Some builds may require a 'biarch' toolchain. This option
203 allows you to specify an additional target arch.
205 Most people will answer N here.
207 config EXTRA_TARGET_ARCH_NAME
209 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
211 Specify the cpu name (eg powerpc64 or x86_64) of the
212 additional target architecture.
214 config EXTRA_TARGET_ARCH_OPTS
216 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
218 If you're specifying an addition target architecture,
219 you'll probably need to also provide options to make
220 the compiler use this alternate arch.
222 For example, if you're building a compiler that can build
223 both powerpc and powerpc64 binaries, you'll need to
228 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
229 default MIPS64_ABI_N64
231 MIPS64 supports 3 different user-land ABIs: o32 (legacy),
234 config MIPS64_ABI_N64
237 config MIPS64_ABI_N32
238 depends on !LIBC_USE_MUSL
241 config MIPS64_ABI_O32
246 comment "Binary tools"
247 depends on TOOLCHAINOPTS
249 source "toolchain/binutils/Config.in"
253 prompt "Build pahole" if TOOLCHAINOPTS
254 depends on !HOST_OS_MACOS
257 Enable if you want to build pahole and the dwarves tools.
260 depends on TOOLCHAINOPTS
262 source "toolchain/gcc/Config.in"
266 depends on ( i386 || x86_64 )
267 prompt "Build nasm" if TOOLCHAINOPTS
270 Enable if you want to build nasm
273 depends on TOOLCHAINOPTS
276 prompt "C Library implementation" if TOOLCHAINOPTS
277 default LIBC_USE_GLIBC if arc
278 default LIBC_USE_MUSL
280 Select the C library implementation.
282 config LIBC_USE_GLIBC
293 source "toolchain/musl/Config.in"
296 depends on TOOLCHAINOPTS
300 prompt "Build gdb" if TOOLCHAINOPTS
301 default y if !EXTERNAL_TOOLCHAIN
303 Enable if you want to build the gdb.
308 prompt "Build gdb with python binding"
311 Enable the python bindings for GDB to allow using python in the gdb shell.
313 config HAS_BPF_TOOLCHAIN
316 config HAS_PREBUILT_LLVM_TOOLCHAIN
317 def_bool $(shell, [ -f llvm-bpf/.llvm-version ] && echo y || echo n)
320 select HAS_BPF_TOOLCHAIN
323 config USE_LLVM_PREBUILT
324 select HAS_BPF_TOOLCHAIN
325 default y if !DEVEL && !BUILDBOT && HAS_PREBUILT_LLVM_TOOLCHAIN
328 config USE_LLVM_BUILD
329 default y if !DEVEL && BUILDBOT
330 select HAS_BPF_TOOLCHAIN
334 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
338 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc)
342 default y if !PKG_CC_STACKPROTECTOR_NONE
345 config USE_EXTERNAL_LIBC
347 default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
349 source "toolchain/binutils/Config.version"
350 source "toolchain/gcc/Config.version"
354 default "glibc" if USE_GLIBC
355 default "musl" if USE_MUSL
359 default "gnueabi" if USE_GLIBC && (arm || armeb)
360 default "gnu" if USE_GLIBC && !(arm || armeb)
361 default "muslgnueabi" if USE_MUSL && (arm || armeb)
362 default "musl" if USE_MUSL && !(arm || armeb)
365 depends on mips64 || mips64el
367 default "64" if MIPS64_ABI_N64
368 default "n32" if MIPS64_ABI_N32
369 default "32" if MIPS64_ABI_O32