Skip to content

Commit beecea3

Browse files
committed
[SOL] Adjust compiler after upgrade to 1.75.0
1 parent 8da5689 commit beecea3

File tree

17 files changed

+58
-45
lines changed

17 files changed

+58
-45
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ jobs:
206206
- name: disable git crlf conversion
207207
run: git config --global core.autocrlf false
208208
- name: checkout the source code
209-
uses: actions/checkout@v3
209+
uses: actions/checkout@v4
210210
with:
211211
fetch-depth: 0
212212
- name: configure the PR in which the error message will be posted
@@ -228,6 +228,9 @@ jobs:
228228
- name: show the current environment
229229
run: src/ci/scripts/dump-environment.sh
230230
if: success() && !env.SKIP_JOB
231+
- name: install awscli
232+
run: src/ci/scripts/install-awscli.sh
233+
if: success() && !env.SKIP_JOB
231234
- name: install sccache
232235
run: src/ci/scripts/install-sccache.sh
233236
if: success() && !env.SKIP_JOB
@@ -237,6 +240,9 @@ jobs:
237240
- name: install clang
238241
run: src/ci/scripts/install-clang.sh
239242
if: success() && !env.SKIP_JOB
243+
- name: install tidy
244+
run: src/ci/scripts/install-tidy.sh
245+
if: success() && !env.SKIP_JOB
240246
- name: install WIX
241247
run: src/ci/scripts/install-wix.sh
242248
if: success() && !env.SKIP_JOB
@@ -429,7 +435,7 @@ jobs:
429435
- name: x86_64-gnu-llvm-17
430436
env:
431437
RUST_BACKTRACE: 1
432-
os: ubuntu-20.04-8core-32gb
438+
os: ubuntu-latest
433439
- name: x86_64-gnu-llvm-16
434440
env:
435441
RUST_BACKTRACE: 1

Cargo.lock

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -791,8 +791,8 @@ dependencies = [
791791
name = "core"
792792
version = "0.0.0"
793793
dependencies = [
794-
"getrandom 0.1.14",
795-
"rand 0.7.3",
794+
"getrandom 0.1.16",
795+
"rand",
796796
"rand_xorshift",
797797
]
798798

@@ -1560,7 +1560,7 @@ checksum = "a06fddc2749e0528d2813f95e050e87e52c8cbbae56223b9babf73b3e53b0cc6"
15601560
dependencies = [
15611561
"cfg-if",
15621562
"libc",
1563-
"wasi",
1563+
"wasi 0.11.0+wasi-snapshot-preview1",
15641564
]
15651565

15661566
[[package]]
@@ -2468,7 +2468,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
24682468
checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c"
24692469
dependencies = [
24702470
"libc",
2471-
"wasi",
2471+
"wasi 0.11.0+wasi-snapshot-preview1",
24722472
"windows-sys 0.48.0",
24732473
]
24742474

@@ -3149,7 +3149,7 @@ version = "0.6.4"
31493149
source = "registry+https://github.com/rust-lang/crates.io-index"
31503150
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
31513151
dependencies = [
3152-
"getrandom",
3152+
"getrandom 0.2.10",
31533153
]
31543154

31553155
[[package]]
@@ -5275,7 +5275,7 @@ dependencies = [
52755275
"rustc-demangle",
52765276
"std_detect",
52775277
"unwind",
5278-
"wasi",
5278+
"wasi 0.11.0+wasi-snapshot-preview1",
52795279
]
52805280

52815281
[[package]]
@@ -6146,7 +6146,7 @@ version = "1.8.0"
61466146
source = "registry+https://github.com/rust-lang/crates.io-index"
61476147
checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0"
61486148
dependencies = [
6149-
"getrandom",
6149+
"getrandom 0.2.10",
61506150
]
61516151

61526152
[[package]]
@@ -6186,6 +6186,12 @@ dependencies = [
61866186
"try-lock",
61876187
]
61886188

6189+
[[package]]
6190+
name = "wasi"
6191+
version = "0.9.0+wasi-snapshot-preview1"
6192+
source = "registry+https://github.com/rust-lang/crates.io-index"
6193+
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
6194+
61896195
[[package]]
61906196
name = "wasi"
61916197
version = "0.11.0+wasi-snapshot-preview1"
@@ -6675,8 +6681,3 @@ dependencies = [
66756681
"crossbeam-utils",
66766682
"flate2",
66776683
]
6678-
6679-
[[patch.unused]]
6680-
name = "compiler_builtins"
6681-
version = "0.1.76"
6682-
source = "git+https://github.com/solana-labs/compiler-builtins#2044d7e16a99d951853ce362e384027dec4c5b92"

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ debug = 0
107107
strip = true
108108

109109
[patch.crates-io]
110-
compiler_builtins = { git = "https://github.com/solana-labs/compiler-builtins" }
110+
compiler_builtins = { git = "https://github.com/solana-labs/compiler-builtins", tag = "solana-tools-v1.40" }
111111
# See comments in `library/rustc-std-workspace-core/README.md` for what's going on
112112
# here
113113
rustc-std-workspace-core = { path = 'library/rustc-std-workspace-core' }

compiler/rustc_codegen_ssa/src/base.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
419419
) -> Bx::Function {
420420
// The entry function is either `int main(void)` or `int main(int argc, char **argv)`, or
421421
// `usize efi_main(void *handle, void *system_table)` depending on the target.
422-
let is_bpf = cx.sess().target.arch == "bpf" && cx.sess().opts.test;
423422
let llfty = if cx.sess().target.os.contains("uefi") {
424423
cx.type_func(&[cx.type_ptr(), cx.type_ptr()], cx.type_isize())
425424
} else if cx.sess().target.main_needs_argc_argv {
@@ -498,7 +497,7 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
498497
bx.call(start_ty, None, None, start_fn, &args, None, instance)
499498
};
500499

501-
let result = bx.call(start_ty, None, start_fn, &args, None);
500+
let result = bx.call(start_ty, None, None, start_fn, &args, None);
502501
if cx.sess().target.os.contains("uefi") {
503502
bx.ret(result);
504503
} 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
@@ -432,7 +432,7 @@ pub mod __alloc_error_handler {
432432
pub unsafe fn __rdl_oom(size: usize, _align: usize) -> ! {
433433
core::panicking::panic_nounwind_fmt(format_args!(
434434
"memory allocation of {size} bytes failed"
435-
))
435+
), /* force_no_backtrace */ false)
436436
}
437437
}
438438

library/std/src/backtrace.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,14 @@ use crate::env;
9595
#[cfg(not(target_family = "solana"))]
9696
use crate::ffi::c_void;
9797
use crate::fmt;
98-
<<<<<<< HEAD
98+
#[cfg(not(target_family = "solana"))]
9999
use crate::panic::UnwindSafe;
100-
use crate::sync::atomic::{AtomicU8, Ordering::Relaxed};
101-
use crate::sync::LazyLock;
102-
#[cfg(not(any(target_arch = "bpf", target_arch = "sbf")))]
103-
use crate::sys_common::backtrace::{lock, output_filename, set_image_base};
104-
=======
105100
#[cfg(not(target_family = "solana"))]
106-
use crate::sync::atomic::{AtomicUsize, Ordering::Relaxed};
101+
use crate::sync::atomic::{AtomicU8, Ordering::Relaxed};
107102
#[cfg(not(target_family = "solana"))]
108103
use crate::sync::LazyLock;
109104
#[cfg(not(target_family = "solana"))]
110-
use crate::sys_common::backtrace::{lock, output_filename};
111-
#[cfg(not(target_family = "solana"))]
112-
use crate::vec::Vec;
113-
>>>>>>> 2a5aa6a151d ([SOL] Adjust SBF customization after upgrading to rust 1.65.0)
105+
use crate::sys_common::backtrace::{lock, output_filename, set_image_base};
114106

115107
/// A captured OS thread stack backtrace.
116108
///
@@ -494,8 +486,10 @@ impl fmt::Display for Backtrace {
494486
}
495487
}
496488

489+
#[cfg(not(target_family = "solana"))]
497490
type LazyResolve = impl (FnOnce() -> Capture) + Send + Sync + UnwindSafe;
498491

492+
#[cfg(not(target_family = "solana"))]
499493
fn lazy_resolve(mut capture: Capture) -> LazyResolve {
500494
move || {
501495
// Use the global backtrace lock to synchronize this as it's a

0 commit comments

Comments
 (0)