From 5081de5ae708bf783cc05a309f85212c0f793b99 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 8 Apr 2012 21:09:51 +0000 Subject: [PATCH] Wire up -fpie and -fPIE to LLVM's newly added TargetOptions. No test 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index edc3a47186..2f44711b60 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -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, -- 2.40.0