about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorJan-Erik Rediger <janerik@fnordig.de>2016-07-13 00:41:40 +0200
committerJan-Erik Rediger <janerik@fnordig.de>2016-07-29 10:29:44 +0200
commit9e706f90cbc844bb09187e01acd4ae075130bc81 (patch)
tree61cf2b6522b113e4ea758e58bb24e362606a0f60 /src/rustllvm/PassWrapper.cpp
parentdbb4178f4effa2f7686aca70d5fdfa0eff94e692 (diff)
downloadrust-9e706f90cbc844bb09187e01acd4ae075130bc81.tar.gz
rust-9e706f90cbc844bb09187e01acd4ae075130bc81.zip
[LLVM-3.9] Configure PIE at the module level instead of compilation unit level
This was deleted here[1] which appears to be replaced by this[2]
which is a new setPIELevel function on the LLVM module itself.

[1]: http://reviews.llvm.org/D19753
[2]: http://reviews.llvm.org/D19671
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
-rw-r--r--src/rustllvm/PassWrapper.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp
index 64edc79a86a..edf83bf80d6 100644
--- a/src/rustllvm/PassWrapper.cpp
+++ b/src/rustllvm/PassWrapper.cpp
@@ -188,7 +188,10 @@ LLVMRustCreateTargetMachine(const char *triple,
     }
 
     TargetOptions Options;
+#if LLVM_VERSION_MINOR <= 8
     Options.PositionIndependentExecutable = PositionIndependentExecutable;
+#endif
+
     Options.FloatABIType = FloatABI::Default;
     if (UseSoftFloat) {
         Options.FloatABIType = FloatABI::Soft;
@@ -411,3 +414,10 @@ extern "C" LLVMTargetDataRef
 LLVMRustGetModuleDataLayout(LLVMModuleRef M) {
     return wrap(&unwrap(M)->getDataLayout());
 }
+
+extern "C" void
+LLVMRustSetModulePIELevel(LLVMModuleRef M) {
+#if LLVM_VERSION_MINOR >= 9
+    unwrap(M)->setPIELevel(PIELevel::Level::Default);
+#endif
+}