Skip to content

Commit 837a8c8

Browse files
LucasStec410-f3r
authored andcommitted
[SOL] Adjust compiler after upgrade to 1.75.0
1 parent 3c7a160 commit 837a8c8

File tree

17 files changed

+114
-103
lines changed

17 files changed

+114
-103
lines changed

.github/workflows/ci.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ jobs:
255255
- name: disable git crlf conversion
256256
run: git config --global core.autocrlf false
257257
- name: checkout the source code
258-
uses: actions/checkout@v3
258+
uses: actions/checkout@v4
259259
with:
260260
fetch-depth: 0
261261
- name: configure the PR in which the error message will be posted
@@ -294,6 +294,9 @@ jobs:
294294
- name: install clang
295295
run: src/ci/scripts/install-clang.sh
296296
if: success() && !env.SKIP_JOB
297+
- name: install tidy
298+
run: src/ci/scripts/install-tidy.sh
299+
if: success() && !env.SKIP_JOB
297300
- name: install WIX
298301
run: src/ci/scripts/install-wix.sh
299302
if: success() && !env.SKIP_JOB
@@ -474,7 +477,7 @@ jobs:
474477
- name: x86_64-gnu-llvm-17
475478
env:
476479
RUST_BACKTRACE: 1
477-
os: ubuntu-20.04-8core-32gb
480+
os: ubuntu-latest
478481
- name: x86_64-gnu-llvm-16
479482
env:
480483
RUST_BACKTRACE: 1

Cargo.lock

+61-3
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,7 @@ checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
14361436
dependencies = [
14371437
"cfg-if",
14381438
"libc",
1439-
"wasi",
1439+
"wasi 0.11.0+wasi-snapshot-preview1",
14401440
]
14411441

14421442
[[package]]
@@ -2944,7 +2944,7 @@ version = "0.6.4"
29442944
source = "registry+https://github.com/rust-lang/crates.io-index"
29452945
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
29462946
dependencies = [
2947-
"getrandom",
2947+
"getrandom 0.2.10",
29482948
]
29492949

29502950
[[package]]
@@ -4987,6 +4987,46 @@ version = "1.1.0"
49874987
source = "registry+https://github.com/rust-lang/crates.io-index"
49884988
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
49894989

4990+
[[package]]
4991+
name = "std"
4992+
version = "0.0.0"
4993+
dependencies = [
4994+
"addr2line",
4995+
"alloc",
4996+
"cfg-if",
4997+
"compiler_builtins",
4998+
"core",
4999+
"dlmalloc",
5000+
"fortanix-sgx-abi",
5001+
"hashbrown",
5002+
"hermit-abi",
5003+
"libc",
5004+
"miniz_oxide",
5005+
"object 0.32.2",
5006+
"panic_abort",
5007+
"panic_unwind",
5008+
"profiler_builtins",
5009+
"r-efi",
5010+
"r-efi-alloc",
5011+
"rand",
5012+
"rand_xorshift",
5013+
"rustc-demangle",
5014+
"std_detect",
5015+
"unwind",
5016+
"wasi 0.11.0+wasi-snapshot-preview1",
5017+
]
5018+
5019+
[[package]]
5020+
name = "std_detect"
5021+
version = "0.1.5"
5022+
dependencies = [
5023+
"cfg-if",
5024+
"compiler_builtins",
5025+
"libc",
5026+
"rustc-std-workspace-alloc",
5027+
"rustc-std-workspace-core",
5028+
]
5029+
49905030
[[package]]
49915031
name = "string_cache"
49925032
version = "0.8.7"
@@ -5710,7 +5750,7 @@ version = "1.10.0"
57105750
source = "registry+https://github.com/rust-lang/crates.io-index"
57115751
checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314"
57125752
dependencies = [
5713-
"getrandom",
5753+
"getrandom 0.2.10",
57145754
]
57155755

57165756
[[package]]
@@ -5741,6 +5781,12 @@ dependencies = [
57415781
"winapi-util",
57425782
]
57435783

5784+
[[package]]
5785+
name = "wasi"
5786+
version = "0.9.0+wasi-snapshot-preview1"
5787+
source = "registry+https://github.com/rust-lang/crates.io-index"
5788+
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
5789+
57445790
[[package]]
57455791
name = "wasi"
57465792
version = "0.11.0+wasi-snapshot-preview1"
@@ -6342,3 +6388,15 @@ dependencies = [
63426388
"quote",
63436389
"syn 2.0.79",
63446390
]
6391+
6392+
[[package]]
6393+
name = "zip"
6394+
version = "0.6.6"
6395+
source = "registry+https://github.com/rust-lang/crates.io-index"
6396+
checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261"
6397+
dependencies = [
6398+
"byteorder",
6399+
"crc32fast",
6400+
"crossbeam-utils",
6401+
"flate2",
6402+
]

compiler/rustc_codegen_ssa/src/base.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
451451
) -> Bx::Function {
452452
// The entry function is either `int main(void)` or `int main(int argc, char **argv)`, or
453453
// `usize efi_main(void *handle, void *system_table)` depending on the target.
454-
let is_bpf = cx.sess().target.arch == "bpf" && cx.sess().opts.test;
455454
let llfty = if cx.sess().target.os.contains("uefi") {
456455
cx.type_func(&[cx.type_ptr(), cx.type_ptr()], cx.type_isize())
457456
} else if cx.sess().target.main_needs_argc_argv {
@@ -523,8 +522,7 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
523522
}
524523
};
525524

526-
let result = bx.call(start_ty, None, None, start_fn, &args, None, instance);
527-
525+
let result = bx.call(start_ty, None, None, start_fn, &args, None);
528526
if cx.sess().target.os.contains("uefi") {
529527
bx.ret(result);
530528
} else {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ 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;
2829
pub(crate) mod thumb;
2930
pub(crate) mod uefi_msvc;
3031
pub(crate) mod unikraft_linux_musl;
3132
pub(crate) mod vxworks;
32-
pub(crate) mod sbf_base;
3333
pub(crate) mod wasm;
3434
pub(crate) mod windows_gnu;
3535
pub(crate) mod windows_gnullvm;

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

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ SECTIONS
5959
requires_lto: false,
6060
singlethread: true,
6161
vendor: "solana".into(),
62-
c_enum_min_bits: Some(32),
6362
.. Default::default()
6463
}
6564
}

compiler/rustc_target/src/spec/sbf_base.rs

-65
This file was deleted.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ pub(crate) fn target() -> Target {
1515
std: None,
1616
},
1717
}
18-
}
18+
}

library/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ rustc-demangle.debug = 0
4242
[patch.crates-io]
4343
# See comments in `library/rustc-std-workspace-core/README.md` for what's going on
4444
# here
45-
compiler_builtins = { git = "https://github.com/solana-labs/compiler-builtins" }
45+
compiler_builtins = { git = "https://github.com/solana-labs/compiler-builtins", tag = "solana-tools-v1.40" }
4646
rustc-std-workspace-core = { path = 'rustc-std-workspace-core' }
4747
rustc-std-workspace-alloc = { path = 'rustc-std-workspace-alloc' }
4848
rustc-std-workspace-std = { path = 'rustc-std-workspace-std' }

library/alloc/src/alloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,6 @@ pub mod __alloc_error_handler {
448448
pub unsafe fn __rdl_oom(size: usize, _align: usize) -> ! {
449449
core::panicking::panic_nounwind_fmt(format_args!(
450450
"memory allocation of {size} bytes failed"
451-
))
451+
), /* force_no_backtrace */ false)
452452
}
453453
}

library/std/src/backtrace.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,14 @@ use crate::env;
9595
#[cfg(not(target_family = "solana"))]
9696
use crate::ffi::c_void;
9797
use crate::fmt;
98+
#[cfg(not(target_family = "solana"))]
9899
use crate::panic::UnwindSafe;
99-
use crate::sync::atomic::AtomicU8;
100-
use crate::sync::atomic::Ordering::Relaxed;
101-
#[cfg(not(any(target_arch = "bpf", target_arch = "sbf")))]
102-
use crate::sys::backtrace::{lock, output_filename, set_image_base};
100+
#[cfg(not(target_family = "solana"))]
101+
use crate::sync::atomic::{AtomicU8, Ordering::Relaxed};
103102
#[cfg(not(target_family = "solana"))]
104103
use crate::sync::LazyLock;
105104
#[cfg(not(target_family = "solana"))]
106-
use crate::vec::Vec;
105+
use crate::sys::backtrace::{lock, output_filename, set_image_base};
107106

108107
/// A captured OS thread stack backtrace.
109108
///
@@ -165,8 +164,8 @@ pub struct BacktraceFrame {
165164
}
166165

167166
#[derive(Debug)]
167+
#[cfg(not(target_family = "solana"))]
168168
enum RawFrame {
169-
#[cfg(not(target_family = "solana"))]
170169
Actual(backtrace_rs::Frame),
171170
#[cfg(test)]
172171
Fake,
@@ -487,6 +486,7 @@ impl fmt::Display for Backtrace {
487486
}
488487
}
489488

489+
#[cfg(not(target_family = "solana"))]
490490
mod helper {
491491
use super::*;
492492
pub(super) type LazyResolve = impl (FnOnce() -> Capture) + Send + Sync + UnwindSafe;
@@ -523,6 +523,7 @@ mod helper {
523523
}
524524
}
525525
}
526+
#[cfg(not(target_family = "solana"))]
526527
use helper::*;
527528

528529
#[cfg(not(target_family = "solana"))]

library/std/src/panicking.rs

+11-10
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,23 @@
99
1010
#![deny(unsafe_op_in_unsafe_fn)]
1111

12-
#[cfg(not(target_os = "solana"))]
12+
#[cfg(not(target_family = "solana"))]
1313
use crate::panic::BacktraceStyle;
14-
#[cfg(all(not(target_arch = "bpf"), not(target_arch = "sbf")))]
15-
use crate::intrinsics;
16-
#[cfg(not(target_os = "solana"))]
17-
use crate::panic::PanicHookInfo;
18-
#[cfg(not(target_os = "solana"))]
14+
#[cfg(not(target_family = "solana"))]
1915
use core::panic::PanicPayload;
16+
#[cfg(target_family = "solana")]
17+
use core::panic::PanicInfo;
2018
use core::panic::Location;
19+
2120
use crate::any::Any;
21+
use crate::fmt;
22+
use crate::intrinsics;
23+
#[cfg(not(target_os = "solana"))]
24+
use crate::panic::PanicHookInfo;
2225
#[cfg(not(test))]
2326
use crate::io::try_set_output_capture;
2427
use crate::mem::ManuallyDrop;
2528
#[cfg(not(target_family = "solana"))]
26-
use crate::fmt;
27-
#[cfg(not(target_family = "solana"))]
2829
use crate::mem;
2930
#[cfg(not(target_family = "solana"))]
3031
use crate::process;
@@ -524,14 +525,12 @@ pub use realstd::rt::panic_count;
524525

525526
/// Invoke a closure, capturing the cause of an unwinding panic if one occurs.
526527
#[cfg(feature = "panic_immediate_abort")]
527-
#[cfg(all(not(target_arch = "bpf"), not(target_arch = "sbf")))]
528528
pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>> {
529529
Ok(f())
530530
}
531531

532532
/// Invoke a closure, capturing the cause of an unwinding panic if one occurs.
533533
#[cfg(not(feature = "panic_immediate_abort"))]
534-
#[cfg(all(not(target_arch = "bpf"), not(target_arch = "sbf")))]
535534
pub unsafe fn r#try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<dyn Any + Send>> {
536535
union Data<F, R> {
537536
f: ManuallyDrop<F>,
@@ -987,6 +986,7 @@ pub fn begin_panic<M: Any + Send>(_msg: M) -> ! {
987986
None,
988987
Location::caller(),
989988
false,
989+
false,
990990
);
991991
crate::sys::panic(&info);
992992
}
@@ -1005,6 +1005,7 @@ pub fn begin_panic_fmt(msg: &fmt::Arguments<'_>) -> ! {
10051005
Some(msg),
10061006
Location::caller(),
10071007
false,
1008+
false,
10081009
);
10091010
crate::sys::panic(&info);
10101011
}

library/std/src/sys/sbf/cmath.rs

+4
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ extern {
2626
pub fn tanf(n: f32) -> f32;
2727
pub fn tanh(n: f64) -> f64;
2828
pub fn tanhf(n: f32) -> f32;
29+
pub fn tgamma(n: f64) -> f64;
30+
pub fn tgammaf(n: f32) -> f32;
31+
pub fn lgamma_r(n: f64, s: &mut i32) -> f64;
32+
pub fn lgammaf_r(n: f32, s: &mut i32) -> f32;
2933
}

library/std/src/sys/sbf/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,8 @@ pub fn abort_internal() -> ! {
115115
pub fn hashmap_random_keys() -> (u64, u64) {
116116
(1, 2)
117117
}
118+
119+
#[inline]
120+
pub fn is_interrupted(_errno: i32) -> bool {
121+
false
122+
}

0 commit comments

Comments
 (0)