Skip to content

Commit b653b6e

Browse files
dmakarovLucasSte
authored andcommitted
[SOL] Adjust SBF customization after upgrading to rust 1.65.0
1 parent 1faafe9 commit b653b6e

File tree

40 files changed

+297
-233
lines changed

40 files changed

+297
-233
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ jobs:
222222
uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
223223
with:
224224
github_token: "${{ secrets.github_token }}"
225-
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try'"
225+
if: "success() && !env.SKIP_JOB && github.ref != 'refs/heads/try' && github.ref != 'refs/heads/try-perf'"
226226
- name: collect CPU statistics
227227
run: src/ci/scripts/collect-cpu-stats.sh
228228
if: success() && !env.SKIP_JOB
@@ -241,9 +241,6 @@ jobs:
241241
- name: install WIX
242242
run: src/ci/scripts/install-wix.sh
243243
if: success() && !env.SKIP_JOB
244-
- name: ensure the build happens on a partition with enough space
245-
run: src/ci/scripts/symlink-build-dir.sh
246-
if: success() && !env.SKIP_JOB
247244
- name: disable git crlf conversion
248245
run: src/ci/scripts/disable-git-crlf-conversion.sh
249246
if: success() && !env.SKIP_JOB

compiler/rustc_codegen_ssa/src/back/metadata.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
216216
"loongarch64" => (Architecture::LoongArch64, None),
217217
"csky" => (Architecture::Csky, None),
218218
"arm64ec" => (Architecture::Aarch64, Some(SubArchitecture::Arm64EC)),
219+
"bpf" => (Architecture::Bpf, None),
220+
"sbf" => (Architecture::Bpf, None),
219221
// Unsupported architecture.
220222
_ => return None,
221223
};

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,7 +1,7 @@
11
// wasm32 does not support benches (no time).
22
// Disabling in Miri as these would take too long.
33
#![cfg(not(miri))]
4-
#![cfg(not(any(target_arch = "wasm32", target_arch = "bpf", target_arch = "sbf")))]
4+
#![cfg(not(any(target_arch = "wasm32", target_family = "solana")))]
55
#![feature(flt2dec)]
66
#![feature(test)]
77
#![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
@@ -479,7 +479,7 @@ mod imp {
479479
);
480480
}
481481

482-
#[cfg(not(any(target_pointer_width = "64", target_arch = "wasm32", target_arch = "bpf", target_arch = "sbf")))]
482+
#[cfg(not(any(target_pointer_width = "64", target_arch = "wasm32", target_family = "solana")))]
483483
mod imp {
484484
use super::*;
485485
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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)