Remove an unnecessary -f.
[oota-llvm.git] / Makefile.rules
index 23e554d73206198930a25bccc7a0f76608f8e4b3..8d1e621845a03bc0fa6fed0b1f36a0e587ec7a8d 100644 (file)
@@ -343,9 +343,10 @@ ifdef REQUIRES_FRAME_POINTER
   LD.Flags  := $(filter-out -fomit-frame-pointer,$(LD.Flags))
 endif
 
-# IF REQUIRES_RTTI=1 is specified then don't disable run-time type id
-ifndef REQUIRES_RTTI
-#  CXX.Flags += -fno-rtti
+# 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))
 endif
 
 ifdef ENABLE_COVERAGE
@@ -436,6 +437,7 @@ 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
 
 #--------------------------------------------------------------------
@@ -513,7 +515,10 @@ ifeq ($(HOST_OS),Darwin)
   DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/')
 
   SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress \
-                    -dynamiclib -mmacosx-version-min=$(DARWIN_VERSION)
+                    -dynamiclib
+  ifneq ($(ARCH),ARM)
+    SharedLinkOptions += -mmacosx-version-min=$(DARWIN_VERSION)
+  endif
 else
   ifeq ($(HOST_OS),Cygwin)
     SharedLinkOptions=-shared -nostdlib -Wl,--export-all-symbols \
@@ -524,7 +529,9 @@ else
 endif
 
 ifeq ($(TARGET_OS),Darwin)
-  TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
+  ifneq ($(ARCH),ARM)
+    TargetCommonOpts += -mmacosx-version-min=$(DARWIN_VERSION)
+  endif
 endif
 
 # Adjust LD.Flags depending on the kind of library that is to be built. Note
@@ -1367,14 +1374,13 @@ $(ObjDir)/%.s: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
 
 # make the C and C++ compilers strip debug info out of bytecode libraries.
 ifdef DEBUG_RUNTIME
-$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LLVMAS) $(LOPT)
+$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
        $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
-       $(Verb) $(LLVMAS) $< -o - | $(LOPT) -std-compile-opts -o $@ -f
+       $(Verb) $(LOPT) $< -std-compile-opts -o $@
 else
-$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LLVMAS) $(LOPT)
+$(ObjectsBC): $(ObjDir)/%.bc: $(ObjDir)/%.ll $(LOPT)
        $(Echo) "Compiling $*.ll to $*.bc for $(BuildMode) build (bytecode)"
-       $(Verb) $(LLVMAS) $< -o - | \
-          $(LOPT) -std-compile-opts -strip-debug -o $@ -f
+       $(Verb) $(LOPT) $< -std-compile-opts -strip-debug -o $@
 endif
 
 
@@ -1593,6 +1599,18 @@ check::
          $(EchoCmd) No test directory ; \
        fi
 
+check-lit::
+       $(Verb) if test -d "$(PROJ_OBJ_ROOT)/test" ; then \
+         if test -f "$(PROJ_OBJ_ROOT)/test/Makefile" ; then \
+           $(EchoCmd) Running test suite ; \
+           $(MAKE) -C $(PROJ_OBJ_ROOT)/test check-local-lit ; \
+         else \
+           $(EchoCmd) No Makefile in test directory ; \
+         fi ; \
+       else \
+         $(EchoCmd) No test directory ; \
+       fi
+
 ###############################################################################
 # UNITTESTS: Running the unittests test suite
 ###############################################################################