Skip to content

Upgrade to Rust 1.96.0 and adapt BlueOS targets for the new toolchain - #12

Merged
han-jiang277 merged 13 commits into
vivoblueos:v1.96.0from
wangchen-vivo:blueos/1.96.0
Aug 19, 2026
Merged

Upgrade to Rust 1.96.0 and adapt BlueOS targets for the new toolchain#12
han-jiang277 merged 13 commits into
vivoblueos:v1.96.0from
wangchen-vivo:blueos/1.96.0

Conversation

@wangchen-vivo

@wangchen-vivo wangchen-vivo commented Aug 14, 2026

Copy link
Copy Markdown

Upgrade to Rust 1.96.0 and rebase BlueOS patches

Note: This PR is in draft until the BlueOS libc and cc-rs PRs are
merged. The libc / cc-rs git revision pinned in the lockfiles and
ALLOWED_SOURCES will be updated to the final merged commit SHAs before
marking this PR ready for review.

Background

BlueOS maintains a fork of rustc with patches that add the BlueOS target specs
and adapt std to the BlueOS libc / newlib runtime. The previous fork was
based on Rust 1.84.0 (blueos-dev branch).

This branch rebases those BlueOS patches onto the Rust 1.96.0 stable release
and resolves the conflicts caused by upstream changes between 1.84 and 1.96.

What this PR does

BlueOS target specs & std support

  • Cherry-pick of [BlueOS] Support vivo BlueOS — the original commit that
    adds the six BlueOS target specs and wires up std for the BlueOS newlib
    runtime. Adapted to 1.96:

    • Migrate cfg_if! to cfg_select! in sys/ modules.
    • Move BlueOS cfg entries from pal/unix/os.rs to sys/paths/unix.rs.
    • Move BlueOS cfg entries from pal/unix/process/ to sys/process/unix/.
    • Add BlueOS to pal/unix/sync/condvar.rs cfg lists.
    • Add BlueOS to fs/unix.rs link() no-linkat fallback.
  • Cherry-pick of Fix: bootstrap abi issue — adapt the BlueOS stat time
    accessors and process module to 1.96:

    • Move from scalar (st_atime / st_mtime / st_ctime) to timespec
      (st_atim / st_mtim / ctim) in sys/fs/unix.rs.
    • Add BlueOS to sys/process/unix/mod.rs allow(unused) cfg_attr.

Target spec adjustments

  • PIC relocation model by default for riscv64-vivo-blueos (needed to
    build static PIE).
  • emutls for riscv32imc-vivo-blueos — same workaround as rv32imac,
    the native TLS is not available on this target yet.
  • Dynamic linking & PIC on Cortex-M — enable dynamic_linking and PIC
    for thumbv7m-vivo-blueos-newlibeabi and thumbv8m.main-vivo-blueos-newlibeabihf.

libc fork pin

  • Pin the BlueOS libc fork to the commit that adapts it to Rust 1.96
    (2f8715c4) across Cargo.lock, library/Cargo.lock, and the tidy
    ALLOWED_SOURCES list (src/tools/tidy/src/extdeps.rs).
  • Set c_char = i8 on BlueOS targets in library/core/src/ffi/primitives.rs
    (BlueOS compiles C with -fsigned-char).

Build / CI

  • Remove potential GPL components — drop pr-check-1/ (Dockerfile,
    reuse-requirements, etc.) and its references in tidy/Dockerfile.
  • Don't build clang in config.blueos.toml — clang is installed via the
    package manager, saving build time.
  • Build sanitizers on Linux and Darwin in config.blueos.toml.
  • Strip binaries to avoid exhausting the GitHub Actions runner's disk.
  • macOS build fix in config.blueos.toml.
  • Bump bootstrap and profiler_builtins Cargo metadata.

Testing

Verified by building the full BlueOS Rust toolchain via x.py install for
compiler/rustc and std across all BlueOS targets.

lawkai-vivo and others added 10 commits August 13, 2026 09:33
Adapted to Rust 1.96 when resolving conflicts:
- Migrate cfg_if! to cfg_select! in sys/ modules
- Move blueos cfg entries from pal/unix/os.rs to sys/paths/unix.rs
- Move blueos cfg entries from pal/unix/process/ to sys/process/unix/
- Add blueos to pal/unix/sync/condvar.rs cfg lists
- Add blueos to fs/unix.rs link() no-linkat fallback

(cherry picked from commit 443b4ca)
Description: Fix mac toolchain error
Reason: 
```
./x.py install -i --stage 1 library/std --target thumbv8m.main-vivo-blueos-newlibeabihf compile error on MacOS
```
Issue: NA
So that we can largely reduce artifacts' size and not exhaust github
action runner's space.
We need a libcore with PIC enabled to build static PIE.
clang is installed via the package manager.
Adapted to Rust 1.96 when resolving conflicts:
- Migrate cfg_if! to cfg_select! in os/unix/process.rs
- Move blueos stat time accessors from scalar (st_atime/st_mtime/st_ctime)
  to timespec (st_atim/st_mtim/st_ctim) in sys/fs/unix.rs
- Add blueos to sys/process/unix/mod.rs allow(unused) cfg_attr

(cherry picked from commit 7dd0ed8)
Adapted to Rust 1.96 when resolving conflicts:
- mingw-check/ was reorganized to pr-check-1/ upstream
- Remove pr-check-1/ directory (Dockerfile, reuse-requirements, etc.)
- Remove pr-check-1/ references from tidy/Dockerfile

(cherry picked from commit 6e2ebcb)
@CLAassistant

CLAassistant commented Aug 14, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 4 committers have signed the CLA.

✅ lawkai-vivo
✅ wangchen-vivo
✅ zhanghe-vivo
❌ nooopslol
You have signed the CLA already but the status is still pending? Let us recheck it.

@wangchen-vivo
wangchen-vivo marked this pull request as draft August 14, 2026 07:49
Pin the BlueOS libc fork to commit 2f8715c4 (adapt libc to Rust 1.96
toolchain) in Cargo.lock, library/Cargo.lock and tidy ALLOWED_SOURCES.

Adjust BlueOS target specs and std sources for the 1.96 upgrade:
- Update target spec fields for the new target-spec API
- Set c_char to i8 on BlueOS targets (-fsigned-char)
- Adapt std/sys/pal/unix and std/os/blueos to the 1.96 layout
- Bump bootstrap and profiler_builtins Cargo metadata
@wangchen-vivo
wangchen-vivo changed the base branch from blueos-dev to v1.96.0 August 18, 2026 07:24
Comment thread src/bootstrap/Cargo.toml Outdated
@wangchen-vivo
wangchen-vivo marked this pull request as ready for review August 18, 2026 13:13
@han-jiang277
han-jiang277 merged commit 662fa8c into vivoblueos:v1.96.0 Aug 19, 2026
4 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants