changeset 4123:59828109820c

8151841: Build needs additional flags to compile with GCC 6 Summary: C++ standard needs to be explicitly set and some optimisations turned off to build on GCC 6 Reviewed-by: erikj, dholmes, kbarrett
author andrew
date Fri, 08 Jul 2016 01:58:45 +0100
parents 7561dfbeeee5
children 1e5be96d5c48
files make/linux/makefiles/gcc.make
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/make/linux/makefiles/gcc.make	Wed May 04 23:23:54 2016 +0100
+++ b/make/linux/makefiles/gcc.make	Fri Jul 08 01:58:45 2016 +0100
@@ -73,6 +73,7 @@
 ifeq ($(SHARK_BUILD), true)
 CFLAGS += $(LLVM_CFLAGS)
 endif
+CFLAGS += -std=gnu++98
 CFLAGS += $(VM_PICFLAG)
 CFLAGS += -fno-rtti
 CFLAGS += -fno-exceptions
@@ -83,6 +84,12 @@
 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
 CFLAGS += -fvisibility=hidden
 endif
+# GCC 6 has more aggressive dead-store elimination which causes the VM to crash
+# It also optimises away null pointer checks which are still needed.
+# We turn both of these optimisations off.
+ifneq "$(shell expr \( $(CC_VER_MAJOR) \>= 6 \))" "0"
+CFLAGS += -fno-delete-null-pointer-checks -fno-lifetime-dse
+endif
 
 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
 ARCHFLAG/i486    = -m32 -march=i586