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_NONE
45 config BPF_TOOLCHAIN_NONE
48 config BPF_TOOLCHAIN_HOST
50 bool "Use host LLVM toolchain"
52 config BPF_TOOLCHAIN_BUILD_LLVM
54 bool "Build LLVM toolchain for eBPF"
56 If enabled, a LLVM toolchain for building eBPF binaries will be built.
57 If this is not enabled, eBPF packages can only be built if the host
58 has a suitable toolchain
61 config BPF_TOOLCHAIN_HOST_PATH
63 depends on BPF_TOOLCHAIN_HOST
64 prompt "Host LLVM toolchain path (prefix)" if DEVEL
65 default "/usr/local/opt/llvm" if HOST_OS_MACOS
68 menuconfig EXTERNAL_TOOLCHAIN
70 prompt "Use external toolchain" if DEVEL
72 If enabled, the buildroot will compile using an existing toolchain instead of
75 config NATIVE_TOOLCHAIN
77 prompt "Use host's toolchain" if DEVEL
78 depends on EXTERNAL_TOOLCHAIN
81 If enabled, the buildroot will compile using the native toolchain for your
82 host instead of compiling one.
86 prompt "Target name" if DEVEL
87 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
88 default "aarch64-unknown-linux-gnu" if aarch64
89 default "aarch64_be-unknown-linux-gnu" if aarch64_be
90 default "arm-unknown-linux-gnu" if arm
91 default "armeb-unknown-linux-gnu" if armeb
92 default "i486-unknown-linux-gnu" if i386
93 default "mips-unknown-linux-gnu" if mips
94 default "mipsel-unknown-linux-gnu" if mipsel
95 default "powerpc-unknown-linux-gnu" if powerpc
96 default "x86_64-unknown-linux-gnu" if x86_64
98 config TOOLCHAIN_PREFIX
100 prompt "Toolchain prefix" if DEVEL
101 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
102 default "aarch64-unknown-linux-gnu" if aarch64
103 default "aarch64_be-unknown-linux-gnu" if aarch64_be
104 default "arm-unknown-linux-gnu-" if arm
105 default "armeb-unknown-linux-gnu-" if armeb
106 default "i486-unknown-linux-gnu-" if i386
107 default "mips-unknown-linux-gnu-" if mips
108 default "mipsel-unknown-linux-gnu-" if mipsel
109 default "powerpc-unknown-linux-gnu-" if powerpc
110 default "x86_64-unknown-linux-gnu-" if x86_64
112 config TOOLCHAIN_ROOT
114 prompt "Toolchain root" if DEVEL
115 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
116 default "/opt/cross/aarch64-unknown-linux-gnu" if aarch64
117 default "/opt/cross/aarch64_be-unknown-linux-gnu" if aarch64_be
118 default "/opt/cross/arm-unknown-linux-gnu" if arm
119 default "/opt/cross/armeb-unknown-linux-gnu" if armeb
120 default "/opt/cross/i486-unknown-linux-gnu" if i386
121 default "/opt/cross/mips-unknown-linux-gnu" if mips
122 default "/opt/cross/mipsel-unknown-linux-gnu" if mipsel
123 default "/opt/cross/powerpc-unknown-linux-gnu" if powerpc
124 default "/opt/cross/x86_64-unknown-linux-gnu" if x86_64
126 choice TOOLCHAIN_LIBC_TYPE
127 prompt "Toolchain libc" if DEVEL
128 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
129 default EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
131 Specify the libc type used by the external toolchain. The given value
132 is passed as -m flag to all gcc and g++ invocations. This is mainly
133 intended for multilib toolchains which support glibc and uclibc at
134 the same time. If no value is specified, no -m flag is passed.
136 config EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
140 config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
146 config TOOLCHAIN_LIBC
148 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
149 default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
150 default "musl" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
152 config TOOLCHAIN_BIN_PATH
154 prompt "Toolchain program path" if DEVEL
155 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
156 default "./usr/bin ./bin"
158 Specify additional directories searched for toolchain binaries
159 (override PATH). Use ./DIR for directories relative to the root above.
161 config TOOLCHAIN_INC_PATH
163 prompt "Toolchain include path" if DEVEL
164 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
165 default "./usr/include ./include"
167 Specify additional directories searched for header files (override
168 CPPFLAGS). Use ./DIR for directories relative to the root above.
170 config TOOLCHAIN_LIB_PATH
172 prompt "Toolchain library path" if DEVEL
173 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
174 default "./usr/lib ./lib"
176 Specify additional directories searched for libraries (override LDFLAGS).
177 Use ./DIR for directories relative to the root above.
179 config NEED_TOOLCHAIN
182 default y if !EXTERNAL_TOOLCHAIN
184 menuconfig TOOLCHAINOPTS
185 bool "Toolchain Options" if DEVEL
186 depends on NEED_TOOLCHAIN
188 menuconfig EXTRA_TARGET_ARCH
190 prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
194 Some builds may require a 'biarch' toolchain. This option
195 allows you to specify an additional target arch.
197 Most people will answer N here.
199 config EXTRA_TARGET_ARCH_NAME
201 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
203 Specify the cpu name (eg powerpc64 or x86_64) of the
204 additional target architecture.
206 config EXTRA_TARGET_ARCH_OPTS
208 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
210 If you're specifying an addition target architecture,
211 you'll probably need to also provide options to make
212 the compiler use this alternate arch.
214 For example, if you're building a compiler that can build
215 both powerpc and powerpc64 binaries, you'll need to
220 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
221 default MIPS64_ABI_N64
223 MIPS64 supports 3 different user-land ABIs: o32 (legacy),
226 config MIPS64_ABI_N64
229 config MIPS64_ABI_N32
230 depends on !LIBC_USE_MUSL
233 config MIPS64_ABI_O32
238 comment "Binary tools"
239 depends on TOOLCHAINOPTS
241 source "toolchain/binutils/Config.in"
244 depends on TOOLCHAINOPTS
246 source "toolchain/gcc/Config.in"
250 depends on ( i386 || x86_64 )
251 prompt "Build nasm" if TOOLCHAINOPTS
254 Enable if you want to build nasm
257 depends on TOOLCHAINOPTS
260 prompt "C Library implementation" if TOOLCHAINOPTS
261 default LIBC_USE_GLIBC if arc
262 default LIBC_USE_MUSL
264 Select the C library implementation.
266 config LIBC_USE_GLIBC
277 source "toolchain/musl/Config.in"
280 depends on TOOLCHAINOPTS
284 prompt "Build gdb" if TOOLCHAINOPTS
285 default y if !EXTERNAL_TOOLCHAIN
287 Enable if you want to build the gdb.
292 prompt "Build gdb with python binding"
295 Enable the python bindings for GDB to allow using python in the gdb shell.
297 config HAS_BPF_TOOLCHAIN
301 select HAS_BPF_TOOLCHAIN
304 config USE_LLVM_BUILD
305 select HAS_BPF_TOOLCHAIN
309 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
313 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc)
317 default y if !PKG_CC_STACKPROTECTOR_NONE
320 config USE_EXTERNAL_LIBC
322 default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
324 source "toolchain/binutils/Config.version"
325 source "toolchain/gcc/Config.version"
329 default "glibc" if USE_GLIBC
330 default "musl" if USE_MUSL
334 default "gnueabi" if USE_GLIBC && (arm || armeb)
335 default "gnu" if USE_GLIBC && !(arm || armeb)
336 default "muslgnueabi" if USE_MUSL && (arm || armeb)
337 default "musl" if USE_MUSL && !(arm || armeb)
340 depends on mips64 || mips64el
342 default "64" if MIPS64_ABI_N64
343 default "n32" if MIPS64_ABI_N32
344 default "32" if MIPS64_ABI_O32