diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2009-06-23 20:46:48 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2009-06-23 20:46:48 +0000 |
commit | d80d8690af2ce54f7f624889b5628fa3dc61cc27 (patch) | |
tree | e136bb9eca617d20f273f938a30e9138976cfea6 /utils/TableGen | |
parent | 06509db63088f7e4aed4e47fc9c73317eff461ec (diff) | |
download | external_llvm-d80d8690af2ce54f7f624889b5628fa3dc61cc27.zip external_llvm-d80d8690af2ce54f7f624889b5628fa3dc61cc27.tar.gz external_llvm-d80d8690af2ce54f7f624889b5628fa3dc61cc27.tar.bz2 |
Make llvmc work again.
Chris recently broke llvmc with his Makefile changes (r75379). That patch made
the global change .o -> .a, which caused built-in llvmc plugins to stop working
since plugin initialization in llvmc is based on static variables not referenced
from the main executable. This patch implements auto-generated forced references
to the plugin libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74000 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r-- | utils/TableGen/LLVMCConfigurationEmitter.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp index 36f094d..e9acd96 100644 --- a/utils/TableGen/LLVMCConfigurationEmitter.cpp +++ b/utils/TableGen/LLVMCConfigurationEmitter.cpp @@ -1984,6 +1984,7 @@ void EmitRegisterPlugin(int Priority, std::ostream& O) { /// additional declarations. void EmitIncludes(std::ostream& O) { O << "#include \"llvm/CompilerDriver/CompilationGraph.h\"\n" + << "#include \"llvm/CompilerDriver/ForceLinkageMacros.h\"\n" << "#include \"llvm/CompilerDriver/Plugin.h\"\n" << "#include \"llvm/CompilerDriver/Tool.h\"\n\n" @@ -2106,7 +2107,13 @@ void EmitPluginCode(const PluginData& Data, std::ostream& O) { // Emit code for plugin registration. EmitRegisterPlugin(Data.Priority, O); - O << "} // End anonymous namespace.\n"; + O << "} // End anonymous namespace.\n\n"; + + // Force linkage magic. + O << "namespace llvmc {\n"; + O << "LLVMC_FORCE_LINKAGE_DECL(LLVMC_PLUGIN_NAME) {}\n"; + O << "}\n"; + // EOF } |