]> granicus.if.org Git - clang/commitdiff
Wire up -fpie and -fPIE to LLVM's newly added TargetOptions. No test
authorChandler Carruth <chandlerc@gmail.com>
Sun, 8 Apr 2012 21:09:51 +0000 (21:09 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 8 Apr 2012 21:09:51 +0000 (21:09 +0000)
case as we don't currently have any way of dumping target options or
otherwise observing this. Another small step toward fixing PR12380. With
this we generate TLS accesses using the static model instead of the
dynamic model, but we're still generating suboptimal code under the
mistaken assumption that the TLS offset might be greater than 2^32, and
therefor not viable as an immediate offset of a segment register.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154298 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/BackendUtil.cpp

index edc3a47186c0b4ddd80712fed170c61db46dd0ea..2f44711b607bbeeae92bcbb58e74827cedbea496 100644 (file)
@@ -344,6 +344,7 @@ bool EmitAssemblyHelper::AddEmitPasses(BackendAction Action,
   Options.RealignStack = CodeGenOpts.StackRealignment;
   Options.DisableTailCalls = CodeGenOpts.DisableTailCalls;
   Options.TrapFuncName = CodeGenOpts.TrapFuncName;
+  Options.PositionIndependentExecutable = LangOpts.PIELevel != 0;
 
   TargetMachine *TM = TheTarget->createTargetMachine(Triple, TargetOpts.CPU,
                                                      FeaturesStr, Options,