comparison make/bsd/makefiles/gcc.make @ 14521:29ccc4cbabca

Merge
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 12 Mar 2014 13:30:08 +0100
parents 8c0e92c8c45b d8041d695d19
children 4823ccaf5023
comparison
equal deleted inserted replaced
14520:f84115370178 14521:29ccc4cbabca
259 # WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare 259 # WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare
260 WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess 260 WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
261 WARNINGS_ARE_ERRORS += -Wno-empty-body 261 WARNINGS_ARE_ERRORS += -Wno-empty-body
262 endif 262 endif
263 263
264 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef 264 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wformat=2 -Wno-error=format-nonliteral
265 265
266 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" 266 ifeq ($(USE_CLANG),)
267 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit 267 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
268 # conversions which might affect the values. Only enable it in earlier versions. 268 # conversions which might affect the values. Only enable it in earlier versions.
269 WARNING_FLAGS = -Wunused-function 269 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
270 ifeq ($(USE_CLANG),) 270 WARNINGS_FLAGS += -Wconversion
271 WARNING_FLAGS += -Wconversion
272 endif 271 endif
273 endif 272 endif
274 273
275 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS) 274 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
276 # Special cases 275 # Special cases
289 CFLAGS += -fno-strict-aliasing 288 CFLAGS += -fno-strict-aliasing
290 289
291 # The flags to use for an Optimized g++ build 290 # The flags to use for an Optimized g++ build
292 ifeq ($(OS_VENDOR), Darwin) 291 ifeq ($(OS_VENDOR), Darwin)
293 # use -Os by default, unless -O3 can be proved to be worth the cost, as per policy 292 # use -Os by default, unless -O3 can be proved to be worth the cost, as per policy
294 # <http://wikis.sun.com/display/OpenJDK/Mac+OS+X+Port+Compilers> 293 # <https://wiki.openjdk.java.net/display/MacOSXPort/Compiler+Errata>
295 OPT_CFLAGS_DEFAULT ?= SIZE 294 OPT_CFLAGS_DEFAULT ?= SIZE
296 else 295 else
297 OPT_CFLAGS_DEFAULT ?= SPEED 296 OPT_CFLAGS_DEFAULT ?= SPEED
298 endif 297 endif
299 298
383 LFLAGS += -stdlib=libstdc++ 382 LFLAGS += -stdlib=libstdc++
384 endif 383 endif
385 384
386 # statically link libstdc++.so, work with gcc but ignored by g++ 385 # statically link libstdc++.so, work with gcc but ignored by g++
387 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic 386 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
387
388 # Ensure use libstdc++ on clang, not libc++
389 ifeq ($(USE_CLANG), true)
390 LFLAGS += -stdlib=libstdc++
391 endif
388 392
389 ifeq ($(USE_CLANG),) 393 ifeq ($(USE_CLANG),)
390 # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x. 394 # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
391 ifneq ("${CC_VER_MAJOR}", "2") 395 ifneq ("${CC_VER_MAJOR}", "2")
392 STATIC_LIBGCC += -static-libgcc 396 STATIC_LIBGCC += -static-libgcc