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.
This commit is contained in:
parent
4af3ee8ee2
commit
54b206034f
6 changed files with 40 additions and 31 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue