Skip to content

Fix missing C++ standard library includes for newer LLVM toolchains. - #449

Merged
mikesinouye merged 1 commit into
hdl:mainfrom
allight:update-llvm
Sep 21, 2026
Merged

mikesinouye merged 1 commit into
hdl:mainfrom
allight:update-llvm

Conversation

@allight

@allight allight commented Sep 19, 2026

Copy link
Copy Markdown
Contributor
  • Update dependency_support/at_clifford_yosys/yosys.patch to explicitly include <stdlib.h> in libs/subcircuit/subcircuit.cc (for free()) and libs/ezsat/ezsat.h (for abort()).
  • Add bazel_dep(name = "rules_cc_autoconf", version = "0.24.0") in MODULE.bazel to pick up the upstream <iterator> include fix for std::back_inserter.
  • Patch rules_bison via single_version_override to include <cstdlib> in src/bazel_runfiles.cc for getenv().

This is motivated by the LLVM toolchain upgrade in XLS where stricter libc++ headers no longer transitively include <cstdlib> or <iterator>.

Change generated using Google Antigravity

@allight

allight commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

@mikesinouye PTAL

@mikesinouye

Copy link
Copy Markdown
Collaborator

/gcbrun

@allight

allight commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

Oh Sorry @mikesinouye I think I killed the /gcbrun by fixing a lint error

🤦

@mikex-oss

Copy link
Copy Markdown
Collaborator

/gcbrun

@mikex-oss

Copy link
Copy Markdown
Collaborator

Just checking, does the lockfile not need to be updated?

- Update `dependency_support/at_clifford_yosys/yosys.patch` to explicitly
  include `<stdlib.h>` in `libs/subcircuit/subcircuit.cc` (for `free()`) and
  `libs/ezsat/ezsat.h` (for `abort()`).
- Add `bazel_dep(name = "rules_cc_autoconf", version = "0.24.0")` in
  `MODULE.bazel` to pick up the upstream `<iterator>` include fix for
  `std::back_inserter`.
- Patch `rules_bison` via `single_version_override` to include `<cstdlib>` in
  `src/bazel_runfiles.cc` for `getenv()`.

This is motivated by the LLVM toolchain upgrade in XLS where stricter libc++
headers no longer transitively include `<cstdlib>` or `<iterator>`.
@allight

allight commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

Done. Whoops was mostly building this from outside of the project so forgot that wouldn't update the lockfile.

@mikesinouye

Copy link
Copy Markdown
Collaborator

/gcbrun

@allight
allight requested a review from mikex-oss September 21, 2026 17:13
@mikesinouye
mikesinouye merged commit de1b57e into hdl:main Sep 21, 2026
4 checks passed
@allight
allight deleted the update-llvm branch September 21, 2026 23:39
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.

3 participants