Skip to content

fix: link libc++ instead of libstdc++ for Rust FFI on Linux#21203

Merged
notnotraju merged 1 commit intomerge-train/barretenbergfrom
rk/fix-rust-libc++-linking
Mar 6, 2026
Merged

fix: link libc++ instead of libstdc++ for Rust FFI on Linux#21203
notnotraju merged 1 commit intomerge-train/barretenbergfrom
rk/fix-rust-libc++-linking

Conversation

@notnotraju
Copy link
Contributor

Summary

  • Rust build script was linking libstdc++ on Linux, but barretenberg is built with Clang/libc++ (std::__1:: ABI)
  • This caused undefined reference errors at link time for cargo test --release --features ffi
  • Fix: link libc++ on all platforms since barretenberg uses Clang/libc++ everywhere

barretenberg is built with Clang/libc++ on all platforms, so the Rust
build script must link libc++ everywhere. Linking libstdc++ on Linux
causes undefined references to std::__1:: symbols from libc++.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@notnotraju notnotraju added the ci-barretenberg Run all barretenberg/cpp checks. label Mar 6, 2026
Copy link
Contributor

@johnathan79717 johnathan79717 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@johnathan79717 johnathan79717 added ci-barretenberg-full Run all barretenberg checks. backport-to-v4 and removed ci-barretenberg Run all barretenberg/cpp checks. backport-to-v4 labels Mar 6, 2026
@johnathan79717
Copy link
Contributor

Actually we don't need to backfill as clang20 does not use zig in v4 https://github.com/AztecProtocol/aztec-packages/blob/v4.0.4/barretenberg/cpp/CMakePresets.json

@notnotraju notnotraju merged commit b051bba into merge-train/barretenberg Mar 6, 2026
30 of 42 checks passed
@notnotraju notnotraju deleted the rk/fix-rust-libc++-linking branch March 6, 2026 12:11
github-merge-queue bot pushed a commit that referenced this pull request Mar 6, 2026
BEGIN_COMMIT_OVERRIDE
fix: add -g0 to zig presets to eliminate 11GB debug info bloat (#21071)
fix: resolve flaky p2p_client test race condition on ARM64 (#21088)
chore: remove domain iteration macros and address backing memory race
(#20988)
fix: [ECCVM] added domain separation for the multiset equality check.
(#20352)
feat: hybrid CRS hash verification — 8MB chunks, parallel, span-based
(#21113)
chore: unify splitting scalars interface (#20805)
chore: add a unique id to each origin tag (#20924)
chore: Native curve audit (#20936)
chore: Update bootstrap in test vk haven't changed script (#21153)
fix: use reduced form in WASM FromMontgomeryForm test (#21164)
chore: erase ephemeral secrets from memory in schnorr and aes (#21106)
chore: suppress clangd target triple version diagnostic (#21180)
feat: Optimise new claim calculation (#21179)
docs: add Quick Start build instructions to barretenberg README (#20951)
feat: batched chonk verification (#21083)
fix: link libc++ instead of libstdc++ for Rust FFI on Linux (#21203)
fix: [ECCVM] in the transcript table, no-ops force the next accumulator
to be 0. (#20849)
fix: resolve merge-train conflict with next (zig wrapper scripts + -g0)
(#21201)
fix: [ECCVM] rare edge case completeness issue when `z1 == 0` but `z2 !=
0` (#20858)
fix: use actual data extent for CommitmentKey in HypernovaDeciderProver
(#21206)
END_COMMIT_OVERRIDE
github-merge-queue bot pushed a commit that referenced this pull request Mar 6, 2026
Adds `bb-rs` and `bb-rs-tests` targets to the root Makefile so the Rust
FFI crate is built and link-tested as part of `fast` and `full` CI (not
only `ci-barretenberg-full`).

Also adds iOS and Android cross-compile targets
(`bb-cpp-cross-arm64-ios`, `bb-cpp-cross-arm64-ios-sim`,
`bb-cpp-cross-arm64-android`, `bb-cpp-cross-x86_64-android`) to the
Makefile, wired into `bb-cpp-cross` so they get built during `release`.
These were previously only built via the legacy `build_with_makefile`
path in bootstrap.sh.

This would have caught the libc++/libstdc++ mismatch (fixed in #21203)
that was introduced when the Zig preset became the default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-barretenberg-full Run all barretenberg checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants