Skip to content

[libc] Tracking progress for std::cout ... std::endl on baremetal #146099

@saturn691

Description

@saturn691

Downstream (https://github.com/arm/arm-toolchain), this is a very highly requested feature for a lot of embedded codebases, in order for it to be compatible with previous libraries. In particular, we need the following to compile.

// Note we need std::endl
std::cout << "Hello, World!" << std::endl;

Link to Discourse post: https://discourse.llvm.org/t/rfc-implementation-of-stdio-on-baremetal/86944

The implementation of this will involve:

It should follow the philosophy of "don't pay for what you're not using". Ideally, this should be written in a way that allows non-semihosted platforms to throw away code.

However, these functions still face the challenges:

  • fflush requires buffering, which is difficult (stated at the last Embedded WG meeting)
  • FILE will need to be defined somewhere.
  • stdout/stderr need to be defined somewhere. Probably in the semihosting library.

As more of the library gets designed, this will be filled in over time. However, at this moment in time, this still requires discussion. See the Discourse post for more details.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions