<div dir="ltr">If the target platform is linux and -fPIE is on the command line, clang sets TargetOptions::PositionIndependentExecutable in EmitAssemblyHelper::CreateTargetrMachine.<br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 6, 2015 at 11:20 AM, Phil Tomson via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Fri, Nov 6, 2015 at 11:10 AM, Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>On 6 November 2015 at 11:00, Phil Tomson <<a href="mailto:phil.a.tomson@gmail.com" target="_blank">phil.a.tomson@gmail.com</a>> wrote:<br>
> With 3.6 I get an unused argument warning with -enable-pie:<br>
><br>
> $ clang -v -emit-llvm -enable-pie -O0 -S global_dat.c -o<br>
> global_dat_x86_pie.ll<br>
<br>
</span>Yes, it's an llc option not a Clang option. It actually looks like<br>
Clang doesn't forward it to LLVM at all (almost certainly a bug, if<br>
so). But that's probably OK because the only place LLVM actually uses<br>
it at all is to determine what kind of TLS model to use<br>
(TargetMachine.cpp), which linkers can mostly relax anyway.<br></blockquote><div><br></div></span><div>In my case I'm actually working on a backend for a new architecture and need this to show up in LLVM because certain pseudo ops need to be expanded in a certain way if we're using PIE (vs. just a default static link). So are these options accessible in the Target-specific code?  <br></div><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
It does seem to get passed onto the linker by Clang though.<br></blockquote><div><br></div></span><div>Not sure how that can work.<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Cheers.<br>
<span><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br></div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div></div>