Skip to content

Commit

Permalink
force the LLVM JIT to pick a memory model compatible with the LLVM Me…
Browse files Browse the repository at this point in the history
…moryManager
  • Loading branch information
vtjnash committed Jun 1, 2016
1 parent e56c2a1 commit 7086ff0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5743,13 +5743,13 @@ extern "C" void jl_init_codegen(void)
.setMCJITMemoryManager(std::unique_ptr<RTDyldMemoryManager>{new SectionMemoryManager()})
#endif
.setTargetOptions(options)
#if (defined(_OS_LINUX_) && defined(_CPU_X86_64_)) || defined(CODEGEN_TLS)
#if (defined(_OS_LINUX_) && defined(_CPU_X86_64_))
.setRelocationModel(Reloc::PIC_)
#elif !defined(LLVM39)
.setRelocationModel(Reloc::Default)
#endif
#ifdef CODEGEN_TLS
.setCodeModel(CodeModel::Small)
#ifdef _P64
.setCodeModel(CodeModel::Large)
#else
.setCodeModel(CodeModel::JITDefault)
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@
# define MEMDEBUG
# define KEEP_BODIES
# endif
// Memory sanitizer also needs thread-local storage
// Memory sanitizer needs TLS, which llvm only supports for the small memory model
# if __has_feature(memory_sanitizer)
# define CODEGEN_TLS
// todo: fix the llvm MemoryManager to work with small memory model
# endif
#endif

Expand Down

0 comments on commit 7086ff0

Please sign in to comment.