Skip to content

Conversation

@zouguangxian
Copy link
Collaborator

This pull request introduces several improvements and fixes across the build scripts, runtime entry points, toolchain management, and documentation for ZeroOS. The changes enhance platform flexibility, improve error reporting, add troubleshooting resources, and provide more robust build and toolchain handling.

Key changes include:

Build System and Toolchain Improvements

  • Added support for passing additional platform-specific rustflags to the build_binary function by introducing a new build_binary_with_rustflags function, allowing more flexible build configurations. [1] [2] [3]
  • Improved toolchain installation logic by adding get_or_install_or_build_toolchain, which attempts to resolve, download, or build the toolchain from source as needed, making toolchain setup more robust. [1] [2]
  • Removed automatic repository inference from git in toolchain install logic to simplify and make the source of the toolchain repository more explicit. [1] [2]

Platform and Entry Point Enhancements

  • Refactored the entry point logic in zeroos-foundation to define __main_entry as a weak symbol that jumps to __default_main_entry, allowing platforms and SDKs to override the entry point as needed. [1] [2] [3] [4]
  • Improved panic messages in build.rs to include the current architecture, aiding in debugging build target issues.
  • Added a syscall name lookup helper function to the syscall registry for better debugging and tracing of syscalls.

Build Script and Feature Adjustments

  • Updated build scripts (build-fibonacci.sh, build-std-smoke.sh) to include the with-spike feature and, for std-smoke, to specify memory, stack, and heap sizes, improving testing and simulation accuracy. [1] [2] [3]
  • Changed the default features in the fibonacci example to not include with-spike by default, requiring explicit opt-in for spike simulation.

Documentation and Troubleshooting

  • Added a new troubleshooting section to the documentation, including a detailed guide on the LLVM MachineOutliner bug affecting RISC-V builds with -Copt-level=z, helping users diagnose and work around this issue. [1] [2]

Other Cleanups

  • Minor code cleanups and configuration adjustments, such as removing unnecessary module re-exports and ensuring correct conditional compilation. [1] [2] [3] [4]

- Add build_binary_with_rustflags for platform-specific compiler flags
- Refactor __main_entry with weak symbol pattern for SDK override
- Replace htif::exit with foundation::kfn::kexit in trap handler
- Remove with-spike from default features, require explicit opt-in
- Add LLVM MachineOutliner troubleshooting documentation
- Improve zeroos-arch-riscv build error messages with target info
@zouguangxian zouguangxian changed the title Gx/jolt chore: Build System, Toolchain Improvements and Entry Point Enhancements Jan 24, 2026
@zouguangxian zouguangxian merged commit 69bf515 into main Jan 25, 2026
15 checks passed
@zouguangxian zouguangxian deleted the gx/jolt branch January 25, 2026 04:36
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.

2 participants