gcc: enable LTO support unconditionally
[openwrt.git] / toolchain / Config.in
1 # Copyright (C) 2006-2013 OpenWrt.org
2 #
3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
5 #
6
7 menuconfig TARGET_OPTIONS
8         bool "Target Options"  if DEVEL
9
10         config TARGET_OPTIMIZATION
11                 string "Target Optimizations" if TARGET_OPTIONS
12                 default DEFAULT_TARGET_OPTIMIZATION
13                 help
14                   Optimizations to use when building for the target host.
15
16         config SOFT_FLOAT
17                 bool "Use software floating point by default" if TARGET_OPTIONS
18                 default y if !HAS_FPU
19                 depends on arm || armeb || powerpc || mipsel || mips || mips64el || mips64
20                 help
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).
25
26                   Most people will answer N.
27
28         config USE_MIPS16
29                 bool "Build packages with MIPS16 instructions" if TARGET_OPTIONS
30                 depends on HAS_MIPS16
31                 depends on !GCC_VERSION_4_6
32                 default y
33                 help
34                   If your target CPU does support the MIPS16 instruction set
35                   and you want to use it for packages, enable this option.
36                   MIPS16 produces smaller binaries thus reducing pressure on
37                   caches and TLB.
38
39                   Most people will answer N.
40
41
42 menuconfig EXTERNAL_TOOLCHAIN
43         bool
44         prompt "Use external toolchain"  if DEVEL
45         help
46           If enabled, OpenWrt will compile using an existing toolchain instead of
47           compiling one.
48
49         config NATIVE_TOOLCHAIN
50                 bool
51                 prompt "Use host's toolchain"  if DEVEL
52                 depends on EXTERNAL_TOOLCHAIN
53                 select NO_STRIP
54                 help
55                   If enabled, OpenWrt will compile using the native toolchain for your
56                   host instead of compiling one.
57
58         config TARGET_NAME
59                 string
60                 prompt "Target name"  if DEVEL
61                 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
62                 default "aarch64-unknown-linux-gnu"  if aarch64
63                 default "aarch64_be-unknown-linux-gnu"  if aarch64_be
64                 default "arm-unknown-linux-gnu"      if arm
65                 default "armeb-unknown-linux-gnu"    if armeb
66                 default "i486-unknown-linux-gnu"     if i386
67                 default "mips-unknown-linux-gnu"     if mips
68                 default "mipsel-unknown-linux-gnu"   if mipsel
69                 default "powerpc-unknown-linux-gnu"  if powerpc
70                 default "x86_64-unknown-linux-gnu"   if x86_64
71
72         config TOOLCHAIN_PREFIX
73                 string
74                 prompt "Toolchain prefix"  if DEVEL
75                 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
76                 default "aarch64-unknown-linux-gnu"  if aarch64
77                 default "aarch64_be-unknown-linux-gnu"  if aarch64_be
78                 default "arm-unknown-linux-gnu-"      if arm
79                 default "armeb-unknown-linux-gnu-"    if armeb
80                 default "i486-unknown-linux-gnu-"     if i386
81                 default "mips-unknown-linux-gnu-"     if mips
82                 default "mipsel-unknown-linux-gnu-"   if mipsel
83                 default "powerpc-unknown-linux-gnu-"  if powerpc
84                 default "x86_64-unknown-linux-gnu-"   if x86_64
85
86         config TOOLCHAIN_ROOT
87                 string
88                 prompt "Toolchain root"  if DEVEL
89                 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
90                 default "/opt/cross/aarch64-unknown-linux-gnu"  if aarch64
91                 default "/opt/cross/aarch64_be-unknown-linux-gnu"  if aarch64_be
92                 default "/opt/cross/arm-unknown-linux-gnu"      if arm
93                 default "/opt/cross/armeb-unknown-linux-gnu"    if armeb
94                 default "/opt/cross/i486-unknown-linux-gnu"     if i386
95                 default "/opt/cross/mips-unknown-linux-gnu"     if mips
96                 default "/opt/cross/mipsel-unknown-linux-gnu"   if mipsel
97                 default "/opt/cross/powerpc-unknown-linux-gnu"  if powerpc
98                 default "/opt/cross/x86_64-unknown-linux-gnu"   if x86_64
99
100         config TOOLCHAIN_LIBC
101                 string
102                 prompt "Toolchain libc"  if DEVEL
103                 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
104                 default "uclibc"
105                 help
106                   Specify the libc type used by the external toolchain. The given value
107                   is passed as -m flag to all gcc and g++ invocations. This is mainly
108                   intended for multilib toolchains which support glibc and uclibc at
109                   the same time. If no value is specified, no -m flag is passed.
110
111         config TOOLCHAIN_BIN_PATH
112                 string
113                 prompt "Toolchain program path"  if DEVEL
114                 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
115                 default "./usr/bin ./bin"
116                 help
117                   Specify additional directories searched for toolchain binaries
118                   (override PATH). Use ./DIR for directories relative to the root above.
119
120         config TOOLCHAIN_INC_PATH
121                 string
122                 prompt "Toolchain include path"  if DEVEL
123                 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
124                 default "./usr/include ./include"
125                 help
126                   Specify additional directories searched for header files (override
127                   CPPFLAGS). Use ./DIR for directories relative to the root above.
128
129         config TOOLCHAIN_LIB_PATH
130                 string
131                 prompt "Toolchain library path"  if DEVEL
132                 depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN
133                 default "./usr/lib ./lib"
134                 help
135                   Specify additional directories searched for libraries (override LDFLAGS).
136                   Use ./DIR for directories relative to the root above.
137
138 config NEED_TOOLCHAIN
139         bool
140         depends on DEVEL
141         default y if !EXTERNAL_TOOLCHAIN
142
143 menuconfig TOOLCHAINOPTS
144         bool "Toolchain Options"  if DEVEL
145         depends on NEED_TOOLCHAIN
146
147 menuconfig EXTRA_TARGET_ARCH
148         bool
149         prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
150         depends on !sparc
151         default y       if powerpc64
152         default n
153         help
154           Some builds may require a 'biarch' toolchain. This option
155           allows you to specify an additional target arch.
156
157           Most people will answer N here.
158
159         config EXTRA_TARGET_ARCH_NAME
160                 string
161                 default "powerpc64"     if powerpc64
162                 prompt "Extra architecture name" if EXTRA_TARGET_ARCH
163                 help
164                   Specify the cpu name (eg powerpc64 or x86_64) of the
165                   additional target architecture.
166
167         config EXTRA_TARGET_ARCH_OPTS
168                 string
169                 default "-m64"          if powerpc64
170                 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH
171                 help
172                   If you're specifying an addition target architecture,
173                   you'll probably need to also provide options to make
174                   the compiler use this alternate arch.
175
176                   For example, if you're building a compiler that can build
177                   both powerpc and powerpc64 binaries, you'll need to
178                   specify -m64 here.
179
180
181         choice
182                 prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el)
183                 default MIPS64_ABI_N64
184                 help
185                    MIPS64 supports 3 different user-land ABIs: o32 (legacy),
186                    n32 and n64.
187
188                 config MIPS64_ABI_N64
189                         bool "n64"
190
191                 config MIPS64_ABI_N32
192                         bool "n32"
193
194                 config MIPS64_ABI_O32
195                         bool "o32"
196
197         endchoice
198
199 comment "Binary tools"
200         depends on TOOLCHAINOPTS
201
202 source "toolchain/binutils/Config.in"
203
204 comment "Compiler"
205         depends on TOOLCHAINOPTS
206
207 source "toolchain/gcc/Config.in"
208
209 comment "C Library"
210         depends on TOOLCHAINOPTS
211
212 choice
213         prompt "C Library implementation" if TOOLCHAINOPTS
214         default LIBC_USE_GLIBC if mips64 || mips64el
215         default LIBC_USE_UCLIBC if arc
216         default LIBC_USE_MUSL
217         help
218           Select the C library implementation.
219
220         config LIBC_USE_GLIBC
221                 bool "Use (e)glibc"
222                 select USE_GLIBC
223                 depends on !arc
224
225         config LIBC_USE_UCLIBC
226                 select USE_UCLIBC
227                 bool "Use uClibc"
228                 depends on !(aarch64 || aarch64_be)
229                 depends on BROKEN || !(arm || armeb || i386 || x86_64 || mips || mipsel || mips64 || mips64el || powerpc)
230
231         config LIBC_USE_MUSL
232                 select USE_MUSL
233                 bool "Use musl"
234                 depends on !(arc || mips64 || mips64el)
235
236 endchoice
237
238 source "toolchain/glibc/Config.in"
239 source "toolchain/uClibc/Config.in"
240 source "toolchain/musl/Config.in"
241
242 comment "Debuggers"
243         depends on TOOLCHAINOPTS
244
245 config GDB
246         bool
247         depends on !(aarch64 || aarch64_be)
248         prompt "Build gdb" if TOOLCHAINOPTS
249         default y if !EXTERNAL_TOOLCHAIN
250         help
251           Enable if you want to build the gdb.
252
253 config INSIGHT
254         bool
255         prompt "Build insight-gdb" if TOOLCHAINOPTS
256         select GDB
257         default n
258         help
259           Enable if you want to build insight-gdb.
260
261 config USE_GLIBC
262         bool
263
264 config USE_UCLIBC
265         default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc || mips64 || mips64el)
266         bool
267
268 config USE_MUSL
269         default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc || mips64 || mips64el)
270         bool
271
272 config USE_EXTERNAL_LIBC
273         bool
274         default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN
275
276 source "toolchain/binutils/Config.version"
277 source "toolchain/gcc/Config.version"
278
279 source "toolchain/glibc/Config.version"
280 source "toolchain/uClibc/Config.version"
281 source "toolchain/musl/Config.version"
282
283 config LIBC
284         string
285         default "glibc"   if USE_GLIBC
286         default "uClibc"  if USE_UCLIBC
287         default "musl"    if USE_MUSL
288
289 config LIBC_VERSION
290         string
291         default GLIBC_VERSION   if USE_GLIBC
292         default UCLIBC_VERSION  if USE_UCLIBC
293         default MUSL_VERSION    if USE_MUSL
294
295 config TARGET_SUFFIX
296         string
297         default "gnueabi"         if USE_GLIBC && (arm || armeb)
298         default "gnu"             if USE_GLIBC && !(arm || armeb)
299         default "uclibcgnueabi"   if USE_UCLIBC && (arm || armeb)
300         default "uclibc"          if USE_UCLIBC && !(arm || armeb)
301         default "muslgnueabi"     if USE_MUSL && (arm || armeb)
302         default "musl"            if USE_MUSL && !(arm || armeb)
303
304 config MIPS64_ABI
305         depends on mips64 || mips64el
306         string
307         default "64" if MIPS64_ABI_N64
308         default "n32" if MIPS64_ABI_N32
309         default "32" if MIPS64_ABI_O32
310         default "64"