Skip to content

Commit 2a5aa6a

Browse files
dmakarovLucasSte
authored andcommitted
[SOL] Adjust SBF customization after upgrading to rust 1.65.0
1 parent 8684d88 commit 2a5aa6a

File tree

45 files changed

+304
-277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+304
-277
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ jobs:
226226
uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
227227
with:
228228
github_token: "${{ secrets.github_token }}"
229-
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try'"
229+
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try' && github.ref != 'refs/heads/try-perf'"
230230
- name: collect CPU statistics
231231
run: src/ci/scripts/collect-cpu-stats.sh
232232
if: success() && !env.SKIP_JOB
@@ -245,9 +245,6 @@ jobs:
245245
- name: install WIX
246246
run: src/ci/scripts/install-wix.sh
247247
if: success() && !env.SKIP_JOB
248-
- name: ensure the build happens on a partition with enough space
249-
run: src/ci/scripts/symlink-build-dir.sh
250-
if: success() && !env.SKIP_JOB
251248
- name: disable git crlf conversion
252249
run: src/ci/scripts/disable-git-crlf-conversion.sh
253250
if: success() && !env.SKIP_JOB

compiler/rustc_codegen_ssa/src/back/metadata.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,10 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
208208
"avr" => Architecture::Avr,
209209
"msp430" => Architecture::Msp430,
210210
"hexagon" => Architecture::Hexagon,
211-
"bpf" => Architecture::Bpf,
212211
"loongarch64" => Architecture::LoongArch64,
213212
"csky" => Architecture::Csky,
213+
"bpf" => Architecture::Bpf,
214+
"sbf" => Architecture::Bpf,
214215
// Unsupported architecture.
215216
_ => return None,
216217
};

compiler/rustc_target/src/abi/call/sbf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn compute_abi_info<Ty>(fn_abi: &mut FnAbi<'_, Ty>) {
2626
classify_ret(&mut fn_abi.ret);
2727
}
2828

29-
for arg in &mut fn_abi.args {
29+
for arg in fn_abi.args.iter_mut() {
3030
if arg.is_ignore() {
3131
continue;
3232
}

compiler/rustc_target/src/spec/sbf_base.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::abi::Endian;
2-
use super::{LinkArgs, LinkerFlavor, PanicStrategy, TargetOptions, LldFlavor};
2+
use super::{cvs, LinkArgs, LinkerFlavor, PanicStrategy, TargetOptions, LldFlavor};
33

44
pub fn opts() -> TargetOptions {
55
let linker_script = r"
@@ -33,6 +33,7 @@ SECTIONS
3333
lld_args.push("-z".into());
3434
lld_args.push("notext".into());
3535
let mut pre_link_args = LinkArgs::new();
36+
pre_link_args.insert(LinkerFlavor::Ld, lld_args.clone());
3637
pre_link_args.insert(LinkerFlavor::Lld(LldFlavor::Ld), lld_args);
3738

3839
TargetOptions {
@@ -46,6 +47,7 @@ SECTIONS
4647
env: "".into(),
4748
executables: true,
4849
features: "+solana".into(),
50+
families: cvs!["solana"],
4951
link_script: Some(linker_script.into()),
5052
linker: Some("rust-lld".into()),
5153
linker_flavor: LinkerFlavor::Lld(LldFlavor::Ld),

compiler/rustc_target/src/spec/tests/tests_impl.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ impl Target {
2727
matches!(self.linker_flavor, LinkerFlavor::WasmLld(..))
2828
);
2929
assert_eq!(self.os == "emscripten", matches!(self.linker_flavor, LinkerFlavor::EmCc));
30-
assert_eq!(self.arch == "bpf", matches!(self.linker_flavor, LinkerFlavor::Bpf));
30+
assert_eq!(self.arch == "bpf" && self.features != "+solana",
31+
matches!(self.linker_flavor, LinkerFlavor::Bpf));
3132
assert_eq!(self.arch == "nvptx64", matches!(self.linker_flavor, LinkerFlavor::Ptx));
3233

3334
for args in [

library/core/benches/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// wasm32 does not support benches (no time).
2-
#![cfg(not(any(target_arch = "wasm32", target_arch = "bpf", target_arch = "sbf")))]
2+
#![cfg(not(any(target_arch = "wasm32", target_family = "solana")))]
33
#![feature(flt2dec)]
44
#![feature(test)]
55
#![feature(trusted_random_access)]

library/core/benches/num/int_log/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg(all(not(target_arch = "bpf"), not(target_arch = "sbf")))]
1+
#![cfg(not(target_family = "solana"))]
22
use rand::Rng;
33
use test::{black_box, Bencher};
44

library/core/src/fmt/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use crate::cell::{Cell, Ref, RefCell, RefMut, SyncUnsafeCell, UnsafeCell};
66
use crate::char::EscapeDebugExtArgs;
77
use crate::iter;
8-
#[cfg(any(target_arch = "bpf", target_arch = "sbf"))]
8+
#[cfg(target_family = "solana")]
99
use crate::intrinsics::abort;
1010
use crate::marker::PhantomData;
1111
use crate::mem;

library/core/src/fmt/num.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ mod imp {
474474
);
475475
}
476476

477-
#[cfg(not(any(target_pointer_width = "64", target_arch = "wasm32", target_arch = "bpf", target_arch = "sbf")))]
477+
#[cfg(not(any(target_pointer_width = "64", target_arch = "wasm32", target_family = "solana")))]
478478
mod imp {
479479
use super::*;
480480
impl_Display!(i8, u8, i16, u16, i32, u32, isize, usize as u32 via to_u32 named fmt_u32);

library/core/tests/array.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg(all(not(target_arch = "bpf"), not(target_arch = "sbf")))]
1+
#![cfg(not(target_family = "solana"))]
22
use core::{array, assert_eq};
33
use core::convert::TryFrom;
44
use core::num::NonZeroUsize;
@@ -513,7 +513,7 @@ fn array_rsplit_array_mut_out_of_bounds() {
513513
}
514514

515515
#[test]
516-
#[cfg(all(not(target_arch = "bpf"), not(target_arch = "sbf")))]
516+
#[cfg(not(target_family = "solana"))]
517517
fn array_intoiter_advance_by() {
518518
use std::cell::Cell;
519519
struct DropCounter<'a>(usize, &'a Cell<usize>);
@@ -567,7 +567,7 @@ fn array_intoiter_advance_by() {
567567
}
568568

569569
#[test]
570-
#[cfg(all(not(target_arch = "bpf"), not(target_arch = "sbf")))]
570+
#[cfg(not(target_family = "solana"))]
571571
fn array_intoiter_advance_back_by() {
572572
use std::cell::Cell;
573573
struct DropCounter<'a>(usize, &'a Cell<usize>);

0 commit comments

Comments
 (0)