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

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 6 11:10:10 PST 2015


On 6 November 2015 at 11:00, Phil Tomson <phil.a.tomson at gmail.com> wrote:
> 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

Yes, it's an llc option not a Clang option. It actually looks like
Clang doesn't forward it to LLVM at all (almost certainly a bug, if
so). But that's probably OK because the only place LLVM actually uses
it at all is to determine what kind of TLS model to use
(TargetMachine.cpp), which linkers can mostly relax anyway.

It does seem to get passed onto the linker by Clang though.

Cheers.

Tim.


More information about the llvm-dev mailing list