From 02ab9a69b9ef64db10adfbae7fbde7c67753be44 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 3 Sep 2010 17:29:33 +0000 Subject: [PATCH] Fix Windows stuff to follow the existing source organization. llvm-svn: 112976 --- llvm/Makefile.rules | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/llvm/Makefile.rules b/llvm/Makefile.rules index 59fa834b4cc3..2e18c66e2b7a 100644 --- a/llvm/Makefile.rules +++ b/llvm/Makefile.rules @@ -961,23 +961,9 @@ $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir clean-local:: -$(Verb) $(RM) -f $(NativeExportsFile) else -NativeExportsFile := $(EXPORTED_SYMBOL_FILE) -endif -endif - -# Now add the linker command-line options to use the native export file. - -ifeq ($(HOST_OS),Darwin) -LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile) -endif - -# GNU ld Win32 accepts .DEF files that contain "DATA" entries. ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) +# GNU ld Win32 accepts .DEF files that contain "DATA" entries. NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE:.exports=.def)) - -# LLVMLibsOptions is invalidated at processing tools/llvm-shlib. -SharedLinkOptions += $(NativeExportsFile) - $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir $(Echo) Generating $(notdir $@) $(Verb) $(ECHO) "EXPORTS" > $@ @@ -985,12 +971,28 @@ $(NativeExportsFile): $(EXPORTED_SYMBOL_FILE) $(ObjDir)/.dir clean-local:: -$(Verb) $(RM) -f $(NativeExportsFile) else +# Default behavior: just use the exports file verbatim. +NativeExportsFile := $(EXPORTED_SYMBOL_FILE) +endif +endif +endif + +# Now add the linker command-line options to use the native export file. + +# Darwin +ifeq ($(HOST_OS),Darwin) +LLVMLibsOptions += -Wl,-exported_symbols_list,$(NativeExportsFile) +endif # gold, bfd ld, etc. ifeq ($(HAVE_LINK_VERSION_SCRIPT),1) LLVMLibsOptions += -Wl,--version-script,$(NativeExportsFile) endif +# Windows +ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) +# LLVMLibsOptions is invalidated at processing tools/llvm-shlib. +SharedLinkOptions += $(NativeExportsFile) endif endif