[PATCH] D29222: MCJIT: Support setting relocation model from C wrappers
Eugene Leviant via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 28 08:04:11 PST 2017
evgeny777 added inline comments.
================
Comment at: include/llvm-c/ExecutionEngine.h:46
unsigned OptLevel;
+ LLVMRelocMode RelMode;
LLVMCodeModel CodeModel;
----------------
deadalnix wrote:
> 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.
What exactly declaration are you talking about?
As far as I know relocation model is not something specific to ORC. At least I used legacy MCJIT API with PIC long time go, but I used C++ API (llvm/ExecutionEngine.h). The fact one can't use PIC from C API looks like as a limitation of C API to me.
================
Comment at: include/llvm/Support/CodeGenCWrappers.h:63
+ switch (Model) {
+ case LLVMRelocDefault:
+ case LLVMRelocStatic:
----------------
deadalnix wrote:
> 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.
Just because there is no such enumeration value. See llvm/Support/CodeGen.h
Repository:
rL LLVM
https://reviews.llvm.org/D29222
More information about the llvm-commits
mailing list