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.
41 bool "Build LLVM toolchain for eBPF" if DEVEL
43 If enabled, a LLVM toolchain for building eBPF binaries will be built.
44 If this is not enabled, eBPF packages can only be built if the host
45 has a suitable toolchain
48 menuconfig EXTERNAL_TOOLCHAIN
50 prompt "Use external toolchain" if DEVEL
52 If enabled, the buildroot will compile using an existing toolchain instead of
55 config NATIVE_TOOLCHAIN
57 prompt "Use host's toolchain" if DEVEL
58 depends on EXTERNAL_TOOLCHAIN
61 If enabled, the buildroot will compile using the native toolchain for your
62 host instead of compiling one.
66 prompt "Target name" if DEVEL
67 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
68 default "aarch64-unknown-linux-gnu" if aarch64
69 default "aarch64_be-unknown-linux-gnu" if aarch64_be
70 default "arm-unknown-linux-gnu" if arm
71 default "armeb-unknown-linux-gnu" if armeb
72 default "i486-unknown-linux-gnu" if i386
73 default "mips-unknown-linux-gnu" if mips
74 default "mipsel-unknown-linux-gnu" if mipsel
75 default "powerpc-unknown-linux-gnu" if powerpc
76 default "x86_64-unknown-linux-gnu" if x86_64
78 config TOOLCHAIN_PREFIX
80 prompt "Toolchain prefix" if DEVEL
81 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
82 default "aarch64-unknown-linux-gnu" if aarch64
83 default "aarch64_be-unknown-linux-gnu" if aarch64_be
84 default "arm-unknown-linux-gnu-" if arm
85 default "armeb-unknown-linux-gnu-" if armeb
86 default "i486-unknown-linux-gnu-" if i386
87 default "mips-unknown-linux-gnu-" if mips
88 default "mipsel-unknown-linux-gnu-" if mipsel
89 default "powerpc-unknown-linux-gnu-" if powerpc
90 default "x86_64-unknown-linux-gnu-" if x86_64
94 prompt "Toolchain root" if DEVEL
95 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
96 default "/opt/cross/aarch64-unknown-linux-gnu" if aarch64
97 default "/opt/cross/aarch64_be-unknown-linux-gnu" if aarch64_be
98 default "/opt/cross/arm-unknown-linux-gnu" if arm
99 default "/opt/cross/armeb-unknown-linux-gnu" if armeb
100 default "/opt/cross/i486-unknown-linux-gnu" if i386
101 default "/opt/cross/mips-unknown-linux-gnu" if mips
102 default "/opt/cross/mipsel-unknown-linux-gnu" if mipsel
103 default "/opt/cross/powerpc-unknown-linux-gnu" if powerpc
104 default "/opt/cross/x86_64-unknown-linux-gnu" if x86_64
106 choice TOOLCHAIN_LIBC_TYPE
107 prompt "Toolchain libc" if DEVEL
108 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
109 default EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
111 Specify the libc type used by the external toolchain. The given value
112 is passed as -m flag to all gcc and g++ invocations. This is mainly
113 intended for multilib toolchains which support glibc and uclibc at
114 the same time. If no value is specified, no -m flag is passed.
116 config EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
120 config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
126 config TOOLCHAIN_LIBC
128 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
129 default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC
130 default "musl" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL
132 config TOOLCHAIN_BIN_PATH
134 prompt "Toolchain program path" if DEVEL
135 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
136 default "./usr/bin ./bin"
138 Specify additional directories searched for toolchain binaries
139 (override PATH). Use ./DIR for directories relative to the root above.
141 config TOOLCHAIN_INC_PATH
143 prompt "Toolchain include path" if DEVEL
144 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
145 default "./usr/include ./include"
147 Specify additional directories searched for header files (override
148 CPPFLAGS). Use ./DIR for directories relative to the root above.
150 config TOOLCHAIN_LIB_PATH
152 prompt "Toolchain library path" if DEVEL
153 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
154 default "./usr/lib ./lib"
156 Specify additional directories searched for libraries (override LDFLAGS).
157 Use ./DIR for directories relative to the root above.
159 config NEED_TOOLCHAIN
162 default y if !EXTERNAL_TOOLCHAIN
164 menuconfig TOOLCHAINOPTS
165 bool "Toolchain Options" if DEVEL
166 depends on NEED_TOOLCHAIN
168 menuconfig EXTRA_TARGET_ARCH
170 prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
174 Some builds may require a 'biarch' toolchain. This option
175 allows you to specify an additional target arch.
177 Most people will answer N here.
179 config EXTRA_TARGET_ARCH_NAME
181 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
183 Specify the cpu name (eg powerpc64 or x86_64) of the
184 additional target architecture.
186 config EXTRA_TARGET_ARCH_OPTS
188 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
190 If you're specifying an addition target architecture,
191 you'll probably need to also provide options to make
192 the compiler use this alternate arch.
194 For example, if you're building a compiler that can build
195 both powerpc and powerpc64 binaries, you'll need to
200 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
201 default MIPS64_ABI_N64
203 MIPS64 supports 3 different user-land ABIs: o32 (legacy),
206 config MIPS64_ABI_N64
209 config MIPS64_ABI_N32
210 depends on !LIBC_USE_MUSL
213 config MIPS64_ABI_O32
218 comment "Binary tools"
219 depends on TOOLCHAINOPTS
221 source "toolchain/binutils/Config.in"
224 depends on TOOLCHAINOPTS
226 source "toolchain/gcc/Config.in"
230 depends on ( i386 || x86_64 )
231 prompt "Build nasm" if TOOLCHAINOPTS
234 Enable if you want to build nasm
237 depends on TOOLCHAINOPTS
240 prompt "C Library implementation" if TOOLCHAINOPTS
241 default LIBC_USE_GLIBC if arc
242 default LIBC_USE_MUSL
244 Select the C library implementation.
246 config LIBC_USE_GLIBC
257 source "toolchain/musl/Config.in"
260 depends on TOOLCHAINOPTS
264 prompt "Build gdb" if TOOLCHAINOPTS
265 default y if !EXTERNAL_TOOLCHAIN
267 Enable if you want to build the gdb.
272 prompt "Build gdb with python binding"
275 Enable the python bindings for GDB to allow using python in the gdb shell.
278 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
282 default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc)
286 default y if !PKG_CC_STACKPROTECTOR_NONE
289 config USE_EXTERNAL_LIBC
291 default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
293 source "toolchain/binutils/Config.version"
294 source "toolchain/gcc/Config.version"
298 default "glibc" if USE_GLIBC
299 default "musl" if USE_MUSL
303 default "gnueabi" if USE_GLIBC && (arm || armeb)
304 default "gnu" if USE_GLIBC && !(arm || armeb)
305 default "muslgnueabi" if USE_MUSL && (arm || armeb)
306 default "musl" if USE_MUSL && !(arm || armeb)
309 depends on mips64 || mips64el
311 default "64" if MIPS64_ABI_N64
312 default "n32" if MIPS64_ABI_N32
313 default "32" if MIPS64_ABI_O32