comparison make/bsd/makefiles/gcc.make @ 12629:8ba058ffbc2e

Clang 5.0 fixes
author twisti
date Tue, 29 Oct 2013 14:45:32 -0700
parents 0806a46dced5
children 096c224171c4
comparison
equal deleted inserted replaced
12628:c36bdee8ca29 12629:8ba058ffbc2e
142 # need this special handling. 142 # need this special handling.
143 PCH_FLAG/loopTransform.o = $(PCH_FLAG/NO_PCH) 143 PCH_FLAG/loopTransform.o = $(PCH_FLAG/NO_PCH)
144 PCH_FLAG/sharedRuntimeTrig.o = $(PCH_FLAG/NO_PCH) 144 PCH_FLAG/sharedRuntimeTrig.o = $(PCH_FLAG/NO_PCH)
145 PCH_FLAG/sharedRuntimeTrans.o = $(PCH_FLAG/NO_PCH) 145 PCH_FLAG/sharedRuntimeTrans.o = $(PCH_FLAG/NO_PCH)
146 PCH_FLAG/unsafe.o = $(PCH_FLAG/NO_PCH) 146 PCH_FLAG/unsafe.o = $(PCH_FLAG/NO_PCH)
147 147 PCH_FLAG/graalCompilerToVM.o = $(PCH_FLAG/NO_PCH)
148
148 endif 149 endif
149 else # ($(USE_CLANG), true) 150 else # ($(USE_CLANG), true)
150 # check for precompiled headers support 151 # check for precompiled headers support
151 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0" 152 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
152 # Allow the user to turn off precompiled headers from the command line. 153 # Allow the user to turn off precompiled headers from the command line.
307 308
308 OPT_CFLAGS/NOOPT=-O0 309 OPT_CFLAGS/NOOPT=-O0
309 310
310 # Work around some compiler bugs. 311 # Work around some compiler bugs.
311 ifeq ($(USE_CLANG), true) 312 ifeq ($(USE_CLANG), true)
313 # Clang 4.2
312 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1) 314 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
313 OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT) 315 OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
314 OPT_CFLAGS/unsafe.o += -O1 316 OPT_CFLAGS/unsafe.o += -O1
315 endif 317 endif
316 # Clang 5.0 318 # Clang 5.0
317 ifeq ($(shell expr $(CC_VER_MAJOR) = 5 \& $(CC_VER_MINOR) = 0), 1) 319 ifeq ($(shell expr $(CC_VER_MAJOR) = 5 \& $(CC_VER_MINOR) = 0), 1)
320 OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
321 OPT_CFLAGS/unsafe.o += -O1
318 OPT_CFLAGS/graalCompilerToVM.o += -O1 322 OPT_CFLAGS/graalCompilerToVM.o += -O1
319 OPT_CFLAGS/unsafe.o += -O1
320 # Specific optimization level plus precompiled headers produces:
321 # error: __OPTIMIZE_SIZE__ predefined macro was enabled in PCH file but is currently disabled
322 USE_PRECOMPILED_HEADER = 0
323 endif 323 endif
324 else 324 else
325 # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation. 325 # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
326 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1) 326 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1)
327 OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT) 327 OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT)
328 endif
329 endif
330
331 # We want to use libc++ on Clang 5.0
332 ifeq ($(USE_CLANG), true)
333 # Clang 5.0
334 ifeq ($(shell expr $(CC_VER_MAJOR) = 5 \& $(CC_VER_MINOR) = 0), 1)
335 CFLAGS += -stdlib=libc++
328 endif 336 endif
329 endif 337 endif
330 338
331 # Flags for generating make dependency flags. 339 # Flags for generating make dependency flags.
332 DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d) 340 DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)