diff options
author | Joel Stanley <joel@jms.id.au> | 2015-07-21 12:53:14 +0930 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-08-13 15:51:08 +1000 |
commit | eff042167b9e10a94b6f036f9a54e23b2978269a (patch) | |
tree | bd03098ac9339c5ee25e1e9ccc0f2f5ad30ac0f2 /Makefile.main | |
parent | 54305537911a1028afb5e15bf66e17ef8c0163ef (diff) | |
download | skiboot-eff042167b9e10a94b6f036f9a54e23b2978269a.zip skiboot-eff042167b9e10a94b6f036f9a54e23b2978269a.tar.gz skiboot-eff042167b9e10a94b6f036f9a54e23b2978269a.tar.bz2 |
Enforce GNU 11 as default C dialect
We do not set a C version level, leaving it to the compiler to enforce
whatever it saw fit.
We require GCC 4.8 or above, which supports C11, and GCC 5.2 and clang
3.7 default to this version of the standard, so set it as the default.
Signed-off-by: Joel Stanley <joel@jms.id.au>
[stewart@linux.vnet.ibm.com: rework to use new try-cflag magic]
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'Makefile.main')
-rw-r--r-- | Makefile.main | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Makefile.main b/Makefile.main index d0e5f58..ec9bafb 100644 --- a/Makefile.main +++ b/Makefile.main @@ -34,6 +34,7 @@ CWARNS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ HOSTCC=gcc HOSTEND=$(shell uname -m | sed -e 's/^i.*86$$/LITTLE/' -e 's/^x86.*/LITTLE/' -e 's/^ppc64le/LITTLE/' -e 's/^ppc.*/BIG/') HOSTCFLAGS=-O1 $(CWARNS) -DHAVE_$(HOSTEND)_ENDIAN -MMD +HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-std=gnu11) HOSTCFLAGS += $(call try-cflag,$(HOSTCC),-Wjump-misses-init) \ $(call try-cflag,$(HOSTCC),-Wsuggest-attribute=const) \ $(call try-cflag,$(HOSTCC),-Wsuggest-attribute=noreturn) \ @@ -62,6 +63,7 @@ CPPFLAGS += -ffreestanding CFLAGS := -fno-strict-aliasing -fstack-protector-all -pie -mbig-endian -m64 CFLAGS += -Wl,--oformat,elf64-powerpc CFLAGS += $(call try-cflag,$(CC),-mabi=elfv1) +CFLAGS += $(call try-cflag,$(CC),-std=gnu11) ifeq ($(SKIBOOT_GCOV),1) CFLAGS += -fprofile-arcs -ftest-coverage -DSKIBOOT_GCOV=1 |