PKG_CHECK_FORMAT_SECURITY: add a menuconfig option, disable by default
authorJohn Crispin <john@openwrt.org>
Mon, 25 Aug 2014 06:36:06 +0000 (06:36 +0000)
committerJohn Crispin <john@openwrt.org>
Mon, 25 Aug 2014 06:36:06 +0000 (06:36 +0000)
The idea is still to enable it by default at some point
I've tested all ar71xx packages (except oldpackages) using CONFIG_ALL=y
Failing packages have been marked with PKG_CHECK_FORMAT_SECURITY:=0 for now
I can test more targets but i have no idea which are the most used

Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>
SVN-Revision: 42282

config/Config-build.in
include/package.mk

index 371ae7632adf053023e1a5e55b7a543b8a441c86..02fe1367914ebad91d5417161c31d900f58d5aee 100644 (file)
@@ -93,6 +93,15 @@ menu "Global build settings"
 
                  If you are unsure, select N.
 
 
                  If you are unsure, select N.
 
+       config PKG_CHECK_FORMAT_SECURITY
+               bool
+               prompt "Enable gcc format-security"
+               default n
+               help
+                 Add -Wformat -Werror=format-security to the CFLAGS
+                 You can disable this per package by adding
+                 PKG_CHECK_FORMAT_SECURITY:=0 in the package Makefile
+
        config PKG_BUILD_USE_JOBSERVER
                bool
                prompt "Use top-level make jobserver for packages"
        config PKG_BUILD_USE_JOBSERVER
                bool
                prompt "Use top-level make jobserver for packages"
index 88ec3ef57f5f3aad2eb67700e7a1e72a00acb0f8..1cdab6b447000584e2340981cd5db3fad7676284 100644 (file)
@@ -14,7 +14,7 @@ PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
 PKG_MD5SUM ?= unknown
 PKG_BUILD_PARALLEL ?=
 PKG_USE_MIPS16 ?= 1
 PKG_MD5SUM ?= unknown
 PKG_BUILD_PARALLEL ?=
 PKG_USE_MIPS16 ?= 1
-PKG_CHECK_FORMAT_SECURITY ?= 0
+PKG_CHECK_FORMAT_SECURITY ?= 1
 
 ifneq ($(CONFIG_PKG_BUILD_USE_JOBSERVER),)
   MAKE_J:=$(if $(MAKE_JOBSERVER),$(MAKE_JOBSERVER) -j)
 
 ifneq ($(CONFIG_PKG_BUILD_USE_JOBSERVER),)
   MAKE_J:=$(if $(MAKE_JOBSERVER),$(MAKE_JOBSERVER) -j)
@@ -34,8 +34,10 @@ ifdef CONFIG_USE_MIPS16
     TARGET_CFLAGS += -mips16 -minterlink-mips16
   endif
 endif
     TARGET_CFLAGS += -mips16 -minterlink-mips16
   endif
 endif
-ifeq ($(strip $(PKG_CHECK_FORMAT_SECURITY)),1)
-  TARGET_CFLAGS += -Wformat -Werror=format-security
+ifdef CONFIG_PKG_CHECK_FORMAT_SECURITY
+  ifeq ($(strip $(PKG_CHECK_FORMAT_SECURITY)),1)
+    TARGET_CFLAGS += -Wformat -Werror=format-security
+  endif
 endif
 
 include $(INCLUDE_DIR)/prereq.mk
 endif
 
 include $(INCLUDE_DIR)/prereq.mk