unittests/JITTests: Don't use --export-dynamic but --export-all-symbols on cygming.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Fri, 26 Nov 2010 09:32:02 +0000 (09:32 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Fri, 26 Nov 2010 09:32:02 +0000 (09:32 +0000)
GNU ld/PECOFF accepts but ignores them below;
  --version-script
  --export-dynamic
  --rpath

FIXME: autoconf should be aware of them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120179 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile.rules
unittests/CMakeLists.txt
unittests/Makefile.unittest

index 410a1422a880760bf3a4f0ded8a4a9436cc9947d..21686aa2428e54f0c7bd878acd819a60df5a30d9 100644 (file)
@@ -392,6 +392,17 @@ endif
   LD.Flags += -Wl,--no-relax
 endif
 
+# GNU ld/PECOFF accepts but ignores them below;
+#   --version-script
+#   --export-dynamic
+#   --rpath
+# FIXME: autoconf should be aware of them.
+ifneq (,$(filter $(HOST_OS),Cygwin MingW))
+  HAVE_LINK_VERSION_SCRIPT := 0
+  RPATH :=
+  RDYNAMIC := -Wl,--export-all-symbols
+endif
+
 #--------------------------------------------------------------------
 # Directory locations
 #--------------------------------------------------------------------
@@ -949,11 +960,6 @@ ifdef EXPORTED_SYMBOL_FILE
 # First, set up the native export file, which may differ from the source
 # export file.
 
-# The option --version-script is not effective on GNU ld win32.
-ifneq (,$(filter $(HOST_OS),Cygwin MingW))
-  HAVE_LINK_VERSION_SCRIPT := 0
-endif
-
 ifeq ($(HOST_OS),Darwin)
 # Darwin convention prefixes symbols with underscores.
 NativeExportsFile := $(ObjDir)/$(notdir $(EXPORTED_SYMBOL_FILE)).sed
index 41e20cfc902df7bfedbe785d9c7cde2ba8199a17..7953fac3bfae273b654d2c276405fc04cc00e518 100644 (file)
@@ -82,6 +82,10 @@ endif()
 
 add_llvm_unittest(JIT ${JITTestsSources})
 
+if(MINGW)
+  set_property(TARGET JITTests PROPERTY LINK_FLAGS -Wl,--export-all-symbols)
+endif()
+
 add_llvm_unittest(Transforms
   Transforms/Utils/Cloning.cpp
   )
index 9a75b2c2eb8fd55ef06f192b547000ce63787f1c..8be6174cb908ac268778034816f9300a64bda8f6 100644 (file)
@@ -35,9 +35,11 @@ endif
 TESTLIBS = -lGoogleTest -lUnitTestMain
 
 ifeq ($(ENABLE_SHARED), 1)
-  # Add the absolute path to the dynamic library.  This is ok because
-  # we'll never install unittests.
-  LD.Flags += $(RPATH) -Wl,$(SharedLibDir)
+  ifneq (,$(RPATH))
+    # Add the absolute path to the dynamic library.  This is ok because
+    # we'll never install unittests.
+    LD.Flags += $(RPATH) -Wl,$(SharedLibDir)
+  endif
   # Also set {DYLD,LD}_LIBRARY_PATH because OSX ignores the rpath most
   # of the time.
   Run.Shared := $(SHLIBPATH_VAR)="$(SharedLibDir)$${$(SHLIBPATH_VAR):+:}$$$(SHLIBPATH_VAR)"