--- old/make/linux/makefiles/vm.make 2018-09-04 17:07:11.524138539 +0200 +++ new/make/linux/makefiles/vm.make 2018-09-04 17:07:11.369138841 +0200 @@ -121,7 +121,13 @@ CFLAGS += $(CFLAGS/NOEX) # Extra flags from gnumake's invocation or environment -CFLAGS += $(EXTRA_CFLAGS) +# +# Disallow lowering of hotspot optimization via +# EXTRA_CFLAGS. This is controlled via +# OPT_EXTRAS make variable if so desired. See +# JDK-8210352 for more info. +CFLAGS += $(subst -O0,, $(subst -O2,, \ + $(subst -O1,, $(EXTRA_CFLAGS)))) LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) # Don't set excutable bit on stack segment