[llvm-commits] [llvm] r65543 - /llvm/trunk/Makefile.rules

Chris Lattner sabre at nondot.org
Thu Feb 26 09:47:49 PST 2009


Author: lattner
Date: Thu Feb 26 11:47:49 2009
New Revision: 65543

URL: http://llvm.org/viewvc/llvm-project?rev=65543&view=rev
Log:
strip exported symbols from tools that build with TOOL_NO_EXPORTS=1.

Modified:
    llvm/trunk/Makefile.rules

Modified: llvm/trunk/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=65543&r1=65542&r2=65543&view=diff

==============================================================================
--- llvm/trunk/Makefile.rules (original)
+++ llvm/trunk/Makefile.rules Thu Feb 26 11:47:49 2009
@@ -1067,6 +1067,24 @@
 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
 #---------------------------------------------------------
 all-local:: $(ToolBuildPath)





More information about the llvm-commits mailing list