Skip to content

Commit 4bd4e2e

Browse files
committed
Auto merge of rust-lang#112386 - loongarch-rs:reloc-static, r=eholk
loongarch64-unknown-none*: Set default relocation model to static This PR sets the default relocation model to `static` for `loongarch64-unknown-none*` targets. This change aims to streamline the development of the bare-metal project by removing the need for the executable program loader to implement relocation.
2 parents caeea3f + 37b465f commit 4bd4e2e

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

compiler/rustc_target/src/spec/loongarch64_unknown_none.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::{Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy};
1+
use super::{Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel};
22
use super::{Target, TargetOptions};
33

44
pub fn target() -> Target {
@@ -13,8 +13,7 @@ pub fn target() -> Target {
1313
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::No),
1414
llvm_abiname: "lp64d".into(),
1515
max_atomic_width: Some(64),
16-
position_independent_executables: true,
17-
static_position_independent_executables: true,
16+
relocation_model: RelocModel::Static,
1817
panic_strategy: PanicStrategy::Abort,
1918
code_model: Some(CodeModel::Small),
2019
..Default::default()

compiler/rustc_target/src/spec/loongarch64_unknown_none_softfloat.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::{Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy};
1+
use super::{Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel};
22
use super::{Target, TargetOptions};
33

44
pub fn target() -> Target {
@@ -14,8 +14,7 @@ pub fn target() -> Target {
1414
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::No),
1515
llvm_abiname: "lp64s".into(),
1616
max_atomic_width: Some(64),
17-
position_independent_executables: true,
18-
static_position_independent_executables: true,
17+
relocation_model: RelocModel::Static,
1918
panic_strategy: PanicStrategy::Abort,
2019
code_model: Some(CodeModel::Small),
2120
..Default::default()

0 commit comments

Comments
 (0)