about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-10-13 10:32:43 +0000
committerbors <bors@rust-lang.org>2014-10-13 10:32:43 +0000
commit7dbd4349c406b997b486426d2e3aa9f2cc1fbd0c (patch)
tree170f3590a7b841e48d9ebb9823719a33398ae6ab /src/rustllvm/PassWrapper.cpp
parenta0ea210b394aa1b61d341593a3f9098fe5bf7806 (diff)
parent4deb4bcba590e707e23670d8b40bc5520c5ab7fe (diff)
downloadrust-7dbd4349c406b997b486426d2e3aa9f2cc1fbd0c.tar.gz
rust-7dbd4349c406b997b486426d2e3aa9f2cc1fbd0c.zip
auto merge of #17975 : thestinger/rust/fPIE, r=eddyb
Position independent code has fewer requirements in executables, so pass
the appropriate flag to LLVM in order to allow more optimization. At the
moment this means faster thread-local storage.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
-rw-r--r--src/rustllvm/PassWrapper.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp
index eb074001d58..ce3090390db 100644
--- a/src/rustllvm/PassWrapper.cpp
+++ b/src/rustllvm/PassWrapper.cpp
@@ -71,6 +71,7 @@ LLVMRustCreateTargetMachine(const char *triple,
                             bool EnableSegmentedStacks,
                             bool UseSoftFloat,
                             bool NoFramePointerElim,
+                            bool PositionIndependentExecutable,
                             bool FunctionSections,
                             bool DataSections) {
     std::string Error;
@@ -83,6 +84,7 @@ LLVMRustCreateTargetMachine(const char *triple,
     }
 
     TargetOptions Options;
+    Options.PositionIndependentExecutable = PositionIndependentExecutable;
     Options.NoFramePointerElim = NoFramePointerElim;
 #if LLVM_VERSION_MINOR < 5
     Options.EnableSegmentedStacks = EnableSegmentedStacks;