[PATCH] D29222: MCJIT: Support setting relocation model from C wrappers

Amaury SECHET via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 28 06:12:41 PST 2017


deadalnix added inline comments.


================
Comment at: include/llvm-c/ExecutionEngine.h:46
   unsigned OptLevel;
+  LLVMRelocMode RelMode;
   LLVMCodeModel CodeModel;
----------------
Sadly, many people are using the C API in foreign languages (as in not C, not German or French).

I know there is no promise to keep the OrcJIT API stable at this stage, so maybe that's ok, but it's a bit unfortunate that this ends up being in the ExecutionEngine rather than some Orc specific header. Maybe deproting Orc specific declaration from there to some Orc specific header would be better.


================
Comment at: include/llvm/Support/CodeGenCWrappers.h:63
+  switch (Model) {
+  case LLVMRelocDefault:
+  case LLVMRelocStatic:
----------------
Why not use Reloc::Default ?

I've been thinking that Reloc::Default should probably not default to static every time, because more and more linux distro use PIE by default on amd64. Maybe default should become whatever the target uses as default.


Repository:
  rL LLVM

https://reviews.llvm.org/D29222





More information about the llvm-commits mailing list