Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Tracking: Add tock as a supported OS for target triples #4464

@ppannuto

Description

@ppannuto

Meta: This isn't directly an issue for the Tock kernel, but as the Tock kernel is the center point for a lot of external work, I think this makes the most sense for a holding place for a tracking issue.

Motivation / Rationale

Currently, toolchains around the Tock ecosystem all use generic, bare metal targets (e.g. none). In practice, the Tock ecosystem actually has more stringent requirements (i.e., our own syscall ABI; required use of position-independent code; etc). What this means is that while we can use "out of the box" bare metal compilers, we build our own standard libraries (e.g.), and configuration for userspace is a somewhat delicate, and increasingly-complicated mapping of compilers to other toolchain components.

Early on, this made a lot of sense, but frankly Tock is big enough now and used enough places, that it's quite reasonable to be a "real" target (e.g., zephyr has been since 2021).

Especially as we grow the number of platforms (i.e., this was driven by starting to implement more of our machinery for i386 in libtock-c), we will be much served as an integrated, upstream platform in toolchains. Short-term, it will alleviate configuration and installation burdens (as we can simply package whole "tock toolchains" the "normal" way); I suspect it will also help the visibility of Tock. Long-term, it will allow for more interesting Tock-specific enhancements to various standard libraries (at the cost of doing such things via upstream patches, rather than local changes).

Roadmap

There's a few parallel paths here:

GNU-family Tooling

Useful reference to start from: https://wiki.osdev.org/Porting_GCC_to_your_OS

  1. Add Tock as a target to config.sub — this is copied/inherited by the rest of the GNU ecosystem
  2. Tock support in binutils
  3. Tock support in GCC
  4. Tock support in newlib
  5. Tock support in picolib (n.b., Not technically GNU, but it inherits pieces from newlib, and functionally depends on that coming first)

LLVM-family Tooling

TODO

Rust Tooling

  1. Submit PR applying for tier3 status.

TODO

Reference: https://doc.rust-lang.org/rustc/target-tier-policy.html#adding-a-new-target

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions