blob: df43db7eff1340836c7e3dc7910c3958fd0041e4 [file] [log] [blame]
Eric Andersen2d523c22004-10-09 01:06:03 +00001#
2
Peter Korsgaard6a53b722011-02-02 14:53:23 +01003mainmenu "Buildroot $BR2_VERSION Configuration"
Eric Andersen2d523c22004-10-09 01:06:03 +00004
5config BR2_HAVE_DOT_CONFIG
6 bool
7 default y
8
Bernhard Reutner-Fischerf5b8cd42007-09-25 11:37:31 +00009config BR2_VERSION
10 string
Yann E. MORIN56c68bc2010-10-31 17:35:14 +010011 option env="BR2_VERSION_FULL"
Bernhard Reutner-Fischerf5b8cd42007-09-25 11:37:31 +000012
Francois Perrad1d4104f2012-07-18 15:59:09 +020013config BR2_HOSTARCH
14 string
15 option env="HOSTARCH"
16
Yann E. MORIN54af0552019-07-29 22:19:53 +020017config BR2_BASE_DIR
Yann E. MORIN4802db32016-07-17 12:34:26 +020018 string
Yann E. MORIN54af0552019-07-29 22:19:53 +020019 option env="BASE_DIR"
Yann E. MORIN4802db32016-07-17 12:34:26 +020020
Yann E. MORINedf32b02019-07-29 22:19:59 +020021# br2-external paths definitions
22source "$BR2_BASE_DIR/.br2-external.in.paths"
23
Arnout Vandecappelle12825f72015-12-31 01:34:13 +010024# Hidden config symbols for packages to check system gcc version
25config BR2_HOST_GCC_VERSION
26 string
27 option env="HOST_GCC_VERSION"
28
Arnout Vandecappelle12825f72015-12-31 01:34:13 +010029config BR2_HOST_GCC_AT_LEAST_4_9
30 bool
31 default y if BR2_HOST_GCC_VERSION = "4 9"
Arnout Vandecappelle12825f72015-12-31 01:34:13 +010032
33config BR2_HOST_GCC_AT_LEAST_5
34 bool
35 default y if BR2_HOST_GCC_VERSION = "5"
36 select BR2_HOST_GCC_AT_LEAST_4_9
37
Martin Bark3d217572016-06-06 11:18:14 +010038config BR2_HOST_GCC_AT_LEAST_6
39 bool
40 default y if BR2_HOST_GCC_VERSION = "6"
41 select BR2_HOST_GCC_AT_LEAST_5
42
Adrián Pérez de Castro435b4cc2017-07-05 16:06:33 +030043config BR2_HOST_GCC_AT_LEAST_7
44 bool
45 default y if BR2_HOST_GCC_VERSION = "7"
46 select BR2_HOST_GCC_AT_LEAST_6
47
Stefan Beckere13ab2e2018-05-02 13:09:04 +030048config BR2_HOST_GCC_AT_LEAST_8
49 bool
50 default y if BR2_HOST_GCC_VERSION = "8"
51 select BR2_HOST_GCC_AT_LEAST_7
52
Romain Naour17761902020-02-25 22:22:13 +010053config BR2_HOST_GCC_AT_LEAST_9
54 bool
55 default y if BR2_HOST_GCC_VERSION = "9"
56 select BR2_HOST_GCC_AT_LEAST_8
57
Adam Duskettda889332023-11-02 18:06:49 -060058config BR2_HOST_GCC_AT_LEAST_10
59 bool
60 default y if BR2_HOST_GCC_VERSION = "10"
61 select BR2_HOST_GCC_AT_LEAST_9
62
63config BR2_HOST_GCC_AT_LEAST_11
64 bool
65 default y if BR2_HOST_GCC_VERSION = "11"
66 select BR2_HOST_GCC_AT_LEAST_10
67
Yann E. MORIN3950e692018-10-23 11:08:40 +020068# When adding new entries above, be sure to update
69# the HOSTCC_MAX_VERSION variable in the Makefile.
70
Maxime Hadjinlianaac3d2b2014-02-18 00:37:12 +010071# Hidden boolean selected by packages in need of Java in order to build
Bernd Kuhls4f3fdf12017-10-01 21:04:30 +020072# (example: kodi)
Maxime Hadjinlian0721c712014-02-19 16:33:50 +010073config BR2_NEEDS_HOST_JAVA
Maxime Hadjinlianaac3d2b2014-02-18 00:37:12 +010074 bool
75
Thomas Petazzoni70d60372012-12-29 06:14:49 +000076# Hidden boolean selected by pre-built packages for x86, when they
77# need to run on x86-64 machines (example: pre-built external
Lang Daniel71b5ea42023-03-15 16:21:11 +000078# toolchains, binary tools, etc.).
Thomas Petazzoni70d60372012-12-29 06:14:49 +000079config BR2_HOSTARCH_NEEDS_IA32_LIBS
80 bool
81
Thomas Petazzoni0e4bc502013-11-11 17:47:25 +010082# Hidden boolean selected by packages that need to build 32 bits
83# binaries with the host compiler, even on 64 bits build machines (e.g
84# bootloaders).
85config BR2_HOSTARCH_NEEDS_IA32_COMPILER
86 bool
87
Yann E. MORINde0df992016-12-04 10:43:04 +010088# Hidden boolean selected by packages that need the host to have an
89# UTF8 locale.
90config BR2_NEEDS_HOST_UTF8_LOCALE
91 bool
92
Kamel Bouharae068f332020-07-06 17:30:35 +020093# Hidden boolean selected by packages that need the host to have
94# support for building gcc plugins
95config BR2_NEEDS_HOST_GCC_PLUGIN_SUPPORT
96 bool
97
Thomas Petazzoni79ee3c12012-11-03 08:27:59 +000098source "arch/Config.in"
Bernhard Reutner-Fischer7d8a59b2007-07-08 16:28:54 +000099
Arnout Vandecappelle (Essensium/Mind)5e050a82021-10-06 22:41:33 +0200100source "toolchain/Config.in"
101
Eric Andersen8e5fb3f2004-12-11 13:01:10 +0000102menu "Build options"
103
Thomas Petazzoni15929262010-04-10 22:55:01 +0200104menu "Commands"
105
Yann E. MORINafece242024-06-02 20:23:07 +0200106config BR2_CURL
107 string "Curl command"
108 default "curl -q --ftp-pasv --retry 3"
109
Eric Andersen2d523c22004-10-09 01:06:03 +0000110config BR2_WGET
Eric Andersen8e5fb3f2004-12-11 13:01:10 +0000111 string "Wget command"
Peter Korsgaard1a61c1d2024-06-03 09:28:28 +0200112 default "wget -nd -t 3"
Eric Andersen2d523c22004-10-09 01:06:03 +0000113
Maxime Petazzonicf711112010-09-02 12:09:45 +0200114config BR2_SVN
115 string "Subversion (svn) command"
Sam Vossad477b02017-11-17 12:50:34 -0600116 default "svn --non-interactive"
Eric Andersene30cf262005-01-23 11:20:30 +0000117
Maxime Petazzonicf711112010-09-02 12:09:45 +0200118config BR2_BZR
119 string "Bazaar (bzr) command"
120 default "bzr"
Sven Neumanndf03cda2009-08-07 11:57:54 +0200121
Ulf Samuelsson85f54fb2007-08-24 05:31:07 +0000122config BR2_GIT
Maxime Petazzonicf711112010-09-02 12:09:45 +0200123 string "Git command"
124 default "git"
Ulf Samuelsson85f54fb2007-08-24 05:31:07 +0000125
Gustavo Zacarias15eb1fa2013-09-11 09:12:04 -0300126config BR2_CVS
127 string "CVS command"
128 default "cvs"
129
David Wagner2690e762011-09-29 21:57:46 +0200130config BR2_LOCALFILES
131 string "Local files retrieval command"
132 default "cp"
133
Thomas De Schampheleirec61788f2011-10-19 09:25:40 +0200134config BR2_SCP
135 string "Secure copy (scp) command"
136 default "scp"
137
Thomas Preston16f660f2020-04-15 17:48:45 +0100138config BR2_SFTP
139 string "Secure file transfer (sftp) command"
140 default "sftp"
141
Thomas De Schampheleiref694c072011-10-19 09:25:47 +0200142config BR2_HG
143 string "Mercurial (hg) command"
144 default "hg"
145
Bernhard Reutner-Fischer859b9132006-10-01 15:07:45 +0000146config BR2_ZCAT
147 string "zcat command"
Bernhard Reutner-Fischera9612bf2007-03-09 08:26:10 +0000148 default "gzip -d -c"
Bernhard Reutner-Fischer859b9132006-10-01 15:07:45 +0000149 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700150 Command to be used to extract a gzip'ed file to stdout. zcat
151 is identical to gunzip -c except that the former may not be
152 available on your system.
Bernhard Reutner-Fischera9612bf2007-03-09 08:26:10 +0000153 Default is "gzip -d -c"
154 Other possible values include "gunzip -c" or "zcat".
Bernhard Reutner-Fischer6e2823c2006-11-17 15:43:51 +0000155
156config BR2_BZCAT
157 string "bzcat command"
158 default "bzcat"
159 help
160 Command to be used to extract a bzip2'ed file to stdout.
161 bzcat is identical to bunzip2 -c except that the former may
162 not be available on your system.
163 Default is "bzcat"
164 Other possible values include "bunzip2 -c" or "bzip2 -d -c".
Bernhard Reutner-Fischer859b9132006-10-01 15:07:45 +0000165
Allan W. Nielsen177b4b42011-05-10 08:17:05 +0200166config BR2_XZCAT
167 string "xzcat command"
168 default "xzcat"
169 help
170 Command to be used to extract a xz'ed file to stdout.
171 Default is "xzcat"
172
Baruch Siachf1650322017-02-12 22:15:39 +0200173config BR2_LZCAT
174 string "lzcat command"
175 default "lzip -d -c"
176 help
177 Command to be used to extract a lzip'ed file to stdout.
178 Default is "lzip -d -c"
179
Matt Staveley-Taylor7d0707c2024-04-08 02:38:44 +0100180config BR2_ZSTDCAT
181 string "zstdcat command"
182 default "zstdcat"
183 help
184 Command to be used to extract a zstd'ed file to stdout.
185 Default is "zstdcat"
186
Bernhard Reutner-Fischerce90aae2005-12-10 14:59:02 +0000187config BR2_TAR_OPTIONS
188 string "Tar options"
Bernhard Reutner-Fischer7df4de62005-12-10 15:36:43 +0000189 default ""
190 help
191 Options to pass to tar when extracting the sources.
Ricardo Martincoskid6109172018-04-01 02:08:39 -0300192 E.g. " -v --exclude='*.svn*'" to exclude all .svn internal
193 files and to be verbose.
Bernhard Reutner-Fischerce90aae2005-12-10 14:59:02 +0000194
Thomas Petazzoni15929262010-04-10 22:55:01 +0200195endmenu
196
Arnout Vandecappelle (Essensium/Mind)4e0170d2013-02-06 21:50:57 +0000197config BR2_DEFCONFIG_FROM_ENV
198 string
199 option env="BR2_DEFCONFIG"
200
201config BR2_DEFCONFIG
202 string "Location to save buildroot config"
203 default BR2_DEFCONFIG_FROM_ENV if BR2_DEFCONFIG_FROM_ENV != ""
204 default "$(CONFIG_DIR)/defconfig"
205 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700206 When running 'make savedefconfig', the defconfig file will be
207 saved in this location.
Arnout Vandecappelle (Essensium/Mind)4e0170d2013-02-06 21:50:57 +0000208
Mike Frysinger59a63a92005-10-01 00:35:24 +0000209config BR2_DL_DIR
210 string "Download dir"
H Hartley Sweetenbe695dc2009-09-23 08:46:52 +0200211 default "$(TOPDIR)/dl"
Mike Frysinger59a63a92005-10-01 00:35:24 +0000212 help
213 Directory to store all the source files that we need to fetch.
Arnout Vandecappelle67680212014-02-04 16:18:51 +0100214 If the Linux shell environment has defined the BR2_DL_DIR
Martin Kelly65f9b932016-05-31 09:57:22 -0700215 environment variable, then this overrides this configuration
216 item.
Thomas Petazzoni7e58fdc2018-04-17 14:54:45 +0200217 The directory is organized with a subdirectory for each
218 package. Each package has its own $(LIBFOO_DL_DIR) variable
219 that can be used to find the correct path.
Mike Frysinger59a63a92005-10-01 00:35:24 +0000220
H Hartley Sweetenbe695dc2009-09-23 08:46:52 +0200221 The default is $(TOPDIR)/dl
Bernhard Reutner-Fischer4b0d5a82007-09-26 21:12:38 +0000222
Gustavo Zacariasa2b4f7f2011-02-02 10:05:56 -0300223config BR2_HOST_DIR
224 string "Host dir"
225 default "$(BASE_DIR)/host"
226 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700227 Directory to store all the binary files that are built for the
228 host. This includes the cross compilation toolchain when
229 building the internal buildroot toolchain.
Gustavo Zacariasa2b4f7f2011-02-02 10:05:56 -0300230
231 The default is $(BASE_DIR)/host
232
Thomas Petazzoni80080072010-12-05 21:52:37 +0100233menu "Mirrors and Download locations"
234
235config BR2_PRIMARY_SITE
236 string "Primary download site"
237 default ""
238 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700239 Primary site to download from. If this option is set then
240 buildroot will try to download package source first from this
241 site and try the default if the file is not found.
Jérôme Pouiller4a9d9802015-11-18 10:03:25 +0100242 Valid URIs are:
243 - URIs recognized by $(WGET)
244 - local URIs of the form file://absolutepath
245 - scp URIs of the form scp://[user@]host:path.
Thomas Petazzoni80080072010-12-05 21:52:37 +0100246
Thomas De Schampheleire5a83e082012-06-22 07:37:03 +0200247config BR2_PRIMARY_SITE_ONLY
248 bool "Only allow downloads from primary download site"
249 depends on BR2_PRIMARY_SITE != ""
250 help
251 If this option is enabled, downloads will only be attempted
252 from the primary download site. Other locations, like the
253 package's official download location or the backup download
Martin Kelly65f9b932016-05-31 09:57:22 -0700254 site, will not be considered. Therefore, if the package is not
255 present on the primary site, the download fails.
Thomas De Schampheleire5a83e082012-06-22 07:37:03 +0200256
Martin Kelly65f9b932016-05-31 09:57:22 -0700257 This is useful for project developers who want to ensure that
258 the project can be built even if the upstream tarball
Thomas De Schampheleire5a83e082012-06-22 07:37:03 +0200259 locations disappear.
260
261if !BR2_PRIMARY_SITE_ONLY
262
Thomas Petazzoni80080072010-12-05 21:52:37 +0100263config BR2_BACKUP_SITE
264 string "Backup download site"
Peter Korsgaard05296ce2023-10-27 14:12:51 +0200265 default "https://sources.buildroot.net"
Thomas Petazzoni80080072010-12-05 21:52:37 +0100266 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700267 Backup site to download from. If this option is set then
268 buildroot will fall back to download package sources from here
269 if the normal location fails.
Thomas Petazzoni80080072010-12-05 21:52:37 +0100270
Thomas Petazzoni80080072010-12-05 21:52:37 +0100271config BR2_KERNEL_MIRROR
272 string "Kernel.org mirror"
Alexey Brodkinde76cb72016-05-23 18:36:53 +0300273 default "https://cdn.kernel.org/pub"
Thomas Petazzoni80080072010-12-05 21:52:37 +0100274 help
Alexey Brodkinde76cb72016-05-23 18:36:53 +0300275 kernel.org is mirrored on a number of servers around the
Martin Kelly65f9b932016-05-31 09:57:22 -0700276 world. The following allows you to select your preferred
Alexey Brodkinde76cb72016-05-23 18:36:53 +0300277 mirror. By default, a CDN is used, which automatically
278 redirects to a mirror geographically close to you.
Thomas Petazzoni80080072010-12-05 21:52:37 +0100279
Martin Kelly65f9b932016-05-31 09:57:22 -0700280 Have a look on the kernel.org site for a list of mirrors, then
281 enter the URL to the base directory. Examples:
Thomas Petazzoni80080072010-12-05 21:52:37 +0100282
283 http://www.XX.kernel.org/pub (XX = country code)
284 http://mirror.aarnet.edu.au/pub/ftp.kernel.org
285
286config BR2_GNU_MIRROR
287 string "GNU Software mirror"
Thomas Petazzoni3999f0a2016-05-24 20:48:26 +0200288 default "http://ftpmirror.gnu.org"
Thomas Petazzoni80080072010-12-05 21:52:37 +0100289 help
Thomas Petazzoni3999f0a2016-05-24 20:48:26 +0200290 GNU has multiple software mirrors scattered around the
Martin Kelly65f9b932016-05-31 09:57:22 -0700291 world. The following allows you to select your preferred
Thomas Petazzoni3999f0a2016-05-24 20:48:26 +0200292 mirror. By default, a generic address is used, which
293 automatically selects an up-to-date and local mirror.
Thomas Petazzoni80080072010-12-05 21:52:37 +0100294
Martin Kelly65f9b932016-05-31 09:57:22 -0700295 Have a look on the gnu.org site for a list of mirrors, then
296 enter the URL to the base directory. Examples:
Thomas Petazzoni80080072010-12-05 21:52:37 +0100297
298 http://ftp.gnu.org/pub/gnu
299 http://mirror.aarnet.edu.au/pub/gnu
300
Francois Perrad72afb292014-01-11 16:42:07 +0100301config BR2_LUAROCKS_MIRROR
302 string "LuaRocks mirror"
Francois Perrad0b8411a2014-07-25 20:21:24 +0200303 default "http://rocks.moonscript.org"
Francois Perrad72afb292014-01-11 16:42:07 +0100304 help
305 LuaRocks repository.
306
307 See http://luarocks.org
308
Francois Perrad9fbb1692014-02-23 15:17:16 +0100309config BR2_CPAN_MIRROR
310 string "CPAN mirror (Perl packages)"
Peter Seidereradd21fd2022-12-20 19:03:06 +0100311 default "https://cpan.metacpan.org"
Francois Perrad9fbb1692014-02-23 15:17:16 +0100312 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700313 CPAN (Comprehensive Perl Archive Network) is a repository of
314 Perl packages. It has multiple software mirrors scattered
Francois Perrad9fbb1692014-02-23 15:17:16 +0100315 around the world. This option allows you to select a mirror.
316
317 The list of mirrors is available at:
Peter Seidereradd21fd2022-12-20 19:03:06 +0100318 http://mirrors.cpan.org/ (tabular)
319 http://mirrors.cpan.org/map.html (clickable world map)
Francois Perrad9fbb1692014-02-23 15:17:16 +0100320
Yann E. MORIN3318a5a2015-07-14 09:42:40 +0200321endif
322
Thomas Petazzoni80080072010-12-05 21:52:37 +0100323endmenu
Thomas Petazzoniaa41d372010-04-10 22:55:38 +0200324
Eric Andersen8e5fb3f2004-12-11 13:01:10 +0000325config BR2_JLEVEL
Nathan Lynch5016aa02012-06-16 09:37:17 +0000326 int "Number of jobs to run simultaneously (0 for auto)"
327 default "0"
Eric Andersen8e5fb3f2004-12-11 13:01:10 +0000328 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700329 Number of jobs to run simultaneously. If 0, determine
330 automatically according to number of CPUs on the host system.
Bernhard Reutner-Fischer93ab6d32007-01-28 12:03:58 +0000331
Brandon Maier3c8cc1d2024-03-08 18:26:37 +0000332comment "ccache needs a host gcc >= 8"
333 depends on !BR2_HOST_GCC_AT_LEAST_8
334
Thomas Petazzoni17b66af2010-12-07 21:09:56 +0100335config BR2_CCACHE
336 bool "Enable compiler cache"
Brandon Maier3c8cc1d2024-03-08 18:26:37 +0000337 depends on BR2_HOST_GCC_AT_LEAST_8
Thomas Petazzoni17b66af2010-12-07 21:09:56 +0100338 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700339 This option will enable the use of ccache, a compiler cache.
340 It will cache the result of previous builds to speed up future
341 builds. By default, the cache is stored in
Thomas Petazzoni17b66af2010-12-07 21:09:56 +0100342 $HOME/.buildroot-ccache.
343
Thomas Petazzonif044e032012-03-07 20:26:50 +0100344 Note that Buildroot does not try to invalidate the cache
Martin Kelly65f9b932016-05-31 09:57:22 -0700345 contents when the compiler changes in an incompatible way.
346 Therefore, if you make a change to the compiler version and/or
347 configuration, you are responsible for purging the ccache
348 cache by removing the $HOME/.buildroot-ccache directory.
Thomas Petazzonif044e032012-03-07 20:26:50 +0100349
Danomi Manchegodd79f2d2014-04-30 22:05:07 -0400350if BR2_CCACHE
351
Thomas De Schampheleire43329072012-05-16 21:39:28 +0200352config BR2_CCACHE_DIR
353 string "Compiler cache location"
Thomas De Schampheleire43329072012-05-16 21:39:28 +0200354 default "$(HOME)/.buildroot-ccache"
355 help
356 Where ccache should store cached files.
Trent Piephoad980cc2018-03-15 14:47:33 -0700357 If the Linux shell environment has defined the BR2_CCACHE_DIR
358 environment variable, then this overrides this configuration
359 item.
Thomas De Schampheleire43329072012-05-16 21:39:28 +0200360
Danomi Manchegodd79f2d2014-04-30 22:05:07 -0400361config BR2_CCACHE_INITIAL_SETUP
362 string "Compiler cache initial setup"
363 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700364 Initial ccache settings to apply, such as --max-files or
365 --max-size.
Danomi Manchegodd79f2d2014-04-30 22:05:07 -0400366
Martin Kelly65f9b932016-05-31 09:57:22 -0700367 For example, if your project is known to require more space
368 than the default max cache size, then you might want to
369 increase the cache size to a suitable amount using the -M
370 (--max-size) option.
Danomi Manchegodd79f2d2014-04-30 22:05:07 -0400371
Martin Kelly65f9b932016-05-31 09:57:22 -0700372 The string you specify here is passed verbatim to ccache.
373 Refer to ccache documentation for more details.
Danomi Manchegodd79f2d2014-04-30 22:05:07 -0400374
Martin Kelly65f9b932016-05-31 09:57:22 -0700375 These initial settings are applied after ccache has been
376 compiled.
Danomi Manchegodd79f2d2014-04-30 22:05:07 -0400377
Arnout Vandecappelle1e97b272015-10-04 16:25:32 +0100378config BR2_CCACHE_USE_BASEDIR
379 bool "Use relative paths"
380 default y
381 help
382 Allow ccache to convert absolute paths within the output
383 directory into relative paths.
384
Martin Kelly65f9b932016-05-31 09:57:22 -0700385 During the build, many -I include directives are given with an
386 absolute path. These absolute paths end up in the hashes that
387 are computed by ccache. Therefore, when you build from a
388 different directory, the hash will be different and the cached
389 object will not be used.
Arnout Vandecappelle1e97b272015-10-04 16:25:32 +0100390
391 To improve cache performance, set this option to y. This
392 allows ccache to rewrite absolute paths within the output
Martin Kelly65f9b932016-05-31 09:57:22 -0700393 directory into relative paths. Note that only paths within the
394 output directory will be rewritten; therefore, if you change
395 BR2_HOST_DIR to point outside the output directory and
Arnout Vandecappelle1e97b272015-10-04 16:25:32 +0100396 subsequently move it to a different location, this will lead
397 to cache misses.
398
399 This option has as a result that the debug information in the
400 object files also has only relative paths. Therefore, make
401 sure you cd to the build directory before starting gdb. See
Martin Kelly65f9b932016-05-31 09:57:22 -0700402 the section "COMPILING IN DIFFERENT DIRECTORIES" in the ccache
403 manual for more information.
Arnout Vandecappelle1e97b272015-10-04 16:25:32 +0100404
Danomi Manchegodd79f2d2014-04-30 22:05:07 -0400405endif
406
John Voltz41f6b792008-03-12 13:07:10 +0000407config BR2_ENABLE_DEBUG
408 bool "build packages with debugging symbols"
John Voltz41f6b792008-03-12 13:07:10 +0000409 help
Thomas Petazzonia9a34672012-03-14 23:49:58 +0100410 Build packages with debugging symbols enabled. All libraries
411 and binaries in the 'staging' directory will have debugging
412 symbols, which allows remote debugging even if libraries and
413 binaries are stripped on the target. Whether libraries and
414 binaries are stripped on the target is controlled by the
415 BR2_STRIP_* options below.
John Voltz41f6b792008-03-12 13:07:10 +0000416
417if BR2_ENABLE_DEBUG
418choice
419 prompt "gcc debug level"
420 default BR2_DEBUG_2
421 help
422 Set the debug level for gcc
423
424config BR2_DEBUG_1
425 bool "debug level 1"
426 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700427 Debug level 1 produces minimal information, enough for making
428 backtraces in parts of the program that you don't plan to
429 debug. This includes descriptions of functions and external
430 variables, but no information about local variables and no
431 line numbers.
John Voltz41f6b792008-03-12 13:07:10 +0000432
433config BR2_DEBUG_2
434 bool "debug level 2"
435 help
436 The default gcc debug level is 2
437
438config BR2_DEBUG_3
439 bool "debug level 3"
440 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700441 Level 3 includes extra information, such as all the macro
442 definitions present in the program. Some debuggers support
443 macro expansion when you use -g3.
John Voltz41f6b792008-03-12 13:07:10 +0000444endchoice
445endif
446
Thomas De Schampheleireb7939fe2021-06-01 16:34:06 +0200447config BR2_ENABLE_RUNTIME_DEBUG
448 bool "build packages with runtime debugging info"
449 help
450 Some packages may have runtime assertions, extra traces, and
451 similar runtime elements that can help debugging. However,
452 these elements may negatively influence performance so should
453 normally not be enabled on production systems.
454
455 Enable this option to enable such runtime debugging.
456
457 Note: disabling this option is not a guarantee that all
458 packages effectively removed these runtime debugging elements.
459
Bernhard Reutner-Fischerbbd251a2007-07-31 18:06:50 +0000460config BR2_STRIP_strip
Yann E. MORIN0d643fd2017-07-01 14:51:21 +0200461 bool "strip target binaries"
Yann E. MORIN0d643fd2017-07-01 14:51:21 +0200462 default y
Damien Le Moal9db5eb22022-07-20 11:45:25 +0900463 depends on BR2_BINFMT_ELF
Bernhard Reutner-Fischerbbd251a2007-07-31 18:06:50 +0000464 help
Thomas Petazzonia9a34672012-03-14 23:49:58 +0100465 Binaries and libraries in the target filesystem will be
Martin Kelly65f9b932016-05-31 09:57:22 -0700466 stripped using the normal 'strip' command. This allows to save
467 space, mainly by removing debugging symbols. Debugging symbols
468 on the target are needed for native debugging, but not when
469 remote debugging is used.
Ulf Samuelsson85f54fb2007-08-24 05:31:07 +0000470
Thomas De Schampheleire2a970452012-06-21 19:34:50 +0000471config BR2_STRIP_EXCLUDE_FILES
472 string "executables that should not be stripped"
Thomas De Schampheleire2a970452012-06-21 19:34:50 +0000473 default ""
Ricardo Martincoskia1264442018-04-01 02:08:33 -0300474 depends on BR2_STRIP_strip
Thomas De Schampheleire2a970452012-06-21 19:34:50 +0000475 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700476 You may specify a space-separated list of binaries and
477 libraries here that should not be stripped on the target.
Thomas De Schampheleire2a970452012-06-21 19:34:50 +0000478
479config BR2_STRIP_EXCLUDE_DIRS
480 string "directories that should be skipped when stripping"
Thomas De Schampheleire2a970452012-06-21 19:34:50 +0000481 default ""
Ricardo Martincoskia1264442018-04-01 02:08:33 -0300482 depends on BR2_STRIP_strip
Thomas De Schampheleire2a970452012-06-21 19:34:50 +0000483 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700484 You may specify a space-separated list of directories that
485 should be skipped when stripping. Binaries and libraries in
486 these directories will not be touched. The directories should
487 be specified relative to the target directory, without leading
488 slash.
Thomas De Schampheleire2a970452012-06-21 19:34:50 +0000489
John Voltz41f6b792008-03-12 13:07:10 +0000490choice
491 prompt "gcc optimization level"
Thomas Petazzoni292949c2024-01-02 09:36:42 +0100492 default BR2_OPTIMIZE_2
John Voltz923f42a2008-03-12 11:23:11 +0000493 help
John Voltz41f6b792008-03-12 13:07:10 +0000494 Set the optimization level for gcc
495
496config BR2_OPTIMIZE_0
497 bool "optimization level 0"
498 help
Lothar Felten4e09fd82017-10-20 13:19:17 +0200499 Do not optimize.
John Voltz41f6b792008-03-12 13:07:10 +0000500
501config BR2_OPTIMIZE_1
502 bool "optimization level 1"
503 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700504 Optimize. Optimizing compilation takes somewhat more time, and
505 a lot more memory for a large function. With -O, the compiler
506 tries to reduce code size and execution time, without
507 performing any optimizations that take a great deal of
508 compilation time. -O turns on the following optimization
Peter Korsgaard02a623d2008-08-04 19:07:05 +0000509 flags: -fdefer-pop -fdelayed-branch -fguess-branch-probability
510 -fcprop-registers -floop-optimize -fif-conversion
511 -fif-conversion2 -ftree-ccp -ftree-dce -ftree-dominator-opts
512 -ftree-dse -ftree-ter -ftree-lrs -ftree-sra -ftree-copyrename
Martin Kelly65f9b932016-05-31 09:57:22 -0700513 -ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants. -O
514 also turns on -fomit-frame-pointer on machines where doing so
515 does not interfere with debugging.
John Voltz41f6b792008-03-12 13:07:10 +0000516
517config BR2_OPTIMIZE_2
518 bool "optimization level 2"
519 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700520 Optimize even more. GCC performs nearly all supported
521 optimizations that do not involve a space-speed tradeoff. The
522 compiler does not perform loop unrolling or function inlining
523 when you specify -O2. As compared to -O, this option increases
524 both compilation time and the performance of the generated
525 code. -O2 turns on all optimization flags specified by -O. It
526 also turns on the following optimization flags:
527 -fthread-jumps -fcrossjumping -foptimize-sibling-calls
Peter Korsgaard02a623d2008-08-04 19:07:05 +0000528 -fcse-follow-jumps -fcse-skip-blocks -fgcse -fgcse-lm
Martin Kelly65f9b932016-05-31 09:57:22 -0700529 -fexpensive-optimizations -fstrength-reduce
530 -frerun-cse-after-loop -frerun-loop-opt -fcaller-saves
531 -fpeephole2 -fschedule-insns -fschedule-insns2
532 -fsched-interblock -fsched-spec -fregmove -fstrict-aliasing
533 -fdelete-null-pointer-checks -freorder-blocks
534 -freorder-functions -falign-functions -falign-jumps
535 -falign-loops -falign-labels -ftree-vrp -ftree-pre. Please
536 note the warning under -fgcse about invoking -O2 on programs
John Voltz41f6b792008-03-12 13:07:10 +0000537 that use computed gotos.
Thomas Petazzoni292949c2024-01-02 09:36:42 +0100538 This is the default.
John Voltz41f6b792008-03-12 13:07:10 +0000539
540config BR2_OPTIMIZE_3
541 bool "optimization level 3"
542 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700543 Optimize yet more. -O3 turns on all optimizations specified by
544 -O2 and also turns on the -finline-functions, -funswitch-loops
545 and -fgcse-after-reload options.
John Voltz41f6b792008-03-12 13:07:10 +0000546
Martin Kelly5ff84592016-05-18 14:17:55 -0700547config BR2_OPTIMIZE_G
548 bool "optimize for debugging"
549 depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
550 help
551 Optimize for debugging. This enables optimizations that do not
Martin Kelly65f9b932016-05-31 09:57:22 -0700552 interfere with debugging. It should be the optimization level
553 of choice for the standard edit-compile-debug cycle, offering
554 a reasonable level of optimization while maintaining fast
555 compilation and a good debugging experience.
John Voltz41f6b792008-03-12 13:07:10 +0000556
557config BR2_OPTIMIZE_S
558 bool "optimize for size"
559 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700560 Optimize for size. -Os enables all -O2 optimizations that do
561 not typically increase code size. It also performs further
562 optimizations designed to reduce code size. -Os disables the
563 following optimization flags: -falign-functions -falign-jumps
564 -falign-loops -falign-labels -freorder-blocks
565 -freorder-blocks-and-partition -fprefetch-loop-arrays
John Voltz41f6b792008-03-12 13:07:10 +0000566 -ftree-vect-loop-version
Peter Korsgaard02a623d2008-08-04 19:07:05 +0000567
Joshua Hendersoned6a7e12018-03-26 12:34:05 -0700568config BR2_OPTIMIZE_FAST
Fabrice Fontaine3e186ce2020-07-16 23:44:51 +0200569 bool "optimize for fast (may break packages!)"
Joshua Hendersoned6a7e12018-03-26 12:34:05 -0700570 depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_6
571 help
572 Optimize for fast. Disregard strict standards
573 compliance. -Ofast enables all -O3 optimizations. It also
574 enables optimizations that are not valid for all
Fabrice Fontaine3e186ce2020-07-16 23:44:51 +0200575 standard-compliant programs, so be careful, as it may break
576 some packages. It turns on -ffast-math and the
Joshua Hendersoned6a7e12018-03-26 12:34:05 -0700577 Fortran-specific -fstack-arrays, unless -fmax-stack-var-size
578 is specified, and -fno-protect-parens.
579
John Voltz41f6b792008-03-12 13:07:10 +0000580endchoice
John Voltz923f42a2008-03-12 11:23:11 +0000581
Arnout Vandecappelle (Essensium/Mind)fb514222022-07-25 17:22:25 +0200582config BR2_ENABLE_LTO
583 bool "build packages with link-time optimisation"
584 help
585 Enable the link-time optimisation (LTO) option when building
586 packages. Link-time optimisation re-runs optimisations at
587 link time, which allows the compiler to do interprocedural
588 analysis across compilation units and thus come with better
589 results: smaller size and better performance.
590
591 Note that this analysis is limited to statically linked
592 object files and libraries.
593
594 This option may significantly increase build times,
595 sometimes 5 times longer, with only limited gains.
596
597 At this time, this option only enables LTO in packages that
598 have an explicit configuration option for it. Other packages
599 always enable LTO, but most packages never enable LTO.
600
Pascal Huerst09a1a102014-07-31 22:08:55 +0200601config BR2_GOOGLE_BREAKPAD_ENABLE
602 bool "Enable google-breakpad support"
Pascal Huerst09a1a102014-07-31 22:08:55 +0200603 depends on BR2_INSTALL_LIBSTDCPP
Fabrice Fontaine109362c2024-03-03 14:22:22 +0100604 depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # C++17
Gustavo Zacariase9ffb3b2016-09-14 21:46:29 -0300605 depends on BR2_USE_WCHAR
Thomas Petazzoni0bb39832016-09-19 16:50:46 +0200606 depends on BR2_TOOLCHAIN_HAS_THREADS
Adam Duskettc20334d2023-12-02 21:18:35 -0700607 depends on BR2_TOOLCHAIN_USES_GLIBC
Pascal Huerst09a1a102014-07-31 22:08:55 +0200608 depends on BR2_PACKAGE_GOOGLE_BREAKPAD_ARCH_SUPPORTS
Thomas Petazzonifadc4382017-11-26 15:40:19 +0100609 depends on BR2_PACKAGE_HOST_GOOGLE_BREAKPAD_ARCH_SUPPORTS
Ricardo Martincoskia1264442018-04-01 02:08:33 -0300610 select BR2_PACKAGE_GOOGLE_BREAKPAD
Pascal Huerst09a1a102014-07-31 22:08:55 +0200611 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700612 This option will enable the use of google breakpad, a library
613 and tool suite that allows you to distribute an application to
614 users with compiler-provided debugging information removed,
615 record crashes in compact "minidump" files, send them back to
616 your server and produce C and C++ stack traces from these
617 minidumps. Breakpad can also write minidumps on request for
618 programs that have not crashed.
Pascal Huerst09a1a102014-07-31 22:08:55 +0200619
620if BR2_GOOGLE_BREAKPAD_ENABLE
621
622config BR2_GOOGLE_BREAKPAD_INCLUDE_FILES
623 string "List of executables and libraries to extract symbols from"
624 default ""
625 help
626 You may specify a space-separated list of binaries and
627 libraries with full paths relative to $(TARGET_DIR) of which
628 debug symbols will be dumped for further use with google
629 breakpad.
630
631 A directory structure that can be used by minidump-stackwalk
632 will be created at:
633
634 $(STAGING_DIR)/usr/share/google-breakpad-symbols
635
636endif
637
Steven Noonand29c7192015-12-27 12:07:31 +0100638choice
Thomas Petazzoni158001f2014-12-11 23:50:09 +0100639 bool "libraries"
Thomas Petazzonif1d3e092014-12-11 23:50:11 +0100640 default BR2_SHARED_LIBS if BR2_BINFMT_SUPPORTS_SHARED
Thomas Petazzoni158001f2014-12-11 23:50:09 +0100641 default BR2_STATIC_LIBS if !BR2_BINFMT_SUPPORTS_SHARED
Bernhard Reutner-Fischer3096f342007-06-01 22:16:28 +0000642 help
Thomas Petazzoni158001f2014-12-11 23:50:09 +0100643 Select the type of libraries you want to use on the target.
Bernhard Reutner-Fischer3096f342007-06-01 22:16:28 +0000644
Martin Kelly65f9b932016-05-31 09:57:22 -0700645 The default is to build dynamic libraries and use those on the
646 target filesystem, except when the architecture and/or the
647 selected binary format does not support shared libraries.
Alexey Brodkin7d9c0df2014-10-12 18:34:44 +0200648
Thomas Petazzoni158001f2014-12-11 23:50:09 +0100649config BR2_STATIC_LIBS
650 bool "static only"
Arnout Vandecappelle (Essensium/Mind)90932b42021-10-06 22:41:32 +0200651 depends on !BR2_TOOLCHAIN_USES_GLIBC
Thomas Petazzoni158001f2014-12-11 23:50:09 +0100652 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700653 Build and use only static libraries. No shared libraries will
Bernd Kuhlsd9312d62016-07-31 18:02:47 +0200654 be installed on the target. This potentially increases your
Martin Kelly65f9b932016-05-31 09:57:22 -0700655 code size and should only be used if you know what you are
656 doing. Note that some packages may not be available when this
657 option is enabled, due to their need for dynamic library
658 support.
Thomas Petazzoni158001f2014-12-11 23:50:09 +0100659
Arnout Vandecappelle (Essensium/Mind)90932b42021-10-06 22:41:32 +0200660comment "static only needs a toolchain w/ uclibc or musl"
661 depends on BR2_TOOLCHAIN_USES_GLIBC
662
Thomas Petazzoni158001f2014-12-11 23:50:09 +0100663config BR2_SHARED_LIBS
664 bool "shared only"
665 depends on BR2_BINFMT_SUPPORTS_SHARED
666 help
667 Build and use only shared libraries. This is the recommended
668 solution as it saves space and build time.
669
670config BR2_SHARED_STATIC_LIBS
671 bool "both static and shared"
672 depends on BR2_BINFMT_SUPPORTS_SHARED
673 help
674 Build both shared and static libraries, but link executables
675 dynamically. While building both shared and static libraries
676 take more time and more disk space, having static libraries
677 may be useful to link some of the applications statically.
678
679endchoice
Alexey Brodkin7d9c0df2014-10-12 18:34:44 +0200680
Thomas Petazzoniee0246e2011-09-29 21:57:38 +0200681config BR2_PACKAGE_OVERRIDE_FILE
682 string "location of a package override file"
Yann E. MORINeda3d0e2014-01-29 22:48:24 +0100683 default "$(CONFIG_DIR)/local.mk"
Thomas Petazzoniee0246e2011-09-29 21:57:38 +0200684 help
685 A package override file is a short makefile that contains
Martin Kelly65f9b932016-05-31 09:57:22 -0700686 variable definitions of the form <pkg>_OVERRIDE_SRCDIR, which
687 allows to tell Buildroot to use an existing directory as the
688 source directory for a particular package. See the Buildroot
689 documentation for more details on this feature.
Thomas Petazzoniee0246e2011-09-29 21:57:38 +0200690
Simon Dawson5538e472013-03-17 23:13:47 +0000691config BR2_GLOBAL_PATCH_DIR
Yann E. MORIN5d367102023-11-06 20:09:13 +0100692 string "global patch and hash directories"
Simon Dawson5538e472013-03-17 23:13:47 +0000693 help
Martin Kelly65f9b932016-05-31 09:57:22 -0700694 You may specify a space separated list of one or more
Yann E. MORIN5d367102023-11-06 20:09:13 +0100695 directories containing global package patches and/or hashes.
696 For a specific version <packageversion> of a specific package
697 <packagename>, patches are looked up as follows:
Simon Dawson5538e472013-03-17 23:13:47 +0000698
Martin Kelly65f9b932016-05-31 09:57:22 -0700699 First, the default Buildroot patch set for the package is
700 applied from the package's directory in Buildroot.
Simon Dawson5538e472013-03-17 23:13:47 +0000701
Ryan Barnettbc4f79d2013-12-18 04:25:01 -0600702 Then for every directory - <global-patch-dir> - that exists in
703 BR2_GLOBAL_PATCH_DIR, if the directory
Martin Kelly65f9b932016-05-31 09:57:22 -0700704 <global-patch-dir>/<packagename>/<packageversion>/ exists,
705 then all *.patch files in this directory will be applied.
Simon Dawson5538e472013-03-17 23:13:47 +0000706
Martin Kelly65f9b932016-05-31 09:57:22 -0700707 Otherwise, if the directory <global-patch-dir>/<packagename>
708 exists, then all *.patch files in the directory will be
709 applied.
Simon Dawson5538e472013-03-17 23:13:47 +0000710
Yann E. MORIN5d367102023-11-06 20:09:13 +0100711 The hash files are looked up similarly to the patches.
712
Thomas Petazzoni4ac8f782014-12-10 23:53:57 +0100713menu "Advanced"
714
Bryce Ferguson3f1b9652018-11-26 22:10:09 -0600715config BR2_FORCE_HOST_BUILD
716 bool "Force the building of host dependencies"
717 help
718 Build all available host dependencies, even if they are
719 already installed on the system.
720
721 This option can be used to ensure that the download cache of
722 source archives for packages remain consistent between
723 different build hosts.
724
725 This option will increase build time.
726
Yann E. MORINe091e312023-11-06 20:09:14 +0100727config BR2_DOWNLOAD_FORCE_CHECK_HASHES
728 bool "Force all downloads to have a valid hash"
Yann E. MORINe091e312023-11-06 20:09:14 +0100729 help
Yann E. MORINe091e312023-11-06 20:09:14 +0100730 Say 'y' here to enforce downloads to have at least one valid
731 hash (and of course, that all hashes be valid).
732
Thomas Petazzoni5b0c02a2023-12-27 18:07:58 +0100733 By default, Buildroot checks hashes of all packages
734 downloaded, except those for which a custom version is
735 used.
Yann E. MORINe091e312023-11-06 20:09:14 +0100736
Thomas Petazzoni5b0c02a2023-12-27 18:07:58 +0100737 With this option turned on, Buildroot will check hashes of
738 all packages, including those that use a custom version. In
739 order to provide hashes for such packages, place additional
740 hash files in BR2_GLOBAL_PATCH_DIR directories.
Yann E. MORINe091e312023-11-06 20:09:14 +0100741
Gilles Chanteperdrix71574a62016-06-14 17:31:09 +0200742config BR2_REPRODUCIBLE
743 bool "Make the build reproducible (experimental)"
Yann E. MORIN6393b692017-10-21 22:31:02 +0200744 # SOURCE_DATE_EPOCH support in toolchain-wrapper requires GCC 4.4
745 depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_4
Jerzy Grzegoreka446ab72016-07-02 17:06:18 +0200746 help
747 This option will remove all sources of non-reproducibility
748 from the build process. For a given Buildroot configuration,
749 this allows to generate exactly identical binaries from one
750 build to the other, including on different machines.
Gilles Chanteperdrix71574a62016-06-14 17:31:09 +0200751
Jérôme Pouillerbedb1612016-11-23 13:58:56 +0100752 The current implementation is restricted to builds with the
753 same output directory. Many (absolute) paths are recorded in
754 intermediary files, and it is very likely that some of these
755 paths leak into the target rootfs. If you build with the
756 same O=... path, however, the result is identical.
757
Jerzy Grzegoreka446ab72016-07-02 17:06:18 +0200758 This is labeled as an experimental feature, as not all
759 packages behave properly to ensure reproducibility.
Gilles Chanteperdrix71574a62016-06-14 17:31:09 +0200760
Thomas Petazzonic4e6d5c2019-11-05 17:46:40 +0100761config BR2_PER_PACKAGE_DIRECTORIES
762 bool "Use per-package directories (experimental)"
763 help
764 This option will change the build process of Buildroot
765 package to use per-package target and host directories.
766
767 This is useful for two related purposes:
768
769 - Cleanly isolate the build of each package, so that a
770 given package only "sees" the dependencies it has
771 explicitly expressed, and not other packages that may
772 have by chance been built before.
773
774 - Enable top-level parallel build.
775
776 This is labeled as an experimental feature, as not all
777 packages behave properly with per-package directories.
778
Eric Andersen8e5fb3f2004-12-11 13:01:10 +0000779endmenu
Eric Andersen2d523c22004-10-09 01:06:03 +0000780
Thomas Petazzoni3c427c62022-10-12 23:50:08 +0200781config BR2_TIME_BITS_64
782 bool "Build Y2038-ready code"
783 depends on BR2_TOOLCHAIN_USES_GLIBC && !BR2_ARCH_IS_64
784 help
785 This option will pass -D_TIME_BITS=64 in the compiler flags
786 to ensure the glibc C library uses a 64-bit representation
787 for time_t and other time types, which ensures that
788 programs/libraries will correctly handle time past year
789 2038.
790
791 This option only has an effect with glibc >= 2.34, as
792 earlier glibc versions did not have support for 64-bit
793 time_t.
794
Matt Weberd3732cf2018-01-23 22:09:40 -0600795comment "Security Hardening Options"
796
Thomas Petazzoni70dd4bd2021-07-25 15:45:19 +0200797config BR2_PIC_PIE_ARCH_SUPPORTS
798 bool
Fabrice Fontaine810ba382021-05-03 20:22:41 +0200799 default y
Romain Naourd120f842021-06-12 12:24:49 +0200800 # Microblaze glibc toolchains don't work with PIC/PIE enabled
801 depends on !BR2_microblaze
Romain Naour6b4b63a2021-06-01 21:00:21 +0200802 # Nios2 toolchains produce non working binaries with -fPIC
803 depends on !BR2_nios2
Thomas Petazzoni70dd4bd2021-07-25 15:45:19 +0200804
805config BR2_PIC_PIE
806 bool "Build code with PIC/PIE"
807 default y
808 depends on BR2_PIC_PIE_ARCH_SUPPORTS
Yann E. MORIN814f6e12019-03-12 13:09:36 +0100809 depends on BR2_SHARED_LIBS
Fabrice Fontainede3fa432019-10-27 23:03:34 +0100810 depends on BR2_TOOLCHAIN_SUPPORTS_PIE
Yann E. MORIN814f6e12019-03-12 13:09:36 +0100811 help
812 Generate Position-Independent Code (PIC) and link
813 Position-Independent Executables (PIE).
814
Fabrice Fontainede3fa432019-10-27 23:03:34 +0100815comment "PIC/PIE needs a toolchain w/ PIE"
Thomas Petazzoni70dd4bd2021-07-25 15:45:19 +0200816 depends on BR2_PIC_PIE_ARCH_SUPPORTS
Fabrice Fontainede3fa432019-10-27 23:03:34 +0100817 depends on BR2_SHARED_LIBS
818 depends on !BR2_TOOLCHAIN_SUPPORTS_PIE
819
Matt Weberd3732cf2018-01-23 22:09:40 -0600820choice
821 bool "Stack Smashing Protection"
Fabrice Fontaine50739072021-05-04 22:09:11 +0200822 default BR2_SSP_ALL if BR2_ENABLE_SSP # legacy
Fabrice Fontaine810ba382021-05-03 20:22:41 +0200823 default BR2_SSP_STRONG if BR2_TOOLCHAIN_HAS_SSP_STRONG
824 default BR2_SSP_REGULAR
Matt Weberd3732cf2018-01-23 22:09:40 -0600825 depends on BR2_TOOLCHAIN_HAS_SSP
826 help
827 Enable stack smashing protection support using GCC's
828 -fstack-protector option family.
829
830 See
831 http://www.linuxfromscratch.org/hints/downloads/files/ssp.txt
832 for details.
833
834 Note that this requires the toolchain to have SSP support.
835 This is always the case for glibc and eglibc toolchain, but is
836 optional in uClibc toolchains.
837
838config BR2_SSP_NONE
839 bool "None"
840 help
841 Disable stack-smashing protection.
842
843config BR2_SSP_REGULAR
844 bool "-fstack-protector"
845 help
846 Emit extra code to check for buffer overflows, such as stack
847 smashing attacks. This is done by adding a guard variable to
848 functions with vulnerable objects. This includes functions
849 that call alloca, and functions with buffers larger than 8
850 bytes. The guards are initialized when a function is entered
851 and then checked when the function exits. If a guard check
852 fails, an error message is printed and the program exits.
853
854config BR2_SSP_STRONG
855 bool "-fstack-protector-strong"
Thomas Petazzoni058dc9a2020-02-20 03:01:16 +0100856 depends on BR2_TOOLCHAIN_HAS_SSP_STRONG
Matt Weberd3732cf2018-01-23 22:09:40 -0600857 help
858 Like -fstack-protector but includes additional functions to be
859 protected - those that have local array definitions, or have
860 references to local frame addresses.
861
Yann E. MORIN51db8972019-03-12 13:09:35 +0100862 -fstack-protector-strong officially appeared in gcc 4.9, but
863 some vendors have backported -fstack-protector-strong to older
864 versions of gcc.
Matt Weberd3732cf2018-01-23 22:09:40 -0600865
866config BR2_SSP_ALL
867 bool "-fstack-protector-all"
868 help
869 Like -fstack-protector except that all functions are
870 protected. This option might have a significant performance
871 impact on the compiled binaries.
872
873endchoice
874
Yann E. MORINb8ec1132019-03-12 13:09:33 +0100875config BR2_SSP_OPTION
876 string
877 default "-fstack-protector" if BR2_SSP_REGULAR
878 default "-fstack-protector-strong" if BR2_SSP_STRONG
879 default "-fstack-protector-all" if BR2_SSP_ALL
880
Matt Weberd3732cf2018-01-23 22:09:40 -0600881comment "Stack Smashing Protection needs a toolchain w/ SSP"
882 depends on !BR2_TOOLCHAIN_HAS_SSP
883
Matt Weber20a45832018-01-23 22:09:41 -0600884choice
885 bool "RELRO Protection"
Fabrice Fontaine810ba382021-05-03 20:22:41 +0200886 default BR2_RELRO_FULL if BR2_TOOLCHAIN_SUPPORTS_PIE
887 default BR2_RELRO_PARTIAL
Matt Weber20a45832018-01-23 22:09:41 -0600888 depends on BR2_SHARED_LIBS
889 help
Ricardo Martincoskid6109172018-04-01 02:08:39 -0300890 Enable a link-time protection know as RELRO (RELocation Read
891 Only) which helps to protect from certain type of exploitation
892 techniques altering the content of some ELF sections.
Matt Weber20a45832018-01-23 22:09:41 -0600893
894config BR2_RELRO_NONE
895 bool "None"
896 help
897 Disables Relocation link-time protections.
898
899config BR2_RELRO_PARTIAL
900 bool "Partial"
901 help
902 This option makes the dynamic section not writeable after
903 initialization (with almost no performance penalty).
904
905config BR2_RELRO_FULL
906 bool "Full"
Thomas Petazzoni70dd4bd2021-07-25 15:45:19 +0200907 depends on BR2_PIC_PIE_ARCH_SUPPORTS
Fabrice Fontainede3fa432019-10-27 23:03:34 +0100908 depends on BR2_TOOLCHAIN_SUPPORTS_PIE
Yann E. MORIN814f6e12019-03-12 13:09:36 +0100909 select BR2_PIC_PIE
Matt Weber20a45832018-01-23 22:09:41 -0600910 help
Ricardo Martincoskid6109172018-04-01 02:08:39 -0300911 This option includes the partial configuration, but also marks
912 the GOT as read-only at the cost of initialization time during
913 program loading, i.e every time an executable is started.
Matt Weber20a45832018-01-23 22:09:41 -0600914
Fabrice Fontainede3fa432019-10-27 23:03:34 +0100915comment "RELRO Full needs a toolchain w/ PIE"
Thomas Petazzoni70dd4bd2021-07-25 15:45:19 +0200916 depends on BR2_PIC_PIE_ARCH_SUPPORTS
Fabrice Fontainede3fa432019-10-27 23:03:34 +0100917 depends on !BR2_TOOLCHAIN_SUPPORTS_PIE
918
Matt Weber20a45832018-01-23 22:09:41 -0600919endchoice
920
921comment "RELocation Read Only (RELRO) needs shared libraries"
922 depends on !BR2_SHARED_LIBS
923
Romain Naour2e94aee2021-08-21 00:53:41 +0200924config BR2_FORTIFY_SOURCE_ARCH_SUPPORTS
925 bool
926 default y
927 # Microblaze glibc toolchains don't work with Fortify Source enabled
928 depends on !BR2_microblaze
929
Matt Weber20a45832018-01-23 22:09:41 -0600930choice
931 bool "Buffer-overflow Detection (FORTIFY_SOURCE)"
Fabrice Fontaine810ba382021-05-03 20:22:41 +0200932 default BR2_FORTIFY_SOURCE_1
Romain Naour2e94aee2021-08-21 00:53:41 +0200933 depends on BR2_FORTIFY_SOURCE_ARCH_SUPPORTS
Matt Weber20a45832018-01-23 22:09:41 -0600934 depends on BR2_TOOLCHAIN_USES_GLIBC
935 depends on !BR2_OPTIMIZE_0
936 help
937 Enable the _FORTIFY_SOURCE macro which introduces additional
Ricardo Martincoskid6109172018-04-01 02:08:39 -0300938 checks to detect buffer-overflows in the following standard
939 library functions: memcpy, mempcpy, memmove, memset, strcpy,
940 stpcpy, strncpy, strcat, strncat, sprintf, vsprintf, snprintf,
941 vsnprintf, gets.
Matt Weber20a45832018-01-23 22:09:41 -0600942
943 NOTE: This feature requires an optimization level of s/1/2/3/g
944
945 Support for this feature has been present since GCC 4.x.
946
947config BR2_FORTIFY_SOURCE_NONE
948 bool "None"
949 help
950 Disables additional checks to detect buffer-overflows.
951
952config BR2_FORTIFY_SOURCE_1
953 bool "Conservative"
Romain Naoura75ee0e2018-11-05 21:07:50 +0100954 # gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61164
955 depends on !BR2_TOOLCHAIN_BUILDROOT || BR2_TOOLCHAIN_GCC_AT_LEAST_6
Matt Weber20a45832018-01-23 22:09:41 -0600956 help
957 This option sets _FORTIFY_SOURCE to 1 and only introduces
958 checks that shouldn't change the behavior of conforming
959 programs. Adds checks at compile-time only.
960
961config BR2_FORTIFY_SOURCE_2
962 bool "Aggressive"
Romain Naoura75ee0e2018-11-05 21:07:50 +0100963 # gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61164
964 depends on !BR2_TOOLCHAIN_BUILDROOT || BR2_TOOLCHAIN_GCC_AT_LEAST_6
Matt Weber20a45832018-01-23 22:09:41 -0600965 help
966 This option sets _FORTIFY_SOURCES to 2 and some more
967 checking is added, but some conforming programs might fail.
968 Also adds checks at run-time (detected buffer overflow
969 terminates the program)
970
Julien Olivain2f54c2a2022-09-18 23:21:44 +0200971config BR2_FORTIFY_SOURCE_3
972 bool "Extended"
973 depends on BR2_TOOLCHAIN_GCC_AT_LEAST_12
974 help
975 This option sets _FORTIFY_SOURCES to 3 and even more
976 checking is added compared to level 2. Extends checks at
977 run-time that can introduce an additional performance
978 overhead.
979
Matt Weber20a45832018-01-23 22:09:41 -0600980endchoice
981
982comment "Fortify Source needs a glibc toolchain and optimization"
Romain Naour2e94aee2021-08-21 00:53:41 +0200983 depends on BR2_FORTIFY_SOURCE_ARCH_SUPPORTS
Matt Weber20a45832018-01-23 22:09:41 -0600984 depends on (!BR2_TOOLCHAIN_USES_GLIBC || BR2_OPTIMIZE_0)
Yann E. MORIN1ac2cdd2016-08-25 19:19:46 +0200985endmenu
986
Thomas Petazzoni6c3e3ad2012-11-03 08:27:58 +0000987source "system/Config.in"
Thomas Petazzonibeb43c72010-12-05 21:52:44 +0100988
Yann E. MORIN24403852013-08-17 22:35:37 +0200989source "linux/Config.in"
Bernhard Reutner-Fischer50100392007-09-25 07:55:45 +0000990
Yann E. MORIN24403852013-08-17 22:35:37 +0200991source "package/Config.in"
Thomas Petazzonid06e8022012-01-28 18:42:49 +0100992
Thomas Petazzoni05852412010-03-10 22:30:06 +0100993source "fs/Config.in"
994
Thomas Petazzoni649b5b92010-03-14 18:20:45 +0100995source "boot/Config.in"
996
Yann E. MORIN24403852013-08-17 22:35:37 +0200997source "package/Config.in.host"
Arnout Vandecappelle (Essensium/Mind)ebcfa982012-11-12 10:08:28 +0000998
999source "Config.in.legacy"
Thomas Petazzoni8eb8aaf2013-12-05 20:11:11 +01001000
Yann E. MORINedf32b02019-07-29 22:19:59 +02001001# br2-external menus definitions
1002source "$BR2_BASE_DIR/.br2-external.in.menus"