llvm.org GIT mirror llvm / 0158aaf
Export the required symbol from DynamicLibraryTests Running unittests/Support/DynamicLibrary/DynamicLibraryTests fails when LLVM is configured with -DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON, because the test's version script only contains symbols extracted from the static libraries, that the test links with, but not those from the main object/executable itself. The patch moves the one symbol, needed by the test, to a static library. Fixes https://bugs.llvm.org/show_bug.cgi?id=32893 Patch by Momchil Velikov. Differential Revision: https://reviews.llvm.org/D33789 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305181 91177308-0d34-0410-b5e6-96231b3b80d8 Roger Ferrer Ibanez 2 years ago
5 changed file(s) with 23 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
0 set(LLVM_LINK_COMPONENTS Support)
11
2 add_library(DynamicLibraryLib STATIC ExportedFuncs.cxx)
3
24 add_llvm_unittest(DynamicLibraryTests DynamicLibraryTest.cpp)
3
5 target_link_libraries(DynamicLibraryTests DynamicLibraryLib)
46 export_executable_symbols(DynamicLibraryTests)
57
68 function(dynlib_add_module NAME)
1717
1818 using namespace llvm;
1919 using namespace llvm::sys;
20
21 extern "C" PIPSQUEAK_EXPORT const char *TestA() { return "ProcessCall"; }
2220
2321 std::string LibPath(const std::string Name = "PipSqueak") {
2422 const std::vector& Argvs = testing::internal::GetArgvs();
0 //===- llvm/unittest/Support/DynamicLibrary/DynamicLibraryLib.cpp ---------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "PipSqueak.h"
10
11 #ifndef PIPSQUEAK_TESTA_RETURN
12 #define PIPSQUEAK_TESTA_RETURN "ProcessCall"
13 #endif
14
15 extern "C" PIPSQUEAK_EXPORT const char *TestA() { return PIPSQUEAK_TESTA_RETURN; }
4444 Glb.Vec = &V;
4545 }
4646
47 extern "C" PIPSQUEAK_EXPORT const char *TestA() { return "LibCall"; }
47 #define PIPSQUEAK_TESTA_RETURN "LibCall"
48 #include "ExportedFuncs.cxx"
2828 #define PIPSQUEAK_EXPORT
2929 #endif
3030
31 extern "C" PIPSQUEAK_EXPORT const char *TestA();
32
3133 #endif