[llvm-dev] How does -fPIE get passed from clang to llc when run on a .ll file?

Phil Tomson via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 6 11:00:21 PST 2015


On Fri, Nov 6, 2015 at 10:46 AM, Tim Northover <t.p.northover at gmail.com>
wrote:

> On 6 November 2015 at 10:32, Phil Tomson via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > So if I were to pass this .ll file (global_dat_x86_pie.ll) to llc how
> would
> > llc know that the PIE Level is 2? Is this an oversight, bug, or expetcted
> > behaviour with a different workaround?
>
> It looks like it's the "-enable-pie" command line option, which gets
> hooked up to TargetOptions::PositionIndependentExecutable if you're
> doing it programmatically. I'm not sure of the history behind why
> they're different though, I'm afraid.
>
>
With 3.6 I get an unused argument warning with -enable-pie:

$ clang -v -emit-llvm -enable-pie -O0 -S global_dat.c -o
global_dat_x86_pie.ll

clang: warning: argument unused during compilation: '-e nable-pie'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151106/20e3fceb/attachment-0001.html>


More information about the llvm-dev mailing list