Author: nbd
Date: 2014-06-30 10:19:52 +0200 (Mon, 30 Jun 2014)
New Revision: 41412

Modified:
   trunk/include/package.mk
Log:
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 <[email protected]>

Modified: trunk/include/package.mk
===================================================================
--- trunk/include/package.mk    2014-06-30 08:19:48 UTC (rev 41411)
+++ trunk/include/package.mk    2014-06-30 08:19:52 UTC (rev 41412)
@@ -14,6 +14,7 @@
 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 @@
     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
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to