about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorParth Sane <parthsane@gmail.com>2019-12-02 17:52:45 +0530
committerParth Sane <parthsane@gmail.com>2019-12-03 14:44:14 +0530
commit54b206034fe50b2234ab8ddb15214f723fe8d951 (patch)
treebec85b917497520836a6dba7e2c9242bfbf4b7ec /src/rustllvm/PassWrapper.cpp
parent4af3ee8ee2a2bc1286b021db7600ba990359cf3f (diff)
downloadrust-54b206034fe50b2234ab8ddb15214f723fe8d951.tar.gz
rust-54b206034fe50b2234ab8ddb15214f723fe8d951.zip
Change linker for x86_64-fortanix-unknown-sgx to rust-lld
For SGX, the relocation using the relocation table is done by
the code in rust/src/libstd/sys/sgx/abi/reloc.rs and this code
should not require relocation. Setting RelaxELFRelocations flag
if allows this to happen, hence adding a Target Option for it.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
-rw-r--r--src/rustllvm/PassWrapper.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp
index a116ed282ac..b7f8e835909 100644
--- a/src/rustllvm/PassWrapper.cpp
+++ b/src/rustllvm/PassWrapper.cpp
@@ -393,7 +393,8 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
     bool TrapUnreachable,
     bool Singlethread,
     bool AsmComments,
-    bool EmitStackSizeSection) {
+    bool EmitStackSizeSection,
+    bool RelaxELFRelocations) {
 
   auto OptLevel = fromRust(RustOptLevel);
   auto RM = fromRust(RustReloc);
@@ -418,6 +419,7 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
   Options.MCOptions.AsmVerbose = AsmComments;
   Options.MCOptions.PreserveAsmComments = AsmComments;
   Options.MCOptions.ABIName = ABIStr;
+  Options.RelaxELFRelocations = RelaxELFRelocations;
 
   if (TrapUnreachable) {
     // Tell LLVM to codegen `unreachable` into an explicit trap instruction.