mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
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
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user