aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-06-30 08:19:52 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-06-30 08:19:52 +0000
commit82e2bf64dc34d021a9bea84bfff61c3b35bcc4ec (patch)
treefe2a9ad87040b745475ec0190d37ffe08ed60c93 /include
parente59dd23a465f4c83c933efc669be2d86f6380410 (diff)
downloadupstream-82e2bf64dc34d021a9bea84bfff61c3b35bcc4ec.tar.gz
upstream-82e2bf64dc34d021a9bea84bfff61c3b35bcc4ec.tar.bz2
upstream-82e2bf64dc34d021a9bea84bfff61c3b35bcc4ec.zip
build: Introduce PKG_CHECK_FORMAT_SECURITY
The idea is to get rid of http://en.wikipedia.org/wiki/Uncontrolled_format_string by using "-Wformat -Werror=format-security" by default Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41412 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'include')
-rw-r--r--include/package.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/package.mk b/include/package.mk
index f7da9e3499..7d75f08444 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -14,6 +14,7 @@ PKG_INSTALL_DIR ?= $(PKG_BUILD_DIR)/ipkg-install
PKG_MD5SUM ?= unknown
PKG_BUILD_PARALLEL ?=
PKG_USE_MIPS16 ?= 1
+PKG_CHECK_FORMAT_SECURITY ?= 1
ifneq ($(CONFIG_PKG_BUILD_USE_JOBSERVER),)
MAKE_J:=$(if $(MAKE_JOBSERVER),$(MAKE_JOBSERVER) -j)
@@ -33,6 +34,9 @@ ifdef CONFIG_USE_MIPS16
TARGET_CFLAGS += -mips16 -minterlink-mips16
endif
endif
+ifeq ($(strip $(PKG_CHECK_FORMAT_SECURITY)),1)
+ TARGET_CFLAGS += -Wformat -Werror=format-security
+endif
include $(INCLUDE_DIR)/prereq.mk
include $(INCLUDE_DIR)/host.mk