Config-build.in 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  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_LIBSTDCXX
  164. bool "libstdc++"
  165. endchoice
  166. comment "Hardening build options"
  167. config PKG_CHECK_FORMAT_SECURITY
  168. bool
  169. prompt "Enable gcc format-security"
  170. default y
  171. help
  172. Add -Wformat -Werror=format-security to the CFLAGS. You can disable
  173. this per package by adding PKG_CHECK_FORMAT_SECURITY:=0 in the package
  174. Makefile.
  175. config PKG_ASLR_PIE
  176. bool
  177. prompt "User space ASLR PIE compilation"
  178. select BUSYBOX_DEFAULT_PIE
  179. default n
  180. help
  181. Add -fPIC to CFLAGS and -specs=hardened-build-ld to LDFLAGS.
  182. This enables package build as Position Independent Executables (PIE)
  183. to protect against "return-to-text" attacks. This belongs to the
  184. feature of Address Space Layout Randomisation (ASLR), which is
  185. implemented by the kernel and the ELF loader by randomising the
  186. location of memory allocations. This makes memory addresses harder
  187. to predict when an attacker is attempting a memory-corruption exploit.
  188. You can disable this per package by adding PKG_ASLR_PIE:=0 in the package
  189. Makefile.
  190. choice
  191. prompt "User space Stack-Smashing Protection"
  192. depends on USE_MUSL
  193. default PKG_CC_STACKPROTECTOR_REGULAR
  194. help
  195. Enable GCC Stack Smashing Protection (SSP) for userspace applications
  196. config PKG_CC_STACKPROTECTOR_NONE
  197. bool "None"
  198. config PKG_CC_STACKPROTECTOR_REGULAR
  199. bool "Regular"
  200. select GCC_LIBSSP if !USE_MUSL
  201. depends on KERNEL_CC_STACKPROTECTOR_REGULAR
  202. config PKG_CC_STACKPROTECTOR_STRONG
  203. bool "Strong"
  204. select GCC_LIBSSP if !USE_MUSL
  205. depends on KERNEL_CC_STACKPROTECTOR_STRONG
  206. endchoice
  207. choice
  208. prompt "Kernel space Stack-Smashing Protection"
  209. default KERNEL_CC_STACKPROTECTOR_REGULAR
  210. depends on USE_MUSL || !(x86_64 || i386)
  211. help
  212. Enable GCC Stack-Smashing Protection (SSP) for the kernel
  213. config KERNEL_CC_STACKPROTECTOR_NONE
  214. bool "None"
  215. config KERNEL_CC_STACKPROTECTOR_REGULAR
  216. bool "Regular"
  217. config KERNEL_CC_STACKPROTECTOR_STRONG
  218. bool "Strong"
  219. endchoice
  220. config KERNEL_STACKPROTECTOR
  221. bool
  222. default KERNEL_CC_STACKPROTECTOR_REGULAR || KERNEL_CC_STACKPROTECTOR_STRONG
  223. config KERNEL_STACKPROTECTOR_STRONG
  224. bool
  225. default KERNEL_CC_STACKPROTECTOR_STRONG
  226. choice
  227. prompt "Enable buffer-overflows detection (FORTIFY_SOURCE)"
  228. default PKG_FORTIFY_SOURCE_1
  229. help
  230. Enable the _FORTIFY_SOURCE macro which introduces additional
  231. checks to detect buffer-overflows in the following standard library
  232. functions: memcpy, mempcpy, memmove, memset, strcpy, stpcpy,
  233. strncpy, strcat, strncat, sprintf, vsprintf, snprintf, vsnprintf,
  234. gets. "Conservative" (_FORTIFY_SOURCE set to 1) only introduces
  235. checks that shouldn't change the behavior of conforming programs,
  236. while "aggressive" (_FORTIFY_SOURCES set to 2) some more checking is
  237. added, but some conforming programs might fail.
  238. config PKG_FORTIFY_SOURCE_NONE
  239. bool "None"
  240. config PKG_FORTIFY_SOURCE_1
  241. bool "Conservative"
  242. config PKG_FORTIFY_SOURCE_2
  243. bool "Aggressive"
  244. endchoice
  245. choice
  246. prompt "Enable RELRO protection"
  247. default PKG_RELRO_FULL
  248. help
  249. Enable a link-time protection known as RELRO (Relocation Read Only)
  250. which helps to protect from certain type of exploitation techniques
  251. altering the content of some ELF sections. "Partial" RELRO makes the
  252. .dynamic section not writeable after initialization, introducing
  253. almost no performance penalty, while "full" RELRO also marks the GOT
  254. as read-only at the cost of initializing all of it at startup.
  255. config PKG_RELRO_NONE
  256. bool "None"
  257. config PKG_RELRO_PARTIAL
  258. bool "Partial"
  259. config PKG_RELRO_FULL
  260. bool "Full"
  261. endchoice
  262. endmenu