about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-03 19:41:54 +0100
committerGitHub <noreply@github.com>2019-12-03 19:41:54 +0100
commit69f1323167c71b79561fb4ac297de2fbd75eb017 (patch)
treedeaee689e9906a46e405b8da2d3e58184183b9c0 /src/librustc_codegen_llvm
parent71d1286bdf5cc094532a6263ad4cfaad5c54d097 (diff)
parent54b206034fe50b2234ab8ddb15214f723fe8d951 (diff)
downloadrust-69f1323167c71b79561fb4ac297de2fbd75eb017.tar.gz
rust-69f1323167c71b79561fb4ac297de2fbd75eb017.zip
Rollup merge of #66957 - parthsane:pvs/ftx_lld_linker, r=alexcrichton
Change Linker for x86_64-fortanix-unknown-sgx target to rust-lld

Changed linker for `x86_64-fortanix-unknown-sgx` target to `rust-lld`
This change needed the RelaxELFRelocations flag to be set for it to work correctly

r? @jethrogb
Diffstat (limited to 'src/librustc_codegen_llvm')
-rw-r--r--src/librustc_codegen_llvm/back/write.rs3
-rw-r--r--src/librustc_codegen_llvm/llvm/ffi.rs3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/librustc_codegen_llvm/back/write.rs b/src/librustc_codegen_llvm/back/write.rs
index 07ac76cec99..48bbc130723 100644
--- a/src/librustc_codegen_llvm/back/write.rs
+++ b/src/librustc_codegen_llvm/back/write.rs
@@ -167,7 +167,7 @@ pub fn target_machine_factory(sess: &Session, optlvl: config::OptLevel, find_fea
     let emit_stack_size_section = sess.opts.debugging_opts.emit_stack_sizes;
 
     let asm_comments = sess.asm_comments();
-
+    let relax_elf_relocations = sess.target.target.options.relax_elf_relocations;
     Arc::new(move || {
         let tm = unsafe {
             llvm::LLVMRustCreateTargetMachine(
@@ -183,6 +183,7 @@ pub fn target_machine_factory(sess: &Session, optlvl: config::OptLevel, find_fea
                 singlethread,
                 asm_comments,
                 emit_stack_size_section,
+                relax_elf_relocations,
             )
         };
 
diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs
index a49e863fa21..fd31e65c9d3 100644
--- a/src/librustc_codegen_llvm/llvm/ffi.rs
+++ b/src/librustc_codegen_llvm/llvm/ffi.rs
@@ -1702,7 +1702,8 @@ extern "C" {
                                        TrapUnreachable: bool,
                                        Singlethread: bool,
                                        AsmComments: bool,
-                                       EmitStackSizeSection: bool)
+                                       EmitStackSizeSection: bool,
+                                       RelaxELFRelocations: bool)
                                        -> Option<&'static mut TargetMachine>;
     pub fn LLVMRustDisposeTargetMachine(T: &'static mut TargetMachine);
     pub fn LLVMRustAddBuilderLibraryInfo(PMB: &'a PassManagerBuilder,