Skip to content

Commit

Permalink
rustc_target: Rewrite sparc_unknown_linux_gnu spec to use TargetOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubitz committed Jun 24, 2024
1 parent 8f7175c commit a194f42
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions compiler/rustc_target/src/spec/targets/sparc_unknown_linux_gnu.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
use crate::abi::Endian;
use crate::spec::{base, Cc, LinkerFlavor, Lld, Target};
use crate::spec::{base, Cc, LinkerFlavor, Lld, Target, TargetOptions};

pub fn target() -> Target {
let mut base = base::linux_gnu::opts();
base.endian = Endian::Big;
base.cpu = "v9".into();
base.max_atomic_width = Some(32);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-mv8plus"]);

Target {
llvm_target: "sparc-unknown-linux-gnu".into(),
metadata: crate::spec::TargetMetadata {
Expand All @@ -19,6 +13,15 @@ pub fn target() -> Target {
pointer_width: 32,
data_layout: "E-m:e-p:32:32-i64:64-f128:64-n32-S64".into(),
arch: "sparc".into(),
options: base,
options: TargetOptions {
cpu: "v9".into(),
endian: Endian::Big,
late_link_args: TargetOptions::link_args(
LinkerFlavor::Gnu(Cc::Yes, Lld::No),
&["-mv8plus"],
),
max_atomic_width: Some(32),
..base::linux_gnu::opts()
},
}
}

0 comments on commit a194f42

Please sign in to comment.