-
Couldn't load subscription status.
- Fork 34
Description
What is the change
Since C++17 fstream is only enabled as part of the full filesystem support, however in embedded systems it is typical to redirect standard IO into a serial port or use basic file operations with semihosting, while the rest of filesystem (directories and such) is not available.
This change will enable fstream independently of the full filesystem.
Why this change cannot be done upstream
This was discussed with the community:
- The original libc++ change: https://reviews.llvm.org/D152168#4441783
- Embedded work group: https://discourse.llvm.org/t/llvm-embedded-toolchains-working-group-sync-up/63270/80
- libc++ monthly sync on 10-06-2025: https://docs.google.com/document/d/1yC-3bE6pefVizUhfiUs1Shv11EzuL0KOklGSLqto6dk/edit?tab=t.0#heading=h.f01ybrrpnyo2
The conclusion was that long term it is better to provide a porting API to be able to enable filesystem as the whole, even if parts of it are stubbed out.
This change will take quite some time, thus we are taking the downstream change to unblock users who want to port their code from pre-C++17, where fstream was available, to a later standard.