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 "loongarch64-unknown-linux-gnu" if loongarch64
101 default "mips-unknown-linux-gnu" if mips
102 default "mipsel-unknown-linux-gnu" if mipsel
103 default "powerpc-unknown-linux-gnu" if powerpc
104 default "x86_64-unknown-linux-gnu" if x86_64
106 config TOOLCHAIN_PREFIX
108 prompt "Toolchain prefix" if DEVEL
109 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
110 default "aarch64-unknown-linux-gnu" if aarch64
111 default "aarch64_be-unknown-linux-gnu" if aarch64_be
112 default "arm-unknown-linux-gnu-" if arm
113 default "armeb-unknown-linux-gnu-" if armeb
114 default "i486-unknown-linux-gnu-" if i386
115 default "loongarch64-unknown-linux-gnu-" if loongarch64
116 default "mips-unknown-linux-gnu-" if mips
117 default "mipsel-unknown-linux-gnu-" if mipsel
118 default "powerpc-unknown-linux-gnu-" if powerpc
119 default "x86_64-unknown-linux-gnu-" if x86_64
121 config TOOLCHAIN_ROOT
123 prompt "Toolchain root" if DEVEL
124 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
125 default "/opt/cross/aarch64-unknown-linux-gnu" if aarch64
126 default "/opt/cross/aarch64_be-unknown-linux-gnu" if aarch64_be
127 default "/opt/cross/arm-unknown-linux-gnu" if arm
128 default "/opt/cross/armeb-unknown-linux-gnu" if armeb
129 default "/opt/cross/i486-unknown-linux-gnu" if i386
130 default "/opt/cross/loongarch64-unknown-linux-gnu" if loongarch64
131 default "/opt/cross/mips-unknown-linux-gnu" if mips
132 default "/opt/cross/mipsel-unknown-linux-gnu" if mipsel
133 default "/opt/cross/powerpc-unknown-linux-gnu" if powerpc
134 default "/opt/cross/x86_64-unknown-linux-gnu" if x86_64
136 choice TOOLCHAIN_LIBC_TYPE
137 prompt "Toolchain libc" if DEVEL
138 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
139 default EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
141 Specify the libc type used by the external toolchain. The given value
142 is passed as -m flag to all gcc and g++ invocations. This is mainly
143 intended for multilib toolchains which support glibc and uclibc at
144 the same time. If no value is specified, no -m flag is passed.
146 config EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
150 config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
156 config EXTERNAL_GCC_VERSION
158 prompt "External Toolchain GCC Version" if DEVEL
159 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
161 Manually specify the GCC version used by the selected
164 config TOOLCHAIN_LIBC
166 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
167 default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
168 default "musl" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
170 config TOOLCHAIN_BIN_PATH
172 prompt "Toolchain program path" if DEVEL
173 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
174 default "./usr/bin ./bin"
176 Specify additional directories searched for toolchain binaries
177 (override PATH). Use ./DIR for directories relative to the root above.
179 config TOOLCHAIN_INC_PATH
181 prompt "Toolchain include path" if DEVEL
182 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
183 default "./usr/include ./include/fortify ./include" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
184 default "./usr/include ./include"
186 Specify additional directories searched for header files (override
187 CPPFLAGS). Use ./DIR for directories relative to the root above.
189 config TOOLCHAIN_LIB_PATH
191 prompt "Toolchain library path" if DEVEL
192 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
193 default "./usr/lib ./lib"
195 Specify additional directories searched for libraries (override LDFLAGS).
196 Use ./DIR for directories relative to the root above.
198 config NEED_TOOLCHAIN
201 default y if !EXTERNAL_TOOLCHAIN
203 menuconfig TOOLCHAINOPTS
204 bool "Toolchain Options" if DEVEL
205 depends on NEED_TOOLCHAIN
207 menuconfig EXTRA_TARGET_ARCH
209 prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
212 Some builds may require a 'biarch' toolchain. This option
213 allows you to specify an additional target arch.
215 Most people will answer N here.
217 config EXTRA_TARGET_ARCH_NAME
219 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
221 Specify the cpu name (eg powerpc64 or x86_64) of the
222 additional target architecture.
224 config EXTRA_TARGET_ARCH_OPTS
226 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
228 If you're specifying an addition target architecture,
229 you'll probably need to also provide options to make
230 the compiler use this alternate arch.
232 For example, if you're building a compiler that can build
233 both powerpc and powerpc64 binaries, you'll need to
238 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
239 default MIPS64_ABI_N64
241 MIPS64 supports 3 different user-land ABIs: o32 (legacy),
244 config MIPS64_ABI_N64
247 config MIPS64_ABI_N32
248 depends on !LIBC_USE_MUSL
251 config MIPS64_ABI_O32
256 comment "Binary tools"
257 depends on TOOLCHAINOPTS
259 source "toolchain/binutils/Config.in"
263 prompt "Build pahole" if TOOLCHAINOPTS
264 depends on !HOST_OS_MACOS
266 Enable if you want to build pahole and the dwarves tools.
269 depends on TOOLCHAINOPTS
271 source "toolchain/gcc/Config.in"
275 depends on ( i386 || x86_64 )
276 prompt "Build nasm" if TOOLCHAINOPTS
279 Enable if you want to build nasm
282 depends on TOOLCHAINOPTS
285 prompt "C Library implementation" if TOOLCHAINOPTS
286 default LIBC_USE_GLIBC if arc
287 default LIBC_USE_MUSL
289 Select the C library implementation.
291 config LIBC_USE_GLIBC
302 source "toolchain/musl/Config.in"
305 depends on TOOLCHAINOPTS
309 prompt "Build gdb" if TOOLCHAINOPTS
310 default y if !EXTERNAL_TOOLCHAIN
312 Enable if you want to build the gdb.
317 prompt "Build gdb with python binding"
320 Enable the python bindings for GDB to allow using python in the gdb shell.
322 config HAS_BPF_TOOLCHAIN
325 config HAS_PREBUILT_LLVM_TOOLCHAIN
326 def_bool $(shell, [ -f llvm-bpf/.llvm-version ] && echo y || echo n)
329 select HAS_BPF_TOOLCHAIN
332 config USE_LLVM_PREBUILT
333 select HAS_BPF_TOOLCHAIN
334 default y if !DEVEL && !BUILDBOT && HAS_PREBUILT_LLVM_TOOLCHAIN
337 config USE_LLVM_BUILD
338 default y if !DEVEL && BUILDBOT
339 select HAS_BPF_TOOLCHAIN
343 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
347 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc)
351 default y if !PKG_CC_STACKPROTECTOR_NONE
354 config USE_EXTERNAL_LIBC
356 default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
358 source "toolchain/binutils/Config.version"
359 source "toolchain/gcc/Config.version"
363 default "glibc" if USE_GLIBC
364 default "musl" if USE_MUSL
368 default "gnueabi" if USE_GLIBC && (arm || armeb)
369 default "gnu" if USE_GLIBC && !(arm || armeb)
370 default "muslgnueabi" if USE_MUSL && (arm || armeb)
371 default "musl" if USE_MUSL && !(arm || armeb)
374 depends on mips64 || mips64el
376 default "64" if MIPS64_ABI_N64
377 default "n32" if MIPS64_ABI_N32
378 default "32" if MIPS64_ABI_O32