Skip to content

Commit b7eb475

Browse files
committed
[SOL] Adjust compiler after upgrade to 1.75.0
1 parent 194b4f4 commit b7eb475

File tree

16 files changed

+51
-28
lines changed

16 files changed

+51
-28
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ jobs:
313313
- name: disable git crlf conversion
314314
run: git config --global core.autocrlf false
315315
- name: checkout the source code
316-
uses: actions/checkout@v3
316+
uses: actions/checkout@v4
317317
with:
318318
fetch-depth: 0
319319
- name: configure the PR in which the error message will be posted
@@ -335,6 +335,9 @@ jobs:
335335
- name: show the current environment
336336
run: src/ci/scripts/dump-environment.sh
337337
if: success() && !env.SKIP_JOB
338+
- name: install awscli
339+
run: src/ci/scripts/install-awscli.sh
340+
if: success() && !env.SKIP_JOB
338341
- name: install sccache
339342
run: src/ci/scripts/install-sccache.sh
340343
if: success() && !env.SKIP_JOB
@@ -344,6 +347,9 @@ jobs:
344347
- name: install clang
345348
run: src/ci/scripts/install-clang.sh
346349
if: success() && !env.SKIP_JOB
350+
- name: install tidy
351+
run: src/ci/scripts/install-tidy.sh
352+
if: success() && !env.SKIP_JOB
347353
- name: install WIX
348354
run: src/ci/scripts/install-wix.sh
349355
if: success() && !env.SKIP_JOB
@@ -536,7 +542,7 @@ jobs:
536542
- name: x86_64-gnu-llvm-17
537543
env:
538544
RUST_BACKTRACE: 1
539-
os: ubuntu-20.04-8core-32gb
545+
os: ubuntu-latest
540546
- name: x86_64-gnu-llvm-16
541547
env:
542548
RUST_BACKTRACE: 1

Cargo.lock

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
14341434
dependencies = [
14351435
"cfg-if",
14361436
"libc",
1437-
"wasi",
1437+
"wasi 0.11.0+wasi-snapshot-preview1",
14381438
]
14391439

14401440
[[package]]
@@ -2925,7 +2925,7 @@ version = "0.6.4"
29252925
source = "registry+https://github.com/rust-lang/crates.io-index"
29262926
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
29272927
dependencies = [
2928-
"getrandom",
2928+
"getrandom 0.2.10",
29292929
]
29302930

29312931
[[package]]
@@ -5701,7 +5701,7 @@ version = "1.11.0"
57015701
source = "registry+https://github.com/rust-lang/crates.io-index"
57025702
checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a"
57035703
dependencies = [
5704-
"getrandom",
5704+
"getrandom 0.2.10",
57055705
]
57065706

57075707
[[package]]
@@ -5732,6 +5732,12 @@ dependencies = [
57325732
"winapi-util",
57335733
]
57345734

5735+
[[package]]
5736+
name = "wasi"
5737+
version = "0.9.0+wasi-snapshot-preview1"
5738+
source = "registry+https://github.com/rust-lang/crates.io-index"
5739+
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
5740+
57355741
[[package]]
57365742
name = "wasi"
57375743
version = "0.11.0+wasi-snapshot-preview1"

compiler/rustc_codegen_ssa/src/base.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,6 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
453453
) -> Bx::Function {
454454
// The entry function is either `int main(void)` or `int main(int argc, char **argv)`, or
455455
// `usize efi_main(void *handle, void *system_table)` depending on the target.
456-
let is_bpf = cx.sess().target.arch == "bpf" && cx.sess().opts.test;
457456
let llfty = if cx.sess().target.os.contains("uefi") {
458457
cx.type_func(&[cx.type_ptr(), cx.type_ptr()], cx.type_isize())
459458
} else if cx.sess().target.main_needs_argc_argv {
@@ -532,7 +531,7 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
532531
bx.call(start_ty, None, None, start_fn, &args, None, instance)
533532
};
534533

535-
let result = bx.call(start_ty, None, start_fn, &args, None);
534+
let result = bx.call(start_ty, None, None, start_fn, &args, None);
536535
if cx.sess().target.os.contains("uefi") {
537536
bx.ret(result);
538537
} else {

compiler/rustc_target/src/spec/base/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub(crate) mod netbsd;
2222
pub(crate) mod nto_qnx;
2323
pub(crate) mod openbsd;
2424
pub(crate) mod redox;
25+
pub(crate) mod sbf_base;
2526
pub(crate) mod solaris;
2627
pub(crate) mod solid;
2728
pub(crate) mod teeos;

compiler/rustc_target/src/spec/sbf_base.rs renamed to compiler/rustc_target/src/spec/base/sbf_base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::abi::Endian;
2-
use super::{Cc, cvs, LinkerFlavor, Lld, PanicStrategy, TargetOptions};
2+
use crate::spec::{Cc, cvs, LinkerFlavor, Lld, PanicStrategy, TargetOptions};
33

44
pub fn opts() -> TargetOptions {
55
let linker_script = r"

compiler/rustc_target/src/spec/bpfel_unknown_unknown.rs renamed to compiler/rustc_target/src/spec/targets/bpfel_unknown_unknown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::spec::Target;
2-
use crate::spec::sbf_base;
2+
use crate::spec::base::sbf_base;
33

44
pub fn target() -> Target {
55
Target {

compiler/rustc_target/src/spec/sbf_solana_solana.rs renamed to compiler/rustc_target/src/spec/targets/sbf_solana_solana.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::spec::Target;
2-
use crate::spec::sbf_base;
2+
use crate::spec::base::sbf_base;
33

44
pub fn target() -> Target {
55
Target {

library/alloc/src/alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,6 @@ pub mod __alloc_error_handler {
453453
pub unsafe fn __rdl_oom(size: usize, _align: usize) -> ! {
454454
core::panicking::panic_nounwind_fmt(format_args!(
455455
"memory allocation of {size} bytes failed"
456-
))
456+
), /* force_no_backtrace */ false)
457457
}
458458
}

library/std/src/backtrace.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,16 @@ mod tests;
9292
use crate::backtrace_rs::{self, BytesOrWideString};
9393
use crate::ffi::c_void;
9494
use crate::panic::UnwindSafe;
95-
#[cfg(not(any(target_arch = "bpf", target_arch = "sbf")))]
95+
#[cfg(not(target_family = "solana"))]
9696
use crate::sync::LazyLock;
97-
#[cfg(not(any(target_arch = "bpf", target_arch = "sbf")))]
97+
#[cfg(not(target_family = "solana"))]
9898
use crate::sync::atomic::AtomicU8;
99-
#[cfg(not(any(target_arch = "bpf", target_arch = "sbf")))]
99+
#[cfg(not(target_family = "solana"))]
100100
use crate::sync::atomic::Ordering::Relaxed;
101-
#[cfg(not(any(target_arch = "bpf", target_arch = "sbf")))]
101+
#[cfg(not(target_family = "solana"))]
102102
use crate::sys::backtrace::{lock, output_filename, set_image_base};
103103
use crate::{env, fmt};
104104

105-
106105
/// A captured OS thread stack backtrace.
107106
///
108107
/// This type represents a stack backtrace for an OS thread captured at a
@@ -486,6 +485,7 @@ impl fmt::Display for Backtrace {
486485
}
487486
}
488487

488+
#[cfg(not(target_family = "solana"))]
489489
mod helper {
490490
use super::*;
491491
pub(super) type LazyResolve = impl (FnOnce() -> Capture) + Send + Sync + UnwindSafe;

library/std/src/panicking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,14 +518,12 @@ pub use realstd::rt::panic_count;
518518

519519
/// Invoke a closure, capturing the cause of an unwinding panic if one occurs.
520520
#[cfg(feature = "panic_immediate_abort")]
521-
#[cfg(not(target_arch = "bpf"))]
522521
pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>> {
523522
Ok(f())
524523
}
525524

526525
/// Invoke a closure, capturing the cause of an unwinding panic if one occurs.
527526
#[cfg(not(feature = "panic_immediate_abort"))]
528-
#[cfg(not(target_arch = "bpf"))]
529527
pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>> {
530528
union Data<F, R> {
531529
f: ManuallyDrop<F>,
@@ -981,6 +979,7 @@ pub fn begin_panic<M: Any + Send>(_msg: M) -> ! {
981979
None,
982980
Location::caller(),
983981
false,
982+
false,
984983
);
985984
crate::sys::panic(&info);
986985
}
@@ -999,6 +998,7 @@ pub fn begin_panic_fmt(msg: &fmt::Arguments<'_>) -> ! {
999998
Some(msg),
1000999
Location::caller(),
10011000
false,
1001+
false,
10021002
);
10031003
crate::sys::panic(&info);
10041004
}

0 commit comments

Comments
 (0)