Skip to content

Conversation

dicej
Copy link
Contributor

@dicej dicej commented Jan 11, 2024

As of LLVM 17, which includes https://reviews.llvm.org/D152168, libcxx has combined the old _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY and _LIBCPP_HAS_NO_FSTREAM preprocessor symbols into a single _LIBCPP_HAS_NO_FILESYSTEM symbol, which means there's no longer any way to enable <fstream> without enabling <filesystem>.

The solution is to set -DLIBCXX_ENABLE_FILESYSTEM:BOOL=ON and update wasi-libc, which includes stubs for the functions required by libcxx's <filesystem> implementation.

Fixes #373

As of LLVM 17, which includes https://reviews.llvm.org/D152168, libcxx has
combined the old `_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY` and
`_LIBCPP_HAS_NO_FSTREAM` preprocessor symbols into a single
`_LIBCPP_HAS_NO_FILESYSTEM` symbol, which means there's no longer any way to
enable `<fstream>` without enabling `<filesystem>`.

The solution is to set `-DLIBCXX_ENABLE_FILESYSTEM:BOOL=ON` and update
`wasi-libc`, which includes stubs for the functions required by libcxx's
`<filesystem>` implementation.

Fixes WebAssembly#373

Signed-off-by: Joel Dice <[email protected]>
@abrown abrown merged commit 9fbc7b5 into WebAssembly:main Jan 12, 2024
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

Successfully merging this pull request may close these issues.

libcxx's <fstream> no longer works as of wasi-sdk 21
2 participants