Install.StripFlag += -s
endif
+# By default, strip dead symbols at link time
+ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW))
+ifneq ($(HOST_OS),Darwin)
+ CXX.Flags += -ffunction-sections -fdata-sections
+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
LINK_COMPONENTS := asmparser instrumentation scalaropts ipo linker bitreader \
bitwriter irreader vectorize objcarcopts
+# Support plugins.
+NO_DEAD_STRIP := 1
+
include $(LEVEL)/Makefile.common
TOOLNAME := llc
LINK_COMPONENTS := all-targets bitreader asmparser irreader
+# Support plugins.
+NO_DEAD_STRIP := 1
+
include $(LEVEL)/Makefile.common
endif
# Include everything from the .a's into the shared library.
LLVMLibsOptions := $(LLVMLibsOptions) -all_load
- # extra options to override libtool defaults
- LLVMLibsOptions := $(LLVMLibsOptions) \
- -Wl,-dead_strip
# Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
-Wl,$(LTO_LIBRARY_VERSION).$(LLVM_SUBMIT_SUBVERSION) \
-Wl,-compatibility_version -Wl,1
endif
- # extra options to override libtool defaults
- LLVMLibsOptions := $(LLVMLibsOptions) \
- -Wl,-dead_strip
# Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
TOOLNAME := opt
LINK_COMPONENTS := bitreader bitwriter asmparser irreader instrumentation scalaropts objcarcopts ipo vectorize all-targets
+# Support plugins.
+NO_DEAD_STRIP := 1
+
include $(LEVEL)/Makefile.common