Config-build.in 8.9 KB

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