X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=Makefile.rules;h=761cc812beed2d5d55311c959b178d3f0a46f782;hb=3bdbdd06c8ffc2c14a65055ebdbbc7c1217db4af;hp=49ecb1e2d866588e5c345864cc3259ad3f9abb9e;hpb=f87ea4dd9ac9816131ee52ee6393c7b4012f2e68;p=oota-llvm.git diff --git a/Makefile.rules b/Makefile.rules index 49ecb1e2d86..761cc812bee 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -365,9 +365,18 @@ endif # CXX.Flags += -fvisibility-inlines-hidden #endif +ifdef ENABLE_EXPENSIVE_CHECKS + # GNU libstdc++ uses RTTI if you define _GLIBCXX_DEBUG, which we did above. + # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160 + REQUIRES_RTTI := 1 +endif + # IF REQUIRES_EH=1 is specified then don't disable exceptions ifndef REQUIRES_EH CXX.Flags += -fno-exceptions +else + # If the library requires EH, it also requires RTTI. + REQUIRES_RTTI := 1 endif ifdef REQUIRES_FRAME_POINTER @@ -377,9 +386,9 @@ ifdef REQUIRES_FRAME_POINTER endif # If REQUIRES_RTTI=1 is specified then don't disable run-time type id. -ifeq ($(REQUIRES_RTTI), 1) - CXX.Flags := $(filter-out -fno-rtti,$(CXX.Flags)) - CXXFLAGS := $(filter-out -fno-rtti,$(CXXFLAGS)) +ifneq ($(REQUIRES_RTTI), 1) + CXX.Flags += -fno-rtti + CXXFLAGS += -fno-rtti endif ifdef ENABLE_COVERAGE @@ -439,6 +448,17 @@ else endif endif +ifeq ($(HOST_OS),MingW) + # Work around PR4957 + CPP.Defines += -D__NO_CTYPE_INLINE + ifeq ($(LLVM_CROSS_COMPILING),1) + # Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525016 + ifdef TOOLNAME + LD.Flags += -Wl,--allow-multiple-definition + endif + endif +endif + CXX.Flags += -Woverloaded-virtual CPP.BaseFlags += $(CPP.Defines) AR.Flags := cru @@ -457,22 +477,6 @@ ifeq ($(ARCH),Alpha) LD.Flags += -Wl,--no-relax endif -ifeq ($(HOST_OS),MingW) - ifeq ($(LLVM_CROSS_COMPILING),1) - # Work around http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525016 - ifdef TOOLNAME - LD.Flags += -Wl,--allow-multiple-definition - endif - endif -endif - -ifdef ENABLE_EXPENSIVE_CHECKS - # GNU libstdc++ uses RTTI if you define _GLIBCXX_DEBUG, which we did above. - # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160 - CXX.Flags := $(filter-out -fno-rtti,$(CXX.Flags)) - CXXFLAGS := $(filter-out -fno-rtti,$(CXXFLAGS)) -endif - #-------------------------------------------------------------------- # Directory locations #-------------------------------------------------------------------- @@ -1351,17 +1355,17 @@ DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \ DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \ else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi -$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) +$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_SRC_DIR)/Makefile $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(PIC_FLAG) $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \ $(DEPEND_MOVEFILE) -$(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) +$(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_SRC_DIR)/Makefile $(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG) $(Verb) if $(Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \ $(DEPEND_MOVEFILE) -$(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) +$(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(PROJ_SRC_DIR)/Makefile $(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG) $(Verb) if $(Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \ $(DEPEND_MOVEFILE) @@ -1570,6 +1574,11 @@ $(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir $(Echo) "Building $(