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_NONE
46 config BPF_TOOLCHAIN_NONE
49 config BPF_TOOLCHAIN_HOST
51 bool "Use host LLVM toolchain"
53 config BPF_TOOLCHAIN_BUILD_LLVM
55 bool "Build LLVM toolchain for eBPF"
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
62 config BPF_TOOLCHAIN_HOST_PATH
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
69 menuconfig EXTERNAL_TOOLCHAIN
71 prompt "Use external toolchain" if DEVEL
73 If enabled, the buildroot will compile using an existing toolchain instead of
76 config NATIVE_TOOLCHAIN
78 prompt "Use host's toolchain" if DEVEL
79 depends on EXTERNAL_TOOLCHAIN
82 If enabled, the buildroot will compile using the native toolchain for your
83 host instead of compiling one.
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
99 config TOOLCHAIN_PREFIX
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
113 config TOOLCHAIN_ROOT
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
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
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.
137 config EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
141 config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
147 config TOOLCHAIN_LIBC
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
153 config TOOLCHAIN_BIN_PATH
155 prompt "Toolchain program path" if DEVEL
156 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
157 default "./usr/bin ./bin"
159 Specify additional directories searched for toolchain binaries
160 (override PATH). Use ./DIR for directories relative to the root above.
162 config TOOLCHAIN_INC_PATH
164 prompt "Toolchain include path" if DEVEL
165 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
166 default "./usr/include ./include"
168 Specify additional directories searched for header files (override
169 CPPFLAGS). Use ./DIR for directories relative to the root above.
171 config TOOLCHAIN_LIB_PATH
173 prompt "Toolchain library path" if DEVEL
174 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
175 default "./usr/lib ./lib"
177 Specify additional directories searched for libraries (override LDFLAGS).
178 Use ./DIR for directories relative to the root above.
180 config NEED_TOOLCHAIN
183 default y if !EXTERNAL_TOOLCHAIN
185 menuconfig TOOLCHAINOPTS
186 bool "Toolchain Options" if DEVEL
187 depends on NEED_TOOLCHAIN
189 menuconfig EXTRA_TARGET_ARCH
191 prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
195 Some builds may require a 'biarch' toolchain. This option
196 allows you to specify an additional target arch.
198 Most people will answer N here.
200 config EXTRA_TARGET_ARCH_NAME
202 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
204 Specify the cpu name (eg powerpc64 or x86_64) of the
205 additional target architecture.
207 config EXTRA_TARGET_ARCH_OPTS
209 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
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.
215 For example, if you're building a compiler that can build
216 both powerpc and powerpc64 binaries, you'll need to
221 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
222 default MIPS64_ABI_N64
224 MIPS64 supports 3 different user-land ABIs: o32 (legacy),
227 config MIPS64_ABI_N64
230 config MIPS64_ABI_N32
231 depends on !LIBC_USE_MUSL
234 config MIPS64_ABI_O32
239 comment "Binary tools"
240 depends on TOOLCHAINOPTS
242 source "toolchain/binutils/Config.in"
245 depends on TOOLCHAINOPTS
247 source "toolchain/gcc/Config.in"
251 depends on ( i386 || x86_64 )
252 prompt "Build nasm" if TOOLCHAINOPTS
255 Enable if you want to build nasm
258 depends on TOOLCHAINOPTS
261 prompt "C Library implementation" if TOOLCHAINOPTS
262 default LIBC_USE_GLIBC if arc
263 default LIBC_USE_MUSL
265 Select the C library implementation.
267 config LIBC_USE_GLIBC
278 source "toolchain/musl/Config.in"
281 depends on TOOLCHAINOPTS
285 prompt "Build gdb" if TOOLCHAINOPTS
286 default y if !EXTERNAL_TOOLCHAIN
288 Enable if you want to build the gdb.
293 prompt "Build gdb with python binding"
296 Enable the python bindings for GDB to allow using python in the gdb shell.
298 config HAS_BPF_TOOLCHAIN
302 select HAS_BPF_TOOLCHAIN
305 config USE_LLVM_BUILD
306 default y if !DEVEL && BUILDBOT
307 select HAS_BPF_TOOLCHAIN
311 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
315 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc)
319 default y if !PKG_CC_STACKPROTECTOR_NONE
322 config USE_EXTERNAL_LIBC
324 default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
326 source "toolchain/binutils/Config.version"
327 source "toolchain/gcc/Config.version"
331 default "glibc" if USE_GLIBC
332 default "musl" if USE_MUSL
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)
342 depends on mips64 || mips64el
344 default "64" if MIPS64_ABI_N64
345 default "n32" if MIPS64_ABI_N32
346 default "32" if MIPS64_ABI_O32