Skip to content

Support use of libc++ with LLVM libc in embedded development #84879

Open
@petrhosek

Description

@petrhosek

We are trying to migrate existing baremetal projects from libstdc++ and newlib to libc++ with libc and we encountered various issues. Most of them appear to be due to the fact that unlike other C library implementations, LLVM libc does not provide a complete set of headers as defined by the C standard, rather it generates headers that only contain types and functions that are supported in baremetal environments.

For example, the baremetal version of stdio.h does not include printf, fprintf, etc. because in baremetal environments, there is typically no concept of standard output or input. This can be characterized as the "don't provide what shouldn't be used" principle.

While libc++ provides options to disable unnecessary functionality to better support restricted environments, we have still encountered cases where libc++ headers transitively pull in unnecessary dependencies. This is a high-level tracking issue, I intend to file separate issues for each case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    embeddedSupport for embedded developmentlibclibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions