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

Leslie Zhai via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 1 02:01:46 PDT 2017


Hi Xlous,

感谢您的回复!


在 2017年08月01日 16:57, Xlous zeng 写道:
> You can use following c++ code ship to determines what version of 
> Clang you used currently.
yes! 
https://github.com/xiangzhai/dragonegg/blob/gcc-6_3-branch/include/dragonegg/Internals.h#L33

but I prefer to find out the "equivalent" just like migrate 
x86_sse2_psrl_dq for LLVM v3.9 :)


>
> #if defined(__clang__)
> cout<<__clang_major__<<" "<<__clang_minor__<<" 
> "<<__clang_patchlevel__<<endl;
>
>
>> 在 2017年7月24日,下午12:50,Leslie Zhai via llvm-dev 
>> <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> 写道:
>>
>> 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/
>>>>
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>

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






More information about the llvm-dev mailing list