xref: /OK3568_Linux_fs/buildroot/Config.in (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#
2
3mainmenu "Buildroot $BR2_VERSION Configuration"
4
5config BR2_HAVE_DOT_CONFIG
6	bool
7	default y
8
9config BR2_VERSION
10	string
11	option env="BR2_VERSION_FULL"
12
13config BR2_HOSTARCH
14	string
15	option env="HOSTARCH"
16
17config BR2_BASE_DIR
18	string
19	option env="BASE_DIR"
20
21# br2-external paths definitions
22source "$BR2_BASE_DIR/.br2-external.in.paths"
23
24# Hidden config symbols for packages to check system gcc version
25config BR2_HOST_GCC_VERSION
26	string
27	option env="HOST_GCC_VERSION"
28
29config BR2_HOST_GCC_AT_LEAST_4_9
30	bool
31	default y if BR2_HOST_GCC_VERSION = "4 9"
32
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
38config 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
43config 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
48config 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
53config 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
58# When adding new entries above, be sure to update
59# the HOSTCC_MAX_VERSION variable in the Makefile.
60
61# Hidden boolean selected by packages in need of Java in order to build
62# (example: kodi)
63config BR2_NEEDS_HOST_JAVA
64	bool
65
66# Hidden boolean selected by pre-built packages for x86, when they
67# need to run on x86-64 machines (example: pre-built external
68# toolchains, binary tools like SAM-BA, etc.).
69config BR2_HOSTARCH_NEEDS_IA32_LIBS
70	bool
71
72# Hidden boolean selected by packages that need to build 32 bits
73# binaries with the host compiler, even on 64 bits build machines (e.g
74# bootloaders).
75config BR2_HOSTARCH_NEEDS_IA32_COMPILER
76	bool
77
78# Hidden boolean selected by packages that need the host to have an
79# UTF8 locale.
80config BR2_NEEDS_HOST_UTF8_LOCALE
81	bool
82
83# Hidden boolean selected by packages that need the host to have
84# support for building gcc plugins
85config BR2_NEEDS_HOST_GCC_PLUGIN_SUPPORT
86	bool
87
88source "arch/Config.in"
89
90menu "Build options"
91
92menu "Commands"
93
94config BR2_WGET
95	string "Wget command"
96	# Allow hosts with old certificates to download over https
97	default "wget --passive-ftp -nd -t 3 --no-check-certificate"
98
99config BR2_SVN
100	string "Subversion (svn) command"
101	default "svn --non-interactive"
102
103config BR2_BZR
104	string "Bazaar (bzr) command"
105	default "bzr"
106
107config BR2_GIT
108	string "Git command"
109	default "git"
110
111config BR2_CVS
112	string "CVS command"
113	default "cvs"
114
115config BR2_LOCALFILES
116	string "Local files retrieval command"
117	default "cp"
118
119config BR2_SCP
120	string "Secure copy (scp) command"
121	default "scp"
122
123config BR2_HG
124	string "Mercurial (hg) command"
125	default "hg"
126
127config BR2_ZCAT
128	string "zcat command"
129	default "gzip -d -c"
130	help
131	  Command to be used to extract a gzip'ed file to stdout. zcat
132	  is identical to gunzip -c except that the former may not be
133	  available on your system.
134	  Default is "gzip -d -c"
135	  Other possible values include "gunzip -c" or "zcat".
136
137config BR2_BZCAT
138	string "bzcat command"
139	default "bzcat"
140	help
141	  Command to be used to extract a bzip2'ed file to stdout.
142	  bzcat is identical to bunzip2 -c except that the former may
143	  not be available on your system.
144	  Default is "bzcat"
145	  Other possible values include "bunzip2 -c" or "bzip2 -d -c".
146
147config BR2_XZCAT
148	string "xzcat command"
149	default "xzcat"
150	help
151	  Command to be used to extract a xz'ed file to stdout.
152	  Default is "xzcat"
153
154config BR2_LZCAT
155	string "lzcat command"
156	default "lzip -d -c"
157	help
158	  Command to be used to extract a lzip'ed file to stdout.
159	  Default is "lzip -d -c"
160
161config BR2_TAR_OPTIONS
162	string "Tar options"
163	default ""
164	help
165	  Options to pass to tar when extracting the sources.
166	  E.g. " -v --exclude='*.svn*'" to exclude all .svn internal
167	  files and to be verbose.
168
169endmenu
170
171config BR2_DEFCONFIG_FROM_ENV
172	string
173	option env="BR2_DEFCONFIG"
174
175config BR2_DEFCONFIG
176	string "Location to save buildroot config"
177	default BR2_DEFCONFIG_FROM_ENV if BR2_DEFCONFIG_FROM_ENV != ""
178	default "$(CONFIG_DIR)/defconfig"
179	help
180	  When running 'make savedefconfig', the defconfig file will be
181	  saved in this location.
182
183config BR2_DL_DIR
184	string "Download dir"
185	default "$(TOPDIR)/dl"
186	help
187	  Directory to store all the source files that we need to fetch.
188	  If the Linux shell environment has defined the BR2_DL_DIR
189	  environment variable, then this overrides this configuration
190	  item.
191	  The directory is organized with a subdirectory for each
192	  package. Each package has its own $(LIBFOO_DL_DIR) variable
193	  that can be used to find the correct path.
194
195	  The default is $(TOPDIR)/dl
196
197config BR2_HOST_DIR
198	string "Host dir"
199	default "$(BASE_DIR)/host"
200	help
201	  Directory to store all the binary files that are built for the
202	  host. This includes the cross compilation toolchain when
203	  building the internal buildroot toolchain.
204
205	  The default is $(BASE_DIR)/host
206
207menu "Mirrors and Download locations"
208
209config BR2_PRIMARY_SITE
210	string "Primary download site"
211	default ""
212	help
213	  Primary site to download from. If this option is set then
214	  buildroot will try to download package source first from this
215	  site and try the default if the file is not found.
216	  Valid URIs are:
217	    - URIs recognized by $(WGET)
218	    - local URIs of the form file://absolutepath
219	    - scp URIs of the form scp://[user@]host:path.
220
221config BR2_PRIMARY_SITE_ONLY
222	bool "Only allow downloads from primary download site"
223	depends on BR2_PRIMARY_SITE != ""
224	help
225	  If this option is enabled, downloads will only be attempted
226	  from the primary download site. Other locations, like the
227	  package's official download location or the backup download
228	  site, will not be considered. Therefore, if the package is not
229	  present on the primary site, the download fails.
230
231	  This is useful for project developers who want to ensure that
232	  the project can be built even if the upstream tarball
233	  locations disappear.
234
235if !BR2_PRIMARY_SITE_ONLY
236
237config BR2_BACKUP_SITE
238	string "Backup download site"
239	default "http://sources.buildroot.net"
240	help
241	  Backup site to download from. If this option is set then
242	  buildroot will fall back to download package sources from here
243	  if the normal location fails.
244
245config BR2_KERNEL_MIRROR
246	string "Kernel.org mirror"
247	default "https://cdn.kernel.org/pub"
248	help
249	  kernel.org is mirrored on a number of servers around the
250	  world. The following allows you to select your preferred
251	  mirror. By default, a CDN is used, which automatically
252	  redirects to a mirror geographically close to you.
253
254	  Have a look on the kernel.org site for a list of mirrors, then
255	  enter the URL to the base directory. Examples:
256
257	     http://www.XX.kernel.org/pub (XX = country code)
258	     http://mirror.aarnet.edu.au/pub/ftp.kernel.org
259
260config BR2_GNU_MIRROR
261	string "GNU Software mirror"
262	default "http://ftpmirror.gnu.org"
263	help
264	  GNU has multiple software mirrors scattered around the
265	  world. The following allows you to select your preferred
266	  mirror. By default, a generic address is used, which
267	  automatically selects an up-to-date and local mirror.
268
269	  Have a look on the gnu.org site for a list of mirrors, then
270	  enter the URL to the base directory. Examples:
271
272	     http://ftp.gnu.org/pub/gnu
273	     http://mirror.aarnet.edu.au/pub/gnu
274
275config BR2_LUAROCKS_MIRROR
276	string "LuaRocks mirror"
277	default "http://rocks.moonscript.org"
278	help
279	  LuaRocks repository.
280
281	  See http://luarocks.org
282
283config BR2_CPAN_MIRROR
284	string "CPAN mirror (Perl packages)"
285	default "http://cpan.metacpan.org"
286	help
287	  CPAN (Comprehensive Perl Archive Network) is a repository of
288	  Perl packages. It has multiple software mirrors scattered
289	  around the world. This option allows you to select a mirror.
290
291	  The list of mirrors is available at:
292	  http://search.cpan.org/mirror
293
294endif
295
296endmenu
297
298config BR2_JLEVEL
299	int "Number of jobs to run simultaneously (0 for auto)"
300	default "0"
301	help
302	  Number of jobs to run simultaneously. If 0, determine
303	  automatically according to number of CPUs on the host system.
304
305config BR2_CCACHE
306	bool "Enable compiler cache"
307	help
308	  This option will enable the use of ccache, a compiler cache.
309	  It will cache the result of previous builds to speed up future
310	  builds. By default, the cache is stored in
311	  $HOME/.buildroot-ccache.
312
313	  Note that Buildroot does not try to invalidate the cache
314	  contents when the compiler changes in an incompatible way.
315	  Therefore, if you make a change to the compiler version and/or
316	  configuration, you are responsible for purging the ccache
317	  cache by removing the $HOME/.buildroot-ccache directory.
318
319if BR2_CCACHE
320
321config BR2_CCACHE_DIR
322	string "Compiler cache location"
323	default "$(HOME)/.buildroot-ccache"
324	help
325	  Where ccache should store cached files.
326	  If the Linux shell environment has defined the BR2_CCACHE_DIR
327	  environment variable, then this overrides this configuration
328	  item.
329
330config BR2_CCACHE_INITIAL_SETUP
331	string "Compiler cache initial setup"
332	help
333	  Initial ccache settings to apply, such as --max-files or
334	  --max-size.
335
336	  For example, if your project is known to require more space
337	  than the default max cache size, then you might want to
338	  increase the cache size to a suitable amount using the -M
339	  (--max-size) option.
340
341	  The string you specify here is passed verbatim to ccache.
342	  Refer to ccache documentation for more details.
343
344	  These initial settings are applied after ccache has been
345	  compiled.
346
347config BR2_CCACHE_USE_BASEDIR
348	bool "Use relative paths"
349	default y
350	help
351	  Allow ccache to convert absolute paths within the output
352	  directory into relative paths.
353
354	  During the build, many -I include directives are given with an
355	  absolute path. These absolute paths end up in the hashes that
356	  are computed by ccache. Therefore, when you build from a
357	  different directory, the hash will be different and the cached
358	  object will not be used.
359
360	  To improve cache performance, set this option to y. This
361	  allows ccache to rewrite absolute paths within the output
362	  directory into relative paths. Note that only paths within the
363	  output directory will be rewritten; therefore, if you change
364	  BR2_HOST_DIR to point outside the output directory and
365	  subsequently move it to a different location, this will lead
366	  to cache misses.
367
368	  This option has as a result that the debug information in the
369	  object files also has only relative paths. Therefore, make
370	  sure you cd to the build directory before starting gdb. See
371	  the section "COMPILING IN DIFFERENT DIRECTORIES" in the ccache
372	  manual for more information.
373
374endif
375
376config BR2_ENABLE_DEBUG
377	bool "build packages with debugging symbols"
378	help
379	  Build packages with debugging symbols enabled. All libraries
380	  and binaries in the 'staging' directory will have debugging
381	  symbols, which allows remote debugging even if libraries and
382	  binaries are stripped on the target. Whether libraries and
383	  binaries are stripped on the target is controlled by the
384	  BR2_STRIP_* options below.
385
386if BR2_ENABLE_DEBUG
387choice
388	prompt "gcc debug level"
389	default BR2_DEBUG_2
390	help
391	  Set the debug level for gcc
392
393config BR2_DEBUG_1
394	bool "debug level 1"
395	help
396	  Debug level 1 produces minimal information, enough for making
397	  backtraces in parts of the program that you don't plan to
398	  debug. This includes descriptions of functions and external
399	  variables, but no information about local variables and no
400	  line numbers.
401
402config BR2_DEBUG_2
403	bool "debug level 2"
404	help
405	  The default gcc debug level is 2
406
407config BR2_DEBUG_3
408	bool "debug level 3"
409	help
410	  Level 3 includes extra information, such as all the macro
411	  definitions present in the program. Some debuggers support
412	  macro expansion when you use -g3.
413endchoice
414endif
415
416config BR2_ENABLE_RUNTIME_DEBUG
417	bool "build packages with runtime debugging info"
418	help
419	  Some packages may have runtime assertions, extra traces, and
420	  similar runtime elements that can help debugging. However,
421	  these elements may negatively influence performance so should
422	  normally not be enabled on production systems.
423
424	  Enable this option to enable such runtime debugging.
425
426	  Note: disabling this option is not a guarantee that all
427	  packages effectively removed these runtime debugging elements.
428
429config BR2_STRIP_strip
430	bool "strip target binaries"
431	default y
432	depends on !BR2_PACKAGE_HOST_ELF2FLT
433	help
434	  Binaries and libraries in the target filesystem will be
435	  stripped using the normal 'strip' command. This allows to save
436	  space, mainly by removing debugging symbols. Debugging symbols
437	  on the target are needed for native debugging, but not when
438	  remote debugging is used.
439
440config BR2_STRIP_EXCLUDE_FILES
441	string "executables that should not be stripped"
442	default ""
443	depends on BR2_STRIP_strip
444	help
445	  You may specify a space-separated list of binaries and
446	  libraries here that should not be stripped on the target.
447
448config BR2_STRIP_EXCLUDE_DIRS
449	string "directories that should be skipped when stripping"
450	default ""
451	depends on BR2_STRIP_strip
452	help
453	  You may specify a space-separated list of directories that
454	  should be skipped when stripping. Binaries and libraries in
455	  these directories will not be touched. The directories should
456	  be specified relative to the target directory, without leading
457	  slash.
458
459choice
460	prompt "gcc optimization level"
461	default BR2_OPTIMIZE_S
462	help
463	  Set the optimization level for gcc
464
465config BR2_OPTIMIZE_0
466	bool "optimization level 0"
467	help
468	  Do not optimize.
469
470config BR2_OPTIMIZE_1
471	bool "optimization level 1"
472	help
473	  Optimize. Optimizing compilation takes somewhat more time, and
474	  a lot more memory for a large function. With -O, the compiler
475	  tries to reduce code size and execution time, without
476	  performing any optimizations that take a great deal of
477	  compilation time. -O turns on the following optimization
478	  flags: -fdefer-pop -fdelayed-branch -fguess-branch-probability
479	  -fcprop-registers -floop-optimize -fif-conversion
480	  -fif-conversion2 -ftree-ccp -ftree-dce -ftree-dominator-opts
481	  -ftree-dse -ftree-ter -ftree-lrs -ftree-sra -ftree-copyrename
482	  -ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants. -O
483	  also turns on -fomit-frame-pointer on machines where doing so
484	  does not interfere with debugging.
485
486config BR2_OPTIMIZE_2
487	bool "optimization level 2"
488	help
489	  Optimize even more. GCC performs nearly all supported
490	  optimizations that do not involve a space-speed tradeoff. The
491	  compiler does not perform loop unrolling or function inlining
492	  when you specify -O2. As compared to -O, this option increases
493	  both compilation time and the performance of the generated
494	  code. -O2 turns on all optimization flags specified by -O. It
495	  also turns on the following optimization flags:
496	  -fthread-jumps -fcrossjumping -foptimize-sibling-calls
497	  -fcse-follow-jumps -fcse-skip-blocks -fgcse  -fgcse-lm
498	  -fexpensive-optimizations -fstrength-reduce
499	  -frerun-cse-after-loop -frerun-loop-opt -fcaller-saves
500	  -fpeephole2 -fschedule-insns -fschedule-insns2
501	  -fsched-interblock -fsched-spec -fregmove -fstrict-aliasing
502	  -fdelete-null-pointer-checks -freorder-blocks
503	  -freorder-functions -falign-functions -falign-jumps
504	  -falign-loops -falign-labels -ftree-vrp -ftree-pre. Please
505	  note the warning under -fgcse about invoking -O2 on programs
506	  that use computed gotos.
507
508config BR2_OPTIMIZE_3
509	bool "optimization level 3"
510	help
511	  Optimize yet more. -O3 turns on all optimizations specified by
512	  -O2 and also turns on the -finline-functions, -funswitch-loops
513	  and -fgcse-after-reload options.
514
515config BR2_OPTIMIZE_G
516	bool "optimize for debugging"
517	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
518	help
519	  Optimize for debugging. This enables optimizations that do not
520	  interfere with debugging. It should be the optimization level
521	  of choice for the standard edit-compile-debug cycle, offering
522	  a reasonable level of optimization while maintaining fast
523	  compilation and a good debugging experience.
524
525config BR2_OPTIMIZE_S
526	bool "optimize for size"
527	help
528	  Optimize for size. -Os enables all -O2 optimizations that do
529	  not typically increase code size. It also performs further
530	  optimizations designed to reduce code size. -Os disables the
531	  following optimization flags: -falign-functions -falign-jumps
532	  -falign-loops -falign-labels -freorder-blocks
533	  -freorder-blocks-and-partition -fprefetch-loop-arrays
534	  -ftree-vect-loop-version
535	  This is the default.
536
537config BR2_OPTIMIZE_FAST
538	bool "optimize for fast (may break packages!)"
539	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_6
540	help
541	  Optimize for fast. Disregard strict standards
542	  compliance. -Ofast enables all -O3 optimizations. It also
543	  enables optimizations that are not valid for all
544	  standard-compliant programs, so be careful, as it may break
545	  some packages. It turns on -ffast-math and the
546	  Fortran-specific -fstack-arrays, unless -fmax-stack-var-size
547	  is specified, and -fno-protect-parens.
548
549endchoice
550
551config BR2_GOOGLE_BREAKPAD_ENABLE
552	bool "Enable google-breakpad support"
553	depends on BR2_INSTALL_LIBSTDCPP
554	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
555	depends on BR2_USE_WCHAR
556	depends on BR2_TOOLCHAIN_HAS_THREADS
557	depends on (BR2_TOOLCHAIN_USES_GLIBC || BR2_TOOLCHAIN_USES_UCLIBC)
558	depends on BR2_PACKAGE_GOOGLE_BREAKPAD_ARCH_SUPPORTS
559	depends on BR2_PACKAGE_HOST_GOOGLE_BREAKPAD_ARCH_SUPPORTS
560	select BR2_PACKAGE_GOOGLE_BREAKPAD
561	help
562	  This option will enable the use of google breakpad, a library
563	  and tool suite that allows you to distribute an application to
564	  users with compiler-provided debugging information removed,
565	  record crashes in compact "minidump" files, send them back to
566	  your server and produce C and C++ stack traces from these
567	  minidumps. Breakpad can also write minidumps on request for
568	  programs that have not crashed.
569
570if BR2_GOOGLE_BREAKPAD_ENABLE
571
572config BR2_GOOGLE_BREAKPAD_INCLUDE_FILES
573	string "List of executables and libraries to extract symbols from"
574	default ""
575	help
576	  You may specify a space-separated list of binaries and
577	  libraries with full paths relative to $(TARGET_DIR) of which
578	  debug symbols will be dumped for further use with google
579	  breakpad.
580
581	  A directory structure that can be used by minidump-stackwalk
582	  will be created at:
583
584	  $(STAGING_DIR)/usr/share/google-breakpad-symbols
585
586endif
587
588choice
589	bool "libraries"
590	default BR2_SHARED_LIBS if BR2_BINFMT_SUPPORTS_SHARED
591	default BR2_STATIC_LIBS if !BR2_BINFMT_SUPPORTS_SHARED
592	help
593	  Select the type of libraries you want to use on the target.
594
595	  The default is to build dynamic libraries and use those on the
596	  target filesystem, except when the architecture and/or the
597	  selected binary format does not support shared libraries.
598
599config BR2_STATIC_LIBS
600	bool "static only"
601	help
602	  Build and use only static libraries. No shared libraries will
603	  be installed on the target. This potentially increases your
604	  code size and should only be used if you know what you are
605	  doing. Note that some packages may not be available when this
606	  option is enabled, due to their need for dynamic library
607	  support.
608
609config BR2_SHARED_LIBS
610	bool "shared only"
611	depends on BR2_BINFMT_SUPPORTS_SHARED
612	help
613	  Build and use only shared libraries. This is the recommended
614	  solution as it saves space and build time.
615
616config BR2_SHARED_STATIC_LIBS
617	bool "both static and shared"
618	depends on BR2_BINFMT_SUPPORTS_SHARED
619	help
620	  Build both shared and static libraries, but link executables
621	  dynamically. While building both shared and static libraries
622	  take more time and more disk space, having static libraries
623	  may be useful to link some of the applications statically.
624
625endchoice
626
627config BR2_PACKAGE_OVERRIDE_FILE
628	string "location of a package override file"
629	default "$(CONFIG_DIR)/local.mk"
630	help
631	  A package override file is a short makefile that contains
632	  variable definitions of the form <pkg>_OVERRIDE_SRCDIR, which
633	  allows to tell Buildroot to use an existing directory as the
634	  source directory for a particular package. See the Buildroot
635	  documentation for more details on this feature.
636
637config BR2_GLOBAL_PATCH_DIR
638	string "global patch directories"
639	help
640	  You may specify a space separated list of one or more
641	  directories containing global package patches. For a specific
642	  version <packageversion> of a specific package <packagename>,
643	  patches are applied as follows:
644
645	  First, the default Buildroot patch set for the package is
646	  applied from the package's directory in Buildroot.
647
648	  Then for every directory - <global-patch-dir> - that exists in
649	  BR2_GLOBAL_PATCH_DIR, if the directory
650	  <global-patch-dir>/<packagename>/<packageversion>/ exists,
651	  then all *.patch files in this directory will be applied.
652
653	  Otherwise, if the directory <global-patch-dir>/<packagename>
654	  exists, then all *.patch files in the directory will be
655	  applied.
656
657menu "Advanced"
658
659config BR2_COMPILER_PARANOID_UNSAFE_PATH
660	bool "paranoid check of library/header paths"
661	default y
662	help
663	  By default, when this option is disabled, when the Buildroot
664	  cross-compiler will encounter an unsafe library or header path
665	  (such as /usr/include, or /usr/lib), the compiler will display
666	  a warning.
667
668	  By enabling this option, this warning is turned into an error,
669	  which will completely abort the build when such unsafe paths
670	  are encountered.
671
672	  Note that this mechanism is available for both the internal
673	  toolchain (through the toolchain wrapper and binutils patches)
674	  and external toolchain backends (through the toolchain
675	  wrapper).
676
677config BR2_FORCE_HOST_BUILD
678	bool "Force the building of host dependencies"
679	help
680	  Build all available host dependencies, even if they are
681	  already installed on the system.
682
683	  This option can be used to ensure that the download cache of
684	  source archives for packages remain consistent between
685	  different build hosts.
686
687	  This option will increase build time.
688
689config BR2_REPRODUCIBLE
690	bool "Make the build reproducible (experimental)"
691	# SOURCE_DATE_EPOCH support in toolchain-wrapper requires GCC 4.4
692	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_4
693	help
694	  This option will remove all sources of non-reproducibility
695	  from the build process. For a given Buildroot configuration,
696	  this allows to generate exactly identical binaries from one
697	  build to the other, including on different machines.
698
699	  The current implementation is restricted to builds with the
700	  same output directory. Many (absolute) paths are recorded in
701	  intermediary files, and it is very likely that some of these
702	  paths leak into the target rootfs. If you build with the
703	  same O=... path, however, the result is identical.
704
705	  This is labeled as an experimental feature, as not all
706	  packages behave properly to ensure reproducibility.
707
708config BR2_PER_PACKAGE_DIRECTORIES
709	bool "Use per-package directories (experimental)"
710	help
711	  This option will change the build process of Buildroot
712	  package to use per-package target and host directories.
713
714	  This is useful for two related purposes:
715
716	    - Cleanly isolate the build of each package, so that a
717	      given package only "sees" the dependencies it has
718	      explicitly expressed, and not other packages that may
719	      have by chance been built before.
720
721	    - Enable top-level parallel build.
722
723	  This is labeled as an experimental feature, as not all
724	  packages behave properly with per-package directories.
725
726endmenu
727
728comment "Security Hardening Options"
729
730config BR2_PIC_PIE_ARCH_SUPPORTS
731	bool
732	default y
733	# Microblaze glibc toolchains don't work with PIC/PIE enabled
734	depends on !BR2_microblaze
735	# Nios2 toolchains produce non working binaries with -fPIC
736	depends on !BR2_nios2
737
738config BR2_PIC_PIE
739	bool "Build code with PIC/PIE"
740	default y
741	depends on BR2_PIC_PIE_ARCH_SUPPORTS
742	depends on BR2_SHARED_LIBS
743	depends on BR2_TOOLCHAIN_SUPPORTS_PIE
744	help
745	  Generate Position-Independent Code (PIC) and link
746	  Position-Independent Executables (PIE).
747
748comment "PIC/PIE needs a toolchain w/ PIE"
749	depends on BR2_PIC_PIE_ARCH_SUPPORTS
750	depends on BR2_SHARED_LIBS
751	depends on !BR2_TOOLCHAIN_SUPPORTS_PIE
752
753choice
754	bool "Stack Smashing Protection"
755	default BR2_SSP_ALL if BR2_ENABLE_SSP # legacy
756	default BR2_SSP_STRONG if BR2_TOOLCHAIN_HAS_SSP_STRONG
757	default BR2_SSP_REGULAR
758	depends on BR2_TOOLCHAIN_HAS_SSP
759	help
760	  Enable stack smashing protection support using GCC's
761	  -fstack-protector option family.
762
763	  See
764	  http://www.linuxfromscratch.org/hints/downloads/files/ssp.txt
765	  for details.
766
767	  Note that this requires the toolchain to have SSP support.
768	  This is always the case for glibc and eglibc toolchain, but is
769	  optional in uClibc toolchains.
770
771config BR2_SSP_NONE
772	bool "None"
773	help
774	  Disable stack-smashing protection.
775
776config BR2_SSP_REGULAR
777	bool "-fstack-protector"
778	help
779	  Emit extra code to check for buffer overflows, such as stack
780	  smashing attacks. This is done by adding a guard variable to
781	  functions with vulnerable objects. This includes functions
782	  that call alloca, and functions with buffers larger than 8
783	  bytes. The guards are initialized when a function is entered
784	  and then checked when the function exits. If a guard check
785	  fails, an error message is printed and the program exits.
786
787config BR2_SSP_STRONG
788	bool "-fstack-protector-strong"
789	depends on BR2_TOOLCHAIN_HAS_SSP_STRONG
790	help
791	  Like -fstack-protector but includes additional functions to be
792	  protected - those that have local array definitions, or have
793	  references to local frame addresses.
794
795	  -fstack-protector-strong officially appeared in gcc 4.9, but
796	  some vendors have backported -fstack-protector-strong to older
797	  versions of gcc.
798
799config BR2_SSP_ALL
800	bool "-fstack-protector-all"
801	help
802	  Like -fstack-protector except that all functions are
803	  protected. This option might have a significant performance
804	  impact on the compiled binaries.
805
806endchoice
807
808config BR2_SSP_OPTION
809	string
810	default "-fstack-protector"        if BR2_SSP_REGULAR
811	default "-fstack-protector-strong" if BR2_SSP_STRONG
812	default "-fstack-protector-all"    if BR2_SSP_ALL
813
814comment "Stack Smashing Protection needs a toolchain w/ SSP"
815	depends on !BR2_TOOLCHAIN_HAS_SSP
816
817choice
818	bool "RELRO Protection"
819	default BR2_RELRO_FULL if BR2_TOOLCHAIN_SUPPORTS_PIE
820	default BR2_RELRO_PARTIAL
821	depends on BR2_SHARED_LIBS
822	help
823	  Enable a link-time protection know as RELRO (RELocation Read
824	  Only) which helps to protect from certain type of exploitation
825	  techniques altering the content of some ELF sections.
826
827config BR2_RELRO_NONE
828	bool "None"
829	help
830	  Disables Relocation link-time protections.
831
832config BR2_RELRO_PARTIAL
833	bool "Partial"
834	help
835	  This option makes the dynamic section not writeable after
836	  initialization (with almost no performance penalty).
837
838config BR2_RELRO_FULL
839	bool "Full"
840	depends on BR2_PIC_PIE_ARCH_SUPPORTS
841	depends on BR2_TOOLCHAIN_SUPPORTS_PIE
842	select BR2_PIC_PIE
843	help
844	  This option includes the partial configuration, but also marks
845	  the GOT as read-only at the cost of initialization time during
846	  program loading, i.e every time an executable is started.
847
848comment "RELRO Full needs a toolchain w/ PIE"
849	depends on BR2_PIC_PIE_ARCH_SUPPORTS
850	depends on !BR2_TOOLCHAIN_SUPPORTS_PIE
851
852endchoice
853
854comment "RELocation Read Only (RELRO) needs shared libraries"
855	depends on !BR2_SHARED_LIBS
856
857config BR2_FORTIFY_SOURCE_ARCH_SUPPORTS
858	bool
859	default y
860	# Microblaze glibc toolchains don't work with Fortify Source enabled
861	depends on !BR2_microblaze
862
863choice
864	bool "Buffer-overflow Detection (FORTIFY_SOURCE)"
865	default BR2_FORTIFY_SOURCE_1
866	depends on BR2_FORTIFY_SOURCE_ARCH_SUPPORTS
867	depends on BR2_TOOLCHAIN_USES_GLIBC
868	depends on !BR2_OPTIMIZE_0
869	help
870	  Enable the _FORTIFY_SOURCE macro which introduces additional
871	  checks to detect buffer-overflows in the following standard
872	  library functions: memcpy, mempcpy, memmove, memset, strcpy,
873	  stpcpy, strncpy, strcat, strncat, sprintf, vsprintf, snprintf,
874	  vsnprintf, gets.
875
876	  NOTE: This feature requires an optimization level of s/1/2/3/g
877
878	  Support for this feature has been present since GCC 4.x.
879
880config BR2_FORTIFY_SOURCE_NONE
881	bool "None"
882	help
883	  Disables additional checks to detect buffer-overflows.
884
885config BR2_FORTIFY_SOURCE_1
886	bool "Conservative"
887	# gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61164
888	depends on !BR2_TOOLCHAIN_BUILDROOT || BR2_TOOLCHAIN_GCC_AT_LEAST_6
889	help
890	  This option sets _FORTIFY_SOURCE to 1 and only introduces
891	  checks that shouldn't change the behavior of conforming
892	  programs.  Adds checks at compile-time only.
893
894config BR2_FORTIFY_SOURCE_2
895	bool "Aggressive"
896	# gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61164
897	depends on !BR2_TOOLCHAIN_BUILDROOT || BR2_TOOLCHAIN_GCC_AT_LEAST_6
898	help
899	  This option sets _FORTIFY_SOURCES to 2 and some more
900	  checking is added, but some conforming programs might fail.
901	  Also adds checks at run-time (detected buffer overflow
902	  terminates the program)
903
904endchoice
905
906comment "Fortify Source needs a glibc toolchain and optimization"
907	depends on BR2_FORTIFY_SOURCE_ARCH_SUPPORTS
908	depends on (!BR2_TOOLCHAIN_USES_GLIBC || BR2_OPTIMIZE_0)
909endmenu
910
911source "toolchain/Config.in"
912
913source "system/Config.in"
914
915source "linux/Config.in"
916
917source "package/Config.in"
918
919source "fs/Config.in"
920
921source "boot/Config.in"
922
923source "package/Config.in.host"
924
925source "Config.in.legacy"
926
927# br2-external menus definitions
928source "$BR2_BASE_DIR/.br2-external.in.menus"
929