1
0

Config-build.in 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. # Copyright (C) 2006-2013 OpenWrt.org
  2. # Copyright (C) 2016 LEDE Project
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. menu "Global build settings"
  8. config ALL_NONSHARED
  9. bool "Select all target specific packages by default"
  10. select ALL_KMODS
  11. default BUILDBOT
  12. config ALL_KMODS
  13. bool "Select all kernel module packages by default"
  14. config ALL
  15. bool "Select all userspace packages by default"
  16. select ALL_KMODS
  17. select ALL_NONSHARED
  18. config BUILDBOT
  19. bool "Set build defaults for automatic builds (e.g. via buildbot)"
  20. default n
  21. help
  22. This option changes several defaults to be more suitable for
  23. automatic builds. This includes the following changes:
  24. - Deleting build directories after compiling (to save space)
  25. - Enabling per-device rootfs support
  26. ...
  27. config SIGNED_PACKAGES
  28. bool "Cryptographically signed package lists"
  29. default y
  30. config SIGNATURE_CHECK
  31. bool "Enable signature checking in opkg"
  32. default SIGNED_PACKAGES
  33. comment "General build options"
  34. config TESTING_KERNEL
  35. bool "Use the testing kernel version"
  36. depends on HAS_TESTING_KERNEL
  37. default n
  38. help
  39. If the target supports a newer kernel version than the default,
  40. you can use this config option to enable it
  41. config DISPLAY_SUPPORT
  42. bool "Show packages that require graphics support (local or remote)"
  43. default n
  44. config BUILD_PATENTED
  45. default n
  46. bool "Compile with support for patented functionality"
  47. help
  48. When this option is disabled, software which provides patented functionality
  49. will not be built. In case software provides optional support for patented
  50. functionality, this optional support will get disabled for this package.
  51. config BUILD_NLS
  52. default n
  53. bool "Compile with full language support"
  54. help
  55. When this option is enabled, packages are built with the full versions of
  56. iconv and GNU gettext instead of the default libreCMC stubs. If uClibc is
  57. used, it is also built with locale support.
  58. config SHADOW_PASSWORDS
  59. bool
  60. default y
  61. config CLEAN_IPKG
  62. bool
  63. prompt "Remove ipkg/opkg status data files in final images"
  64. default n
  65. help
  66. This removes all ipkg/opkg status data files from the target directory
  67. before building the root filesystem.
  68. config IPK_FILES_CHECKSUMS
  69. bool
  70. prompt "Record files checksums in package metadata"
  71. default n
  72. help
  73. This makes file checksums part of package metadata. It increases size
  74. but provides you with pkg_check command to check for flash coruptions.
  75. config INCLUDE_CONFIG
  76. bool "Include build configuration in firmware" if DEVEL
  77. default n
  78. help
  79. If enabled, config.buildinfo will be stored in /etc/build.config of firmware.
  80. config COLLECT_KERNEL_DEBUG
  81. bool
  82. prompt "Collect kernel debug information"
  83. select KERNEL_DEBUG_INFO
  84. default BUILDBOT
  85. help
  86. This collects debugging symbols from the kernel and all compiled modules.
  87. Useful for release builds, so that kernel issues can be debugged offline
  88. later.
  89. menu "Kernel build options"
  90. source "config/Config-kernel.in"
  91. endmenu
  92. comment "Package build options"
  93. config DEBUG
  94. bool
  95. prompt "Compile packages with debugging info"
  96. default n
  97. help
  98. Adds -g3 to the CFLAGS.
  99. config IPV6
  100. bool
  101. prompt "Enable IPv6 support in packages"
  102. default y
  103. help
  104. Enables IPv6 support in kernel (builtin) and packages.
  105. comment "Stripping options"
  106. choice
  107. prompt "Binary stripping method"
  108. default USE_STRIP if EXTERNAL_TOOLCHAIN
  109. default USE_STRIP if USE_GLIBC
  110. default USE_SSTRIP
  111. help
  112. Select the binary stripping method you wish to use.
  113. config NO_STRIP
  114. bool "none"
  115. help
  116. This will install unstripped binaries (useful for native
  117. compiling/debugging).
  118. config USE_STRIP
  119. bool "strip"
  120. help
  121. This will install binaries stripped using strip from binutils.
  122. config USE_SSTRIP
  123. bool "sstrip"
  124. depends on !USE_GLIBC
  125. help
  126. This will install binaries stripped using sstrip.
  127. endchoice
  128. config STRIP_ARGS
  129. string
  130. prompt "Strip arguments"
  131. depends on USE_STRIP
  132. default "--strip-unneeded --remove-section=.comment --remove-section=.note" if DEBUG
  133. default "--strip-all"
  134. help
  135. Specifies arguments passed to the strip command when stripping binaries.
  136. config STRIP_KERNEL_EXPORTS
  137. bool "Strip unnecessary exports from the kernel image"
  138. help
  139. Reduces kernel size by stripping unused kernel exports from the kernel
  140. image. Note that this might make the kernel incompatible with any kernel
  141. modules that were not selected at the time the kernel image was created.
  142. config USE_MKLIBS
  143. bool "Strip unnecessary functions from libraries"
  144. help
  145. Reduces libraries to only those functions that are necessary for using all
  146. selected packages (including those selected as <M>). Note that this will
  147. make the system libraries incompatible with most of the packages that are
  148. not selected during the build process.
  149. choice
  150. prompt "Preferred standard C++ library"
  151. default USE_LIBSTDCXX if USE_GLIBC
  152. default USE_UCLIBCXX
  153. help
  154. Select the preferred standard C++ library for all packages that support this.
  155. config USE_UCLIBCXX
  156. bool "uClibc++"
  157. config USE_LIBSTDCXX
  158. bool "libstdc++"
  159. endchoice
  160. comment "Hardening build options"
  161. config PKG_CHECK_FORMAT_SECURITY
  162. bool
  163. prompt "Enable gcc format-security"
  164. default y
  165. help
  166. Add -Wformat -Werror=format-security to the CFLAGS. You can disable
  167. this per package by adding PKG_CHECK_FORMAT_SECURITY:=0 in the package
  168. Makefile.
  169. config PKG_ASLR_PIE
  170. bool
  171. prompt "User space ASLR PIE compilation"
  172. select BUSYBOX_DEFAULT_PIE
  173. default n
  174. help
  175. Add -fPIC to CFLAGS and -specs=hardened-build-ld to LDFLAGS.
  176. This enables package build as Position Independent Executables (PIE)
  177. to protect against "return-to-text" attacks. This belongs to the
  178. feature of Address Space Layout Randomisation (ASLR), which is
  179. implemented by the kernel and the ELF loader by randomising the
  180. location of memory allocations. This makes memory addresses harder
  181. to predict when an attacker is attempting a memory-corruption exploit.
  182. You can disable this per package by adding PKG_ASLR_PIE:=0 in the package
  183. Makefile.
  184. choice
  185. prompt "User space Stack-Smashing Protection"
  186. depends on USE_MUSL
  187. default PKG_CC_STACKPROTECTOR_REGULAR
  188. help
  189. Enable GCC Stack Smashing Protection (SSP) for userspace applications
  190. config PKG_CC_STACKPROTECTOR_NONE
  191. bool "None"
  192. config PKG_CC_STACKPROTECTOR_REGULAR
  193. bool "Regular"
  194. select GCC_LIBSSP if !USE_MUSL
  195. depends on KERNEL_CC_STACKPROTECTOR_REGULAR
  196. config PKG_CC_STACKPROTECTOR_STRONG
  197. bool "Strong"
  198. select GCC_LIBSSP if !USE_MUSL
  199. depends on !GCC_VERSION_4_8
  200. depends on KERNEL_CC_STACKPROTECTOR_STRONG
  201. endchoice
  202. choice
  203. prompt "Kernel space Stack-Smashing Protection"
  204. default KERNEL_CC_STACKPROTECTOR_REGULAR
  205. depends on USE_MUSL || !(x86_64 || i386)
  206. help
  207. Enable GCC Stack-Smashing Protection (SSP) for the kernel
  208. config KERNEL_CC_STACKPROTECTOR_NONE
  209. bool "None"
  210. config KERNEL_CC_STACKPROTECTOR_REGULAR
  211. bool "Regular"
  212. config KERNEL_CC_STACKPROTECTOR_STRONG
  213. depends on !GCC_VERSION_4_8
  214. bool "Strong"
  215. endchoice
  216. config KERNEL_STACKPROTECTOR
  217. bool
  218. default KERNEL_CC_STACKPROTECTOR_REGULAR || KERNEL_CC_STACKPROTECTOR_STRONG
  219. config KERNEL_STACKPROTECTOR_STRONG
  220. bool
  221. default KERNEL_CC_STACKPROTECTOR_STRONG
  222. choice
  223. prompt "Enable buffer-overflows detection (FORTIFY_SOURCE)"
  224. default PKG_FORTIFY_SOURCE_1
  225. help
  226. Enable the _FORTIFY_SOURCE macro which introduces additional
  227. checks to detect buffer-overflows in the following standard library
  228. functions: memcpy, mempcpy, memmove, memset, strcpy, stpcpy,
  229. strncpy, strcat, strncat, sprintf, vsprintf, snprintf, vsnprintf,
  230. gets. "Conservative" (_FORTIFY_SOURCE set to 1) only introduces
  231. checks that shouldn't change the behavior of conforming programs,
  232. while "aggressive" (_FORTIFY_SOURCES set to 2) some more checking is
  233. added, but some conforming programs might fail.
  234. config PKG_FORTIFY_SOURCE_NONE
  235. bool "None"
  236. config PKG_FORTIFY_SOURCE_1
  237. bool "Conservative"
  238. config PKG_FORTIFY_SOURCE_2
  239. bool "Aggressive"
  240. endchoice
  241. choice
  242. prompt "Enable RELRO protection"
  243. default PKG_RELRO_FULL
  244. help
  245. Enable a link-time protection known as RELRO (Relocation Read Only)
  246. which helps to protect from certain type of exploitation techniques
  247. altering the content of some ELF sections. "Partial" RELRO makes the
  248. .dynamic section not writeable after initialization, introducing
  249. almost no performance penalty, while "full" RELRO also marks the GOT
  250. as read-only at the cost of initializing all of it at startup.
  251. config PKG_RELRO_NONE
  252. bool "None"
  253. config PKG_RELRO_PARTIAL
  254. bool "Partial"
  255. config PKG_RELRO_FULL
  256. bool "Full"
  257. endchoice
  258. endmenu