From a194f42d21cac273b9d2d44d70d02f7c7aef1304 Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Mon, 24 Jun 2024 16:46:53 +0200 Subject: [PATCH] rustc_target: Rewrite sparc_unknown_linux_gnu spec to use TargetOptions --- .../spec/targets/sparc_unknown_linux_gnu.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/compiler/rustc_target/src/spec/targets/sparc_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/sparc_unknown_linux_gnu.rs index c10f9d82d4636..6fa50a28c3709 100644 --- a/compiler/rustc_target/src/spec/targets/sparc_unknown_linux_gnu.rs +++ b/compiler/rustc_target/src/spec/targets/sparc_unknown_linux_gnu.rs @@ -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 { @@ -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() + }, } }