Mercurial > hg > truffle
comparison make/bsd/makefiles/gcc.make @ 14422:2b8e28fdf503
Merge
author | kvn |
---|---|
date | Tue, 05 Nov 2013 17:38:04 -0800 |
parents | f509b8f4699b |
children | 096c224171c4 d16be2b85802 |
comparison
equal
deleted
inserted
replaced
14421:3068270ba476 | 14422:2b8e28fdf503 |
---|---|
78 | 78 |
79 HOSTCXX = $(CXX) | 79 HOSTCXX = $(CXX) |
80 HOSTCC = $(CC) | 80 HOSTCC = $(CC) |
81 endif | 81 endif |
82 | 82 |
83 AS = $(CC) -c -x assembler-with-cpp | 83 AS = $(CC) -c |
84 endif | 84 endif |
85 | 85 |
86 ifeq ($(OS_VENDOR), Darwin) | |
87 ifeq ($(DSYMUTIL),) | |
88 DSYMUTIL=dsymutil | |
89 endif | |
90 endif | |
86 | 91 |
87 ifeq ($(USE_CLANG), true) | 92 ifeq ($(USE_CLANG), true) |
88 CC_VER_MAJOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f1) | 93 CC_VER_MAJOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f1) |
89 CC_VER_MINOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f2) | 94 CC_VER_MINOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f2) |
90 else | 95 else |
127 VM_PCH_FLAG/AOUT = | 132 VM_PCH_FLAG/AOUT = |
128 VM_PCH_FLAG = $(VM_PCH_FLAG/$(LINK_INTO)) | 133 VM_PCH_FLAG = $(VM_PCH_FLAG/$(LINK_INTO)) |
129 | 134 |
130 # We only use precompiled headers for the JVM build | 135 # We only use precompiled headers for the JVM build |
131 CFLAGS += $(VM_PCH_FLAG) | 136 CFLAGS += $(VM_PCH_FLAG) |
132 | 137 |
133 # There are some files which don't like precompiled headers | 138 # The following files are compiled at various optimization |
134 # The following files are build with 'OPT_CFLAGS/NOOPT' (-O0) in the opt build. | 139 # levels due to optimization issues encountered at the |
135 # But Clang doesn't support a precompiled header which was compiled with -O3 | 140 # 'OPT_CFLAGS_DEFAULT' level. The Clang compiler issues a compile |
136 # to be used in a compilation unit which uses '-O0'. We could also prepare an | 141 # time error if there is an optimization level specification |
137 # extra '-O0' PCH file for the opt build and use it here, but it's probably | 142 # skew between the PCH file and the C++ file. Especially if the |
138 # not worth the effort as long as only two files need this special handling. | 143 # PCH file is compiled at a higher optimization level than |
144 # the C++ file. One solution might be to prepare extra optimization | |
145 # level specific PCH files for the opt build and use them here, but | |
146 # it's probably not worth the effort as long as only a few files | |
147 # need this special handling. | |
139 PCH_FLAG/loopTransform.o = $(PCH_FLAG/NO_PCH) | 148 PCH_FLAG/loopTransform.o = $(PCH_FLAG/NO_PCH) |
140 PCH_FLAG/sharedRuntimeTrig.o = $(PCH_FLAG/NO_PCH) | 149 PCH_FLAG/sharedRuntimeTrig.o = $(PCH_FLAG/NO_PCH) |
141 PCH_FLAG/sharedRuntimeTrans.o = $(PCH_FLAG/NO_PCH) | 150 PCH_FLAG/sharedRuntimeTrans.o = $(PCH_FLAG/NO_PCH) |
151 PCH_FLAG/unsafe.o = $(PCH_FLAG/NO_PCH) | |
142 | 152 |
143 endif | 153 endif |
144 else # ($(USE_CLANG), true) | 154 else # ($(USE_CLANG), true) |
145 # check for precompiled headers support | 155 # check for precompiled headers support |
146 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0" | 156 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0" |
240 WARNINGS_ARE_ERRORS = -Werror | 250 WARNINGS_ARE_ERRORS = -Werror |
241 endif | 251 endif |
242 | 252 |
243 ifeq ($(USE_CLANG), true) | 253 ifeq ($(USE_CLANG), true) |
244 # However we need to clean the code up before we can unrestrictedly enable this option with Clang | 254 # However we need to clean the code up before we can unrestrictedly enable this option with Clang |
245 WARNINGS_ARE_ERRORS += -Wno-unused-value -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses | 255 WARNINGS_ARE_ERRORS += -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses |
246 WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-compare | 256 WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-compare |
247 # Not yet supported by clang in Xcode 4.6.2 | 257 # Not yet supported by clang in Xcode 4.6.2 |
248 # WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare | 258 # WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare |
249 WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess | 259 WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess |
250 WARNINGS_ARE_ERRORS += -Wno-empty-body | 260 WARNINGS_ARE_ERRORS += -Wno-empty-body |
255 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" | 265 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" |
256 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit | 266 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit |
257 # conversions which might affect the values. Only enable it in earlier versions. | 267 # conversions which might affect the values. Only enable it in earlier versions. |
258 WARNING_FLAGS = -Wunused-function | 268 WARNING_FLAGS = -Wunused-function |
259 ifeq ($(USE_CLANG),) | 269 ifeq ($(USE_CLANG),) |
260 WARNINGS_FLAGS += -Wconversion | 270 WARNING_FLAGS += -Wconversion |
261 endif | 271 endif |
262 endif | 272 endif |
263 | 273 |
264 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS) | 274 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS) |
265 # Special cases | 275 # Special cases |
304 | 314 |
305 # Work around some compiler bugs. | 315 # Work around some compiler bugs. |
306 ifeq ($(USE_CLANG), true) | 316 ifeq ($(USE_CLANG), true) |
307 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1) | 317 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1) |
308 OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT) | 318 OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT) |
319 OPT_CFLAGS/unsafe.o += -O1 | |
309 endif | 320 endif |
310 else | 321 else |
311 # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation. | 322 # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation. |
312 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1) | 323 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1) |
313 OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT) | 324 OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT) |
338 # The macro takes the version with no dots, ex: 1070 | 349 # The macro takes the version with no dots, ex: 1070 |
339 CFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=$(subst .,,$(MACOSX_VERSION_MIN)) \ | 350 CFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=$(subst .,,$(MACOSX_VERSION_MIN)) \ |
340 -mmacosx-version-min=$(MACOSX_VERSION_MIN) | 351 -mmacosx-version-min=$(MACOSX_VERSION_MIN) |
341 LDFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN) | 352 LDFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN) |
342 endif | 353 endif |
354 | |
355 | |
356 #------------------------------------------------------------------------ | |
357 # Assembler flags | |
358 | |
359 # Enforce prerpocessing of .s files | |
360 ASFLAGS += -x assembler-with-cpp | |
343 | 361 |
344 #------------------------------------------------------------------------ | 362 #------------------------------------------------------------------------ |
345 # Linker flags | 363 # Linker flags |
346 | 364 |
347 # statically link libstdc++.so, work with gcc but ignored by g++ | 365 # statically link libstdc++.so, work with gcc but ignored by g++ |
419 DEBUG_CFLAGS/ppc = -g | 437 DEBUG_CFLAGS/ppc = -g |
420 DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH)) | 438 DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH)) |
421 ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),) | 439 ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),) |
422 DEBUG_CFLAGS += -gstabs | 440 DEBUG_CFLAGS += -gstabs |
423 endif | 441 endif |
442 | |
443 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) | |
444 FASTDEBUG_CFLAGS/ia64 = -g | |
445 FASTDEBUG_CFLAGS/amd64 = -g | |
446 FASTDEBUG_CFLAGS/arm = -g | |
447 FASTDEBUG_CFLAGS/ppc = -g | |
448 FASTDEBUG_CFLAGS += $(FASTDEBUG_CFLAGS/$(BUILDARCH)) | |
449 ifeq ($(FASTDEBUG_CFLAGS/$(BUILDARCH)),) | |
450 ifeq ($(USE_CLANG), true) | |
451 # Clang doesn't understand -gstabs | |
452 FASTDEBUG_CFLAGS += -g | |
453 else | |
454 FASTDEBUG_CFLAGS += -gstabs | |
455 endif | |
456 endif | |
457 | |
458 OPT_CFLAGS/ia64 = -g | |
459 OPT_CFLAGS/amd64 = -g | |
460 OPT_CFLAGS/arm = -g | |
461 OPT_CFLAGS/ppc = -g | |
462 OPT_CFLAGS += $(OPT_CFLAGS/$(BUILDARCH)) | |
463 ifeq ($(OPT_CFLAGS/$(BUILDARCH)),) | |
464 ifeq ($(USE_CLANG), true) | |
465 # Clang doesn't understand -gstabs | |
466 OPT_CFLAGS += -g | |
467 else | |
468 OPT_CFLAGS += -gstabs | |
469 endif | |
470 endif | |
471 endif | |
424 endif | 472 endif |
425 | 473 |
426 # If we are building HEADLESS, pass on to VM | 474 # If we are building HEADLESS, pass on to VM |
427 # so it can set the java.awt.headless property | 475 # so it can set the java.awt.headless property |
428 ifdef HEADLESS | 476 ifdef HEADLESS |