From d7132e587f5c2b6704a46629242a25266aaeb7aa Mon Sep 17 00:00:00 2001 From: helixhorned Date: Fri, 14 Dec 2012 19:28:20 +0000 Subject: [PATCH] Fix CLANG=1 NOASM=1 build. git-svn-id: https://svn.eduke32.com/eduke32@3292 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/Makefile.common | 1 + polymer/eduke32/build/Makefile | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/Makefile.common b/polymer/eduke32/Makefile.common index 6d7bcdad7..2c0ef75fd 100644 --- a/polymer/eduke32/Makefile.common +++ b/polymer/eduke32/Makefile.common @@ -332,6 +332,7 @@ else ifneq (0,$(CLANG)) # CLANG_MAJOR := $(shell clang -dM -E -x c /dev/null | grep __clang_major__ | awk '{ print $$3 }') + # KEEPINSYNC with build/Makefile: BASECFLAGS+= -Xclang -fcatch-undefined-behavior # ifeq ($(CLANG_MAJOR),3) # debug+= -faddress-sanitizer diff --git a/polymer/eduke32/build/Makefile b/polymer/eduke32/build/Makefile index d7e81424c..807bee129 100644 --- a/polymer/eduke32/build/Makefile +++ b/polymer/eduke32/build/Makefile @@ -287,10 +287,11 @@ $(OBJ)/%.$o: $(SRC)/%.nasm $(COMPILE_STATUS) if $(AS) $(OURASFLAGS) $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi -# comment out to debug a-c.o +# Comment out the following rule to debug a-c.o $(OBJ)/a-c.$o: $(SRC)/a-c.c $(COMPILE_STATUS) - if $(COMPILER) $(subst -O0,-O2,$(subst -fcatch-undefined-behavior,,$(OURCFLAGS))) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi + if $(COMPILER) $(subst -O0,-O2,$(subst -Xclang -fcatch-undefined-behavior,,$(OURCFLAGS))) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi +# KEEPINSYNC the "... -fcatch-undefined-behavior" with Makefile.common $(OBJ)/%.$o: $(SRC)/%.c $(COMPILE_STATUS)