--- old/make/bsd/makefiles/gcc.make 2012-09-17 16:11:44.254315254 -0400 +++ new/make/bsd/makefiles/gcc.make 2012-09-17 16:11:43.103097073 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -151,11 +151,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 @@ -186,25 +181,33 @@ CFLAGS_WARN/os_bsd.o = $(CFLAGS_WARN/DEFAULT) -Wno-deprecated-declarations endif +OPT_CFLAGS/SIZE=-Os +OPT_CFLAGS/SPEED=-O3 + +# Hotspot uses very unstrict aliasing turn this optimization off +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_EXTRAS += -fno-expensive-optimizations +endif # The flags to use for an Optimized g++ build ifeq ($(OS_VENDOR), Darwin) # use -Os by default, unless -O3 can be proved to be worth the cost, as per policy # - OPT_CFLAGS += -Os + OPT_CFLAGS_DEFAULT ?= SIZE else - OPT_CFLAGS += -O3 + OPT_CFLAGS_DEFAULT ?= SPEED endif -# Hotspot uses very unstrict aliasing turn this optimization off -OPT_CFLAGS += -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 +ifdef OPT_CFLAGS + $(error "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.