Add this symbol to the linker hack. This way it won't be dropped on the floor.
llvm::TargetMachineRegistry::getClosestStaticTargetForModule
llvm-svn: 54959
diff --git a/llvm-gcc-4.2/gcc/llvm-linker-hack.cpp b/llvm-gcc-4.2/gcc/llvm-linker-hack.cpp
index 5fa1c57..d2defdc 100644
--- a/llvm-gcc-4.2/gcc/llvm-linker-hack.cpp
+++ b/llvm-gcc-4.2/gcc/llvm-linker-hack.cpp
@@ -20,8 +20,10 @@
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
+#include "llvm/Module.h"
#include "llvm/ModuleProvider.h"
#include "llvm/Analysis/Verifier.h"
+#include "llvm/Target/TargetMachineRegistry.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Bitcode/ReaderWriter.h"
@@ -38,7 +40,7 @@
/// This function is never dynamically called.
///
void dummy_function() {
- new llvm::ExistingModuleProvider(0);
+ llvm::ModuleProvider *MP = new llvm::ExistingModuleProvider(0);
llvm::createVerifierPass();
llvm::CreateBitcodeWriterPass(*llvm::cout);
llvm::WriteBitcodeToFile(0, *llvm::cout);
@@ -82,8 +84,10 @@
llvm::createMemCpyOptPass();
llvm::createDeadTypeEliminationPass();
llvm::createLoopDeletionPass();
- llvm::createDeadCodeEliminationPass();
-
+
+ std::string Err;
+ llvm::TargetMachineRegistry::getClosestStaticTargetForModule(*MP->getModule(),
+ Err);
}
/* LLVM LOCAL end (ENTIRE FILE!) */