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

Add Libcxx Compatability Mode to AnyBlob #4

Merged
merged 2 commits into from
Nov 28, 2023
Merged

Add Libcxx Compatability Mode to AnyBlob #4

merged 2 commits into from
Nov 28, 2023

Conversation

durner
Copy link
Owner

@durner durner commented Nov 28, 2023

#3

At the moment, AnyBlob can only link against the gnu standard library.
This commit adds a new CMake option `ANYBLOB_LIBCXX_COMPAT` that allows
building AnyBlob and linking against libcxx.

The main changes in this commit are:
- Missing header includes. We don't bring in the same transitive headers
  when including the libcxx headers, as a result some string headers
  were missing in some places.
- Remove `ThroughputResolver` when building with libcxx. This is the
  more invasive of the two changes. The `ThroughputResolver` depends on
  `__gnu_pbds::tree`, which is not spported in libcxx. When building in
  libcxx compatibility mode, we now remove this resolve completely. In
  this case, the `io_uring_socket.cpp` falls back onto the default
  resolver.

We have verified that we can build all targets in libcxx compatibility
mode.

We have verified that both unit and integration tests pass when building
with `clang-15` and the libcxx compatibility mode.
This commit adds the clang toolchain to the CI. We turn the main jobs
into a test matrix that either runs with the clang, or gcc toolchain.

When using the gcc toolchain everything stays as-is. When using the
clang toolchain we use clang/clang++ as C/C++ compilers, respectively.
We also build `AnyBlob` using `-DANYBLOB_LIBCXX_COMPAT=1`, which ensures
that `libcxx` is used as a standard library.

In principle, the test matrix could be even bigger: we could build with
libcxx and gcc, and gnu c++ and clang. But we don't tests this for now.
@durner durner merged commit ab4be80 into master Nov 28, 2023
4 checks passed
@durner durner deleted the wagjamin branch November 28, 2023 22:38
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.

None yet

2 participants