Skip to content

Commit d945f53

Browse files
committed
[SOL] Adjust compiler after upgrade to 1.75.0
1 parent a88e4d3 commit d945f53

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
}

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

Lines changed: 4 additions & 0 deletions
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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,8 @@ pub fn abort_internal() -> ! {
120120
pub fn hashmap_random_keys() -> (u64, u64) {
121121
(1, 2)
122122
}
123+
124+
#[inline]
125+
pub fn is_interrupted(_errno: i32) -> bool {
126+
false
127+
}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
6161
unsupported()
6262
}
6363

64+
#[derive(Debug)]
6465
pub struct Env(Void);
6566

6667
impl Iterator for Env {
@@ -70,6 +71,12 @@ impl Iterator for Env {
7071
}
7172
}
7273

74+
impl Env {
75+
pub fn str_debug(&self) -> impl fmt::Debug + '_ {
76+
[OsString::new(), OsString::new()]
77+
}
78+
}
79+
7380
pub fn env() -> Env {
7481
panic!();
7582
}

src/bootstrap/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test = false
2525

2626
[[bin]]
2727
name = "rustdoc"
28-
path = "bin/rustdoc.rs"
28+
path = "src/bin/rustdoc.rs"
2929
test = false
3030

3131
[[bin]]

src/bootstrap/src/utils/cc_detect.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,6 @@ pub fn find_target(build: &Build, target: TargetSelection) {
148148
{
149149
cfg.compiler(cxx);
150150
true
151-
} else if &*target.triple == "sbf-solana-solana" || &*target.triple == "bpfel-unknown-unknown" {
152-
set_compiler(&mut cfg, Language::CPlusPlus, target, config, build);
153-
true
154151
} else {
155152
// Use an auto-detected compiler (or one configured via `CXX_target_triple` env vars).
156153
cfg.try_get_compiler().is_ok()
@@ -231,11 +228,9 @@ fn default_compiler(
231228
None
232229
}
233230
}
234-
"bpfel-unknown-unknown" => {
235-
cfg.compiler(build.llvm_bin(target).join(compiler.clang()));
236-
}
237-
"sbf-solana-solana" => {
238-
cfg.compiler(build.llvm_bin(target).join(compiler.clang()));
231+
232+
"bpfel-unknown-unknown" | "sbf-solana-solana" => {
233+
Some(PathBuf::from(build.llvm_bin(target).join(compiler.clang())))
239234
}
240235

241236
t if t.contains("musl") && compiler == Language::C => {

src/tools/tidy/src/extdeps.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const ALLOWED_SOURCES: &[&str] = &[
88
r#""registry+https://github.com/rust-lang/crates.io-index""#,
99
// This is `rust_team_data` used by `site` in src/tools/rustc-perf,
1010
r#""git+https://github.com/rust-lang/team#a5260e76d3aa894c64c56e6ddc8545b9a98043ec""#,
11-
"\"git+https://github.com/solana-labs/compiler-builtins?tag=bpf-tools-v1.7#875087b410b77e0561b653882b431c84515eb044\""
11+
"\"git+https://github.com/solana-labs/compiler-builtins?tag=solana-tools-v1.40#81ef46f3fe1357095acdd089a700890fe4e13974\""
1212
];
1313

1414
/// Checks for external package sources. `root` is the path to the directory that contains the

0 commit comments

Comments
 (0)