Config-build.in 9.4 KB

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