Skip to content

Commit

Permalink
Initialize LLVM's ARM target when compiling for it.
Browse files Browse the repository at this point in the history
  • Loading branch information
kumpera committed Nov 14, 2012
1 parent 0538666 commit 0a6b695
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions mono/mini/mini-llvm-cpp.cpp
Expand Up @@ -20,6 +20,14 @@
// possible
//

#include "config.h"
//undef those as llvm defines them on its own config.h as well.
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION

#include <stdint.h>

#include <llvm/Support/raw_ostream.h>
Expand Down Expand Up @@ -51,6 +59,10 @@
((LLVM_MAJOR_VERSION > (major)) || \
((LLVM_MAJOR_VERSION == (major)) && (LLVM_MINOR_VERSION >= (minor))))

// extern "C" void LLVMInitializeARMTargetInfo();
// extern "C" void LLVMInitializeARMTarget ();
// extern "C" void LLVMInitializeARMTargetMC ();

using namespace llvm;

class MonoJITMemoryManager : public JITMemoryManager
Expand Down Expand Up @@ -510,9 +522,15 @@ mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, Func

force_pass_linking ();

#ifdef TARGET_ARM
LLVMInitializeARMTarget ();
LLVMInitializeARMTargetInfo ();
LLVMInitializeARMTargetMC ();
#else
LLVMInitializeX86Target ();
LLVMInitializeX86TargetInfo ();
LLVMInitializeX86TargetMC ();
#endif

mono_mm = new MonoJITMemoryManager ();
mono_mm->alloc_cb = alloc_cb;
Expand Down

0 comments on commit 0a6b695

Please sign in to comment.