aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-05-22 20:27:30 +0000
committerChris Lattner <sabre@nondot.org>2003-05-22 20:27:30 +0000
commit20fa5da40ae3abcc97406f7359700d2e5cecea64 (patch)
tree780a89b118a334fd267365bed36d404ea0d8c00c
parent88c7c3295d936c807bc03ff4fd9da4691084f5d8 (diff)
add support for an explicit EXPORTED_SYMBOL_LIST
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6296 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--runtime/Makefile.libs13
1 files changed, 11 insertions, 2 deletions
diff --git a/runtime/Makefile.libs b/runtime/Makefile.libs
index 60515f1064..d2f825cb20 100644
--- a/runtime/Makefile.libs
+++ b/runtime/Makefile.libs
@@ -7,6 +7,9 @@
#
# 1. LEVEL - Must be set as per normal semantics: The depth from the top of tree
# 2. LIBNAME - Name of library to link together. Forms lib<LIBNAME>.bc
+# 3. EXPORTED_SYMBOL_LIST - If this symbol is defined, it contains a comma
+# separated list of symbols that are exported by the library. All other
+# symbols are marked internal, reducing namespace pollution.
#
DESTLIBDIR := $(LEVEL)/test/Libraries/Output
@@ -22,10 +25,16 @@ LObjects := $(addprefix Output/,$(LObjs))
.PRECIOUS: $(LObjects)
+# If the library specified a list of symbols to export, add an internalize pass
+# to the link options.
+ifdef EXPORTED_SYMBOL_LIST
+LLINK_OPTS += -internalize -internalize-public-api-list=$(EXPORTED_SYMBOL_LIST)
+endif
+
# Link the library, then perform postlink optimization...
-$(DESTLIBNAME): $(DESTLIBDIR)/.dir $(LObjects)
+$(DESTLIBNAME): $(DESTLIBDIR)/.dir $(LObjects) $(LLINK) $(LOPT)
$(LLINK) -f $(LObjects) $(LDFLAGS) | \
- $(LOPT) -f -funcresolve -deadtypeelim -globaldce -o $@
+ $(LOPT) -f -q -funcresolve -deadtypeelim $(LLINK_OPTS) -globaldce -o $@
# Install target for libraries: Copy into the gcc install directory.
#