summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>2019-03-30 15:29:23 +0100
committerChristoph Müllner <christophm30@gmail.com>2019-04-26 00:52:31 +0200
commitd7069a792b300f0d8bfccaff05f60d26a2096053 (patch)
treedef7b49210e59859d2b8e53d086df287aa9a9f07
parentc46c0efe7f9260adfdd1ed620143685b8dc26412 (diff)
tools/Makefile: build host tools with -std=gnu99
Parts of the code are using C99 constructs (such as variables declared inside loops), but also GNU extensions (such as typeof), so using -std=gnu99 is necessary to build with older versions of gcc that don't default to building with gnu99. It fixes the following build failure: ./tools/../lib/crc16.c: In function "crc16_ccitt": ./tools/../lib/crc16.c:70:2: error: "for" loop initial declarations are only allowed in C99 mode for (int i = 0; i < len; i++) ^ ./tools/../lib/crc16.c:70:2: note: use option -std=c99 or -std=gnu99 to compile your code when building the host tools with gcc 4.7. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
-rw-r--r--tools/Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/Makefile b/tools/Makefile
index 081383d7a7..d377d85f74 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -254,7 +254,8 @@ HOST_EXTRACFLAGS += -include $(srctree)/include/compiler.h \
-I$(srctree)/tools \
-DUSE_HOSTCC \
-D__KERNEL_STRICT_NAMES \
- -D_GNU_SOURCE
+ -D_GNU_SOURCE \
+ -std=gnu99
__build: $(LOGO-y)