Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting rid of STL? #702

Open
SchrodingerZhu opened this issue Dec 11, 2024 · 0 comments
Open

Getting rid of STL? #702

SchrodingerZhu opened this issue Dec 11, 2024 · 0 comments

Comments

@SchrodingerZhu
Copy link
Collaborator

SchrodingerZhu commented Dec 11, 2024

Although freestanding C++ is well-defined, some STL headers are making troubles or pulling in too much irrelevant dependencies. Moreover, libcxx and MSVC's STL does not have the freestanding support.

When trying to build snmalloc with LLVM's libc headers, even though the libstdc++ is told to be freestanding, it assumes GNU toolchain blindly, trying to include internal glibc headers and pulling the dependencies to wchar routines via <string_view> even though wchar is not used at all. It forcibly using some symbols which make it hard to use snmalloc at the internal libc allocator at early development stage.

namespace std {
using ::XXX;
}

To avoid depending on STL, SCUDO creates its own wrapper around compiler builtins.

We should still fallback to STL if target compiler does not providing certain builtins. In that case, we can use the way in llvm-libc to create proxy headers that dispatch the implementations.

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

No branches or pull requests

1 participant