[llvm-dev] How to migrate Target option PositionIndependentExecutable for LLVM v3.9?

Leslie Zhai via llvm-dev llvm-dev at lists.llvm.org
Sun Jul 23 21:50:14 PDT 2017


Hi LLVM developers,

I am migrating dragonegg to GCC v6.8 and LLVM v3.9 right now 
https://github.com/xiangzhai/dragonegg

There was PositionIndependentExecutable Target option before LLVM v3.9 
https://github.com/llvm-mirror/llvm/blob/release_38/include/llvm/Target/TargetOptions.h#L181 
but after LLVM v3.9 https://reviews.llvm.org/D19733 it suggested to use 
PIELevel module flags instead of Target option 
PositionIndependentExecutable. so could I migrate it like this?


#if LLVM_VERSION_CODE > LLVM_VERSION(3, 8)
TheModule->setPIELevel(PIELevel::Large);
#else
   Options.PositionIndependentExecutable = flag_pie;           // -fPIE
#endif


please give me some suggestion, thanks a lot!

-- 
Regards,
Leslie Zhai - a LLVM developer https://reviews.llvm.org/p/xiangzhai/





More information about the llvm-dev mailing list