--- old/make/linux/makefiles/gcc.make 2012-09-21 10:48:33.245306848 -0400 +++ new/make/linux/makefiles/gcc.make 2012-09-21 10:48:32.177346590 -0400 @@ -116,11 +116,6 @@ CFLAGS += -DCC_INTERP endif -# Build for embedded targets -ifdef JAVASE_EMBEDDED - CFLAGS += -DJAVASE_EMBEDDED -endif - # Keep temporary files (.ii, .s) ifdef NEED_ASM CFLAGS += -save-temps @@ -146,17 +141,26 @@ CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) # The flags to use for an Optimized g++ build -OPT_CFLAGS += -O3 +OPT_CFLAGS/SIZE=-Os +OPT_CFLAGS/SPEED=-O3 # Hotspot uses very unstrict aliasing turn this optimization off -OPT_CFLAGS += -fno-strict-aliasing +OPT_EXTRAS += -fno-strict-aliasing # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp # if we use expensive-optimizations ifeq ($(BUILDARCH), ia64) -OPT_CFLAGS += -fno-expensive-optimizations +OPT_EXTRAS += -fno-expensive-optimizations +endif + +OPT_CFLAGS_DEFAULT ?= SPEED + +ifdef OPT_CFLAGS + $(error "$(OPT_CFLAGS) Use OPT_CFLAGS_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS") endif +OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS) + OPT_CFLAGS/NOOPT=-O0 # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.