strip exported symbols from tools that build with TOOL_NO_EXPORTS=1.

llvm-svn: 65543
This commit is contained in:
Chris Lattner 2009-02-26 17:47:49 +00:00
parent c1504647ee
commit 0f19580996
1 changed files with 18 additions and 0 deletions

View File

@ -1066,6 +1066,24 @@ else
ToolBuildPath := $(ToolDir)/$(strip $(TOOLNAME))$(EXEEXT)
endif
#---------------------------------------------------------
# Prune Exports
#---------------------------------------------------------
# If the tool opts in with TOOL_NO_EXPORTS, optimize startup time of the app by
# not exporting all of the weak symbols from the binary. This reduces dyld
# startup time by 4x on darwin in some cases.
ifdef TOOL_NO_EXPORTS
ifeq ($(OS),Darwin)
LD.Flags += -Wl,-exported_symbol -Wl,_main
endif
ifeq ($(OS), $(filter $(OS), Linux NetBSD FreeBSD))
LD.Flags += -Wl,--version-script=Driver.map
endif
endif
#---------------------------------------------------------
# Provide targets for building the tools
#---------------------------------------------------------