make/bsd/makefiles/gcc.make

Print this page




 243   CFLAGS += -save-temps
 244 else
 245   CFLAGS += -pipe
 246 endif
 247 
 248 # Compiler warnings are treated as errors
 249 ifneq ($(COMPILER_WARNINGS_FATAL),false)
 250   WARNINGS_ARE_ERRORS = -Werror
 251 endif
 252 
 253 ifeq ($(USE_CLANG), true)
 254   # However we need to clean the code up before we can unrestrictedly enable this option with Clang
 255   WARNINGS_ARE_ERRORS += -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses
 256   WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-compare
 257 # Not yet supported by clang in Xcode 4.6.2
 258 #  WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare
 259   WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
 260   WARNINGS_ARE_ERRORS += -Wno-empty-body
 261 endif
 262 
 263 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wformat=2 -Wno-error=format-nonliteral
 264 
 265 ifeq ($(USE_CLANG),)
 266   # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
 267   # conversions which might affect the values. Only enable it in earlier versions.
 268   ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
 269     WARNINGS_FLAGS += -Wconversion


 270   endif


 271 endif
 272 
 273 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
 274 # Special cases
 275 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) 
 276 # XXXDARWIN: for _dyld_bind_fully_image_containing_address
 277 ifeq ($(OS_VENDOR), Darwin)
 278   CFLAGS_WARN/os_bsd.o = $(CFLAGS_WARN/DEFAULT) -Wno-deprecated-declarations
 279 endif
 280 
 281 OPT_CFLAGS/SIZE=-Os
 282 OPT_CFLAGS/SPEED=-O3
 283 
 284 # Hotspot uses very unstrict aliasing turn this optimization off
 285 # This option is added to CFLAGS rather than OPT_CFLAGS
 286 # so that OPT_CFLAGS overrides get this option too.
 287 CFLAGS += -fno-strict-aliasing
 288 
 289 # The flags to use for an Optimized g++ build
 290 ifeq ($(OS_VENDOR), Darwin)




 243   CFLAGS += -save-temps
 244 else
 245   CFLAGS += -pipe
 246 endif
 247 
 248 # Compiler warnings are treated as errors
 249 ifneq ($(COMPILER_WARNINGS_FATAL),false)
 250   WARNINGS_ARE_ERRORS = -Werror
 251 endif
 252 
 253 ifeq ($(USE_CLANG), true)
 254   # However we need to clean the code up before we can unrestrictedly enable this option with Clang
 255   WARNINGS_ARE_ERRORS += -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses
 256   WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-compare
 257 # Not yet supported by clang in Xcode 4.6.2
 258 #  WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare
 259   WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
 260   WARNINGS_ARE_ERRORS += -Wno-empty-body
 261 endif
 262 
 263 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wformat=2
 264 
 265 ifeq ($(USE_CLANG),)
 266   # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
 267   # conversions which might affect the values. Only enable it in earlier versions.
 268   ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
 269     WARNING_FLAGS += -Wconversion -Wno-format-nonliteral
 270   else 
 271     WARNING_FLAGS += -Wno-error=format-nonliteral
 272   endif
 273 else 
 274   WARNING_FLAGS += -Wno-error=format-nonliteral
 275 endif
 276 
 277 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
 278 # Special cases
 279 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) 
 280 # XXXDARWIN: for _dyld_bind_fully_image_containing_address
 281 ifeq ($(OS_VENDOR), Darwin)
 282   CFLAGS_WARN/os_bsd.o = $(CFLAGS_WARN/DEFAULT) -Wno-deprecated-declarations
 283 endif
 284 
 285 OPT_CFLAGS/SIZE=-Os
 286 OPT_CFLAGS/SPEED=-O3
 287 
 288 # Hotspot uses very unstrict aliasing turn this optimization off
 289 # This option is added to CFLAGS rather than OPT_CFLAGS
 290 # so that OPT_CFLAGS overrides get this option too.
 291 CFLAGS += -fno-strict-aliasing
 292 
 293 # The flags to use for an Optimized g++ build
 294 ifeq ($(OS_VENDOR), Darwin)