99 ARCHFLAG/arm = -fsigned-char 100 ARCHFLAG/zero = $(ZERO_ARCHFLAG) 101 ifndef E500V2 102 ARCHFLAG/ppc = -mcpu=powerpc 103 endif 104 105 CFLAGS += $(ARCHFLAG) 106 AOUT_FLAGS += $(ARCHFLAG) 107 LFLAGS += $(ARCHFLAG) 108 ASFLAGS += $(ARCHFLAG) 109 110 ifdef E500V2 111 CFLAGS += -DE500V2 112 endif 113 114 # Use C++ Interpreter 115 ifdef CC_INTERP 116 CFLAGS += -DCC_INTERP 117 endif 118 119 # Build for embedded targets 120 ifdef JAVASE_EMBEDDED 121 CFLAGS += -DJAVASE_EMBEDDED 122 endif 123 124 # Keep temporary files (.ii, .s) 125 ifdef NEED_ASM 126 CFLAGS += -save-temps 127 else 128 CFLAGS += -pipe 129 endif 130 131 # Compiler warnings are treated as errors 132 WARNINGS_ARE_ERRORS = -Werror 133 134 # Except for a few acceptable ones 135 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit 136 # conversions which might affect the values. To avoid that, we need to turn 137 # it off explicitly. 138 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" 139 ACCEPTABLE_WARNINGS = -Wpointer-arith -Wsign-compare 140 else 141 ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare 142 endif 143 144 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS) 145 # Special cases 146 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) 147 148 # The flags to use for an Optimized g++ build 149 OPT_CFLAGS += -O3 150 151 # Hotspot uses very unstrict aliasing turn this optimization off 152 OPT_CFLAGS += -fno-strict-aliasing 153 154 # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp 155 # if we use expensive-optimizations 156 ifeq ($(BUILDARCH), ia64) 157 OPT_CFLAGS += -fno-expensive-optimizations 158 endif 159 160 OPT_CFLAGS/NOOPT=-O0 161 162 # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation. 163 ifneq "$(shell expr \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) = 3 \) \))" "0" 164 OPT_CFLAGS/mulnode.o += -O0 165 endif 166 167 # Flags for generating make dependency flags. 168 ifneq ("${CC_VER_MAJOR}", "2") 169 DEPFLAGS = -fpch-deps -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d) 170 endif 171 172 # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp. 173 ifeq ($(USE_PRECOMPILED_HEADER),0) 174 CFLAGS += -DDONT_USE_PRECOMPILED_HEADER 175 endif 176 177 #------------------------------------------------------------------------ 178 # Linker flags 179 | 99 ARCHFLAG/arm = -fsigned-char 100 ARCHFLAG/zero = $(ZERO_ARCHFLAG) 101 ifndef E500V2 102 ARCHFLAG/ppc = -mcpu=powerpc 103 endif 104 105 CFLAGS += $(ARCHFLAG) 106 AOUT_FLAGS += $(ARCHFLAG) 107 LFLAGS += $(ARCHFLAG) 108 ASFLAGS += $(ARCHFLAG) 109 110 ifdef E500V2 111 CFLAGS += -DE500V2 112 endif 113 114 # Use C++ Interpreter 115 ifdef CC_INTERP 116 CFLAGS += -DCC_INTERP 117 endif 118 119 # Keep temporary files (.ii, .s) 120 ifdef NEED_ASM 121 CFLAGS += -save-temps 122 else 123 CFLAGS += -pipe 124 endif 125 126 # Compiler warnings are treated as errors 127 WARNINGS_ARE_ERRORS = -Werror 128 129 # Except for a few acceptable ones 130 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit 131 # conversions which might affect the values. To avoid that, we need to turn 132 # it off explicitly. 133 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" 134 ACCEPTABLE_WARNINGS = -Wpointer-arith -Wsign-compare 135 else 136 ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare 137 endif 138 139 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS) 140 # Special cases 141 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) 142 143 # The flags to use for an Optimized g++ build 144 OPT_CFLAGS/SIZE=-Os 145 OPT_CFLAGS/SPEED=-O3 146 147 # Hotspot uses very unstrict aliasing turn this optimization off 148 OPT_EXTRAS += -fno-strict-aliasing 149 150 # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp 151 # if we use expensive-optimizations 152 ifeq ($(BUILDARCH), ia64) 153 OPT_EXTRAS += -fno-expensive-optimizations 154 endif 155 156 OPT_CFLAGS_DEFAULT ?= SPEED 157 158 ifdef OPT_CFLAGS 159 $(error "$(OPT_CFLAGS) Use OPT_CFLAGS_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS") 160 endif 161 162 OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS) 163 164 OPT_CFLAGS/NOOPT=-O0 165 166 # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation. 167 ifneq "$(shell expr \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) = 3 \) \))" "0" 168 OPT_CFLAGS/mulnode.o += -O0 169 endif 170 171 # Flags for generating make dependency flags. 172 ifneq ("${CC_VER_MAJOR}", "2") 173 DEPFLAGS = -fpch-deps -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d) 174 endif 175 176 # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp. 177 ifeq ($(USE_PRECOMPILED_HEADER),0) 178 CFLAGS += -DDONT_USE_PRECOMPILED_HEADER 179 endif 180 181 #------------------------------------------------------------------------ 182 # Linker flags 183 |