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

Dependency on Abseil making WASM/YoWASP builds impossible #616

Closed
whitequark opened this issue Mar 10, 2021 · 3 comments · Fixed by #617
Closed

Dependency on Abseil making WASM/YoWASP builds impossible #616

whitequark opened this issue Mar 10, 2021 · 3 comments · Fixed by #617

Comments

@whitequark
Copy link
Member

whitequark commented Mar 10, 2021

Abseil (with CMake, at least) has a hard dependency on threading, which breaks builds on platforms without threads. The upstream worked around this for Bazel builds but not CMake. Unfortunately, the workaround (or its CMake equivalent) fixes the immediate issue (no -pthread) but it doesn't actually let the build complete on platforms without atomics, at least not for the library that nextpnr wants to use.

@litghost
Copy link
Contributor

litghost commented Mar 12, 2021

@whitequark What's the CMake invocation to build for WASM? Given the Bazel changes, it looks the right answer is to change the find_package(Threads REQUIRED) to:

if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL Emscripten)
  find_package(Threads REQUIRED)
endif()

etc. But I cannot test this without a way to run the emscripten build.

@whitequark
Copy link
Member Author

whitequark commented Mar 13, 2021

Given the Bazel changes, it looks the right answer is to change the find_package(Threads REQUIRED) to:

That doesn't help; there's a ton of references to atomics, which are not currently a part of WASI.

That said, the WASI build is done by this script.

@litghost
Copy link
Contributor

litghost commented Mar 15, 2021

Given the Bazel changes, it looks the right answer is to change the find_package(Threads REQUIRED) to:

That doesn't help; there's a ton of references to atomics, which are not currently a part of WASI.

That said, the WASI build is done by this script.

Not only that, but in the entropy store has a mutex lock here: https://github.com/abseil/abseil-cpp/blob/master/absl/container/internal/hashtablez_sampler.h#L87

So I don't think the bazel rules will help here, as fundamentally the Swiss table just assumes a multi-core system. Unfortunate :(

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 a pull request may close this issue.

2 participants