]> git.sur5r.net Git - u-boot/blobdiff - Makefile
Makefile: adopt --std=gnu11 for HOSTCFLAGS on Linux
[u-boot] / Makefile
index f31ee60e4cca35a3aa2930fe34c3d65dbc7e740a..d08fb6a54d5a7bccd98272744e9b5744c144df05 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -258,6 +258,15 @@ HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
                $(if $(CONFIG_TOOLS_DEBUG),-g)
 HOSTCXXFLAGS = -O2
 
+# With the move to GCC 6, we have implicitly upgraded our language
+# standard to GNU11 (see https://gcc.gnu.org/gcc-5/porting_to.html).
+# Some Linux distributions (including RHEL7, SLES13, Debian 8) still
+# have older compilers as their default, so we make it explicit for
+# these that our host tools are GNU11 (i.e. C11 w/ GNU extensions).
+ifeq ($(HOSTOS),linux)
+HOSTCFLAGS += --std=gnu11
+endif
+
 ifeq ($(HOSTOS),cygwin)
 HOSTCFLAGS     += -ansi
 endif