Use an export list when building JIT unittests. <rdar://problem/12473675>
authorBob Wilson <bob.wilson@apple.com>
Thu, 18 Oct 2012 20:25:36 +0000 (20:25 +0000)
committerBob Wilson <bob.wilson@apple.com>
Thu, 18 Oct 2012 20:25:36 +0000 (20:25 +0000)
When building with LTO, the internalize pass is hiding some global symbols
that are necessary for the JIT unittests. It seems like that may be a bug in
LTO to do that by default, but until that gets fixed, this change makes sure
that we export the necessary symbols for the tests to pass.

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

unittests/ExecutionEngine/JIT/Makefile

index b535a6b29605c340ef54fa0a993323422af01de1..9e0bb9ea5930525d9324edf7ef0495ecc9552367 100644 (file)
@@ -35,8 +35,15 @@ ifeq ($(USE_OPROFILE), 1)
   LINK_COMPONENTS += oprofilejit
 endif
 
   LINK_COMPONENTS += oprofilejit
 endif
 
+EXPORTED_SYMBOL_FILE = $(PROJ_OBJ_DIR)/JITTests.exports
 
 include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest
 
 # Permit these tests to use the JIT's symbolic lookup.
 LD.Flags += $(RDYNAMIC)
 
 include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest
 
 # Permit these tests to use the JIT's symbolic lookup.
 LD.Flags += $(RDYNAMIC)
+
+# Symbol exports are necessary (at least for now) when building with LTO.
+$(LLVMUnitTestExe): $(NativeExportsFile)
+$(PROJ_OBJ_DIR)/JITTests.exports: $(PROJ_SRC_DIR)/JITTests.def $(PROJ_OBJ_DIR)/.dir
+       tail -n +2 $< > $@
+