LangRef.rst: fix LangRef data layout text about m specifier, take 2
[oota-llvm.git] / Makefile.rules
index 68f6cf8ec5d12b0f1d4a3735129c6c5027bb8a4d..6c7ec02d15481dfcecfcbf66a308536c207a6f1c 100644 (file)
@@ -608,6 +608,24 @@ ifndef KEEP_SYMBOLS
   Install.StripFlag += -s
 endif
 
+# By default, strip dead symbols at link time
+ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
+ifneq ($(HOST_OS),Darwin)
+ifneq ($(HOST_ARCH),Mips)
+  CXX.Flags += -ffunction-sections -fdata-sections
+endif
+endif
+endif
+ifndef NO_DEAD_STRIP
+  ifeq ($(HOST_OS),Darwin)
+    LD.Flags += -Wl,-dead_strip
+  else
+    ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
+      LD.Flags += -Wl,--gc-sections
+    endif
+  endif
+endif
+
 # Adjust linker flags for building an executable
 ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
   ifndef TOOL_NO_EXPORTS