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 # This option is added to CFLAGS rather than OPT_CFLAGS
149 # so that OPT_CFLAGS overrides get this option too.
150 CFLAGS += -fno-strict-aliasing
151
152 OPT_CFLAGS_DEFAULT ?= SPEED
153
154 ifdef OPT_CFLAGS
155 ifneq ("$(origin OPT_CFLAGS)", "command line")
156 $(error " Use OPT_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS.")
157 endif
158 endif
159
|
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 ADDITIONAL_WARNINGS = -Wunused-function
140
141 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS) $(ADDITIONAL_WARNINGS)
142 # Special cases
143 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
144
145 # The flags to use for an Optimized g++ build
146 OPT_CFLAGS/SIZE=-Os
147 OPT_CFLAGS/SPEED=-O3
148
149 # Hotspot uses very unstrict aliasing turn this optimization off
150 # This option is added to CFLAGS rather than OPT_CFLAGS
151 # so that OPT_CFLAGS overrides get this option too.
152 CFLAGS += -fno-strict-aliasing
153
154 OPT_CFLAGS_DEFAULT ?= SPEED
155
156 ifdef OPT_CFLAGS
157 ifneq ("$(origin OPT_CFLAGS)", "command line")
158 $(error " Use OPT_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS.")
159 endif
160 endif
161
|