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
49 bool "Use host LLVM toolchain"
51 config BPF_TOOLCHAIN_BUILD_LLVM
52 bool "Build LLVM toolchain for eBPF"
54 If enabled, a LLVM toolchain for building eBPF binaries will be built.
55 If this is not enabled, eBPF packages can only be built if the host
56 has a suitable toolchain
59 config BPF_TOOLCHAIN_HOST_PATH
61 depends on BPF_TOOLCHAIN_HOST
62 prompt "Host LLVM toolchain path (prefix)" if DEVEL
63 default "/usr/local/opt/llvm" if HOST_OS_MACOS
66 menuconfig EXTERNAL_TOOLCHAIN
68 prompt "Use external toolchain" if DEVEL
70 If enabled, the buildroot will compile using an existing toolchain instead of
73 config NATIVE_TOOLCHAIN
75 prompt "Use host's toolchain" if DEVEL
76 depends on EXTERNAL_TOOLCHAIN
79 If enabled, the buildroot will compile using the native toolchain for your
80 host instead of compiling one.
84 prompt "Target name" if DEVEL
85 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
86 default "aarch64-unknown-linux-gnu" if aarch64
87 default "aarch64_be-unknown-linux-gnu" if aarch64_be
88 default "arm-unknown-linux-gnu" if arm
89 default "armeb-unknown-linux-gnu" if armeb
90 default "i486-unknown-linux-gnu" if i386
91 default "mips-unknown-linux-gnu" if mips
92 default "mipsel-unknown-linux-gnu" if mipsel
93 default "powerpc-unknown-linux-gnu" if powerpc
94 default "x86_64-unknown-linux-gnu" if x86_64
96 config TOOLCHAIN_PREFIX
98 prompt "Toolchain prefix" if DEVEL
99 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
100 default "aarch64-unknown-linux-gnu" if aarch64
101 default "aarch64_be-unknown-linux-gnu" if aarch64_be
102 default "arm-unknown-linux-gnu-" if arm
103 default "armeb-unknown-linux-gnu-" if armeb
104 default "i486-unknown-linux-gnu-" if i386
105 default "mips-unknown-linux-gnu-" if mips
106 default "mipsel-unknown-linux-gnu-" if mipsel
107 default "powerpc-unknown-linux-gnu-" if powerpc
108 default "x86_64-unknown-linux-gnu-" if x86_64
110 config TOOLCHAIN_ROOT
112 prompt "Toolchain root" if DEVEL
113 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
114 default "/opt/cross/aarch64-unknown-linux-gnu" if aarch64
115 default "/opt/cross/aarch64_be-unknown-linux-gnu" if aarch64_be
116 default "/opt/cross/arm-unknown-linux-gnu" if arm
117 default "/opt/cross/armeb-unknown-linux-gnu" if armeb
118 default "/opt/cross/i486-unknown-linux-gnu" if i386
119 default "/opt/cross/mips-unknown-linux-gnu" if mips
120 default "/opt/cross/mipsel-unknown-linux-gnu" if mipsel
121 default "/opt/cross/powerpc-unknown-linux-gnu" if powerpc
122 default "/opt/cross/x86_64-unknown-linux-gnu" if x86_64
124 choice TOOLCHAIN_LIBC_TYPE
125 prompt "Toolchain libc" if DEVEL
126 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
127 default EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
129 Specify the libc type used by the external toolchain. The given value
130 is passed as -m flag to all gcc and g++ invocations. This is mainly
131 intended for multilib toolchains which support glibc and uclibc at
132 the same time. If no value is specified, no -m flag is passed.
134 config EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
138 config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
144 config TOOLCHAIN_LIBC
146 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
147 default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
148 default "musl" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
150 config TOOLCHAIN_BIN_PATH
152 prompt "Toolchain program path" if DEVEL
153 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
154 default "./usr/bin ./bin"
156 Specify additional directories searched for toolchain binaries
157 (override PATH). Use ./DIR for directories relative to the root above.
159 config TOOLCHAIN_INC_PATH
161 prompt "Toolchain include path" if DEVEL
162 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
163 default "./usr/include ./include"
165 Specify additional directories searched for header files (override
166 CPPFLAGS). Use ./DIR for directories relative to the root above.
168 config TOOLCHAIN_LIB_PATH
170 prompt "Toolchain library path" if DEVEL
171 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
172 default "./usr/lib ./lib"
174 Specify additional directories searched for libraries (override LDFLAGS).
175 Use ./DIR for directories relative to the root above.
177 config NEED_TOOLCHAIN
180 default y if !EXTERNAL_TOOLCHAIN
182 menuconfig TOOLCHAINOPTS
183 bool "Toolchain Options" if DEVEL
184 depends on NEED_TOOLCHAIN
186 menuconfig EXTRA_TARGET_ARCH
188 prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
192 Some builds may require a 'biarch' toolchain. This option
193 allows you to specify an additional target arch.
195 Most people will answer N here.
197 config EXTRA_TARGET_ARCH_NAME
199 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
201 Specify the cpu name (eg powerpc64 or x86_64) of the
202 additional target architecture.
204 config EXTRA_TARGET_ARCH_OPTS
206 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
208 If you're specifying an addition target architecture,
209 you'll probably need to also provide options to make
210 the compiler use this alternate arch.
212 For example, if you're building a compiler that can build
213 both powerpc and powerpc64 binaries, you'll need to
218 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
219 default MIPS64_ABI_N64
221 MIPS64 supports 3 different user-land ABIs: o32 (legacy),
224 config MIPS64_ABI_N64
227 config MIPS64_ABI_N32
228 depends on !LIBC_USE_MUSL
231 config MIPS64_ABI_O32
236 comment "Binary tools"
237 depends on TOOLCHAINOPTS
239 source "toolchain/binutils/Config.in"
242 depends on TOOLCHAINOPTS
244 source "toolchain/gcc/Config.in"
248 depends on ( i386 || x86_64 )
249 prompt "Build nasm" if TOOLCHAINOPTS
252 Enable if you want to build nasm
255 depends on TOOLCHAINOPTS
258 prompt "C Library implementation" if TOOLCHAINOPTS
259 default LIBC_USE_GLIBC if arc
260 default LIBC_USE_MUSL
262 Select the C library implementation.
264 config LIBC_USE_GLIBC
275 source "toolchain/musl/Config.in"
278 depends on TOOLCHAINOPTS
282 prompt "Build gdb" if TOOLCHAINOPTS
283 default y if !EXTERNAL_TOOLCHAIN
285 Enable if you want to build the gdb.
290 prompt "Build gdb with python binding"
293 Enable the python bindings for GDB to allow using python in the gdb shell.
296 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
300 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc)
304 default y if !PKG_CC_STACKPROTECTOR_NONE
307 config USE_EXTERNAL_LIBC
309 default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
311 source "toolchain/binutils/Config.version"
312 source "toolchain/gcc/Config.version"
316 default "glibc" if USE_GLIBC
317 default "musl" if USE_MUSL
321 default "gnueabi" if USE_GLIBC && (arm || armeb)
322 default "gnu" if USE_GLIBC && !(arm || armeb)
323 default "muslgnueabi" if USE_MUSL && (arm || armeb)
324 default "musl" if USE_MUSL && !(arm || armeb)
327 depends on mips64 || mips64el
329 default "64" if MIPS64_ABI_N64
330 default "n32" if MIPS64_ABI_N32
331 default "32" if MIPS64_ABI_O32