Skip to content

Conversation

@moven0831
Copy link

Summary

This PR adds multi-platform build support for bb_rs, enabling broader proving capabilities across iOS, Android, macOS, and Linux. The PR includes platform-specific build configurations and GitHub Actions workflows for building and publishing binaries across 9 target architectures on 4 platforms.

Supported Platforms and Architectures

  • iOS: aarch64-apple-ios, aarch64-apple-ios-sim, x86_64-apple-ios (simulator on Intel Mac)
  • Android: aarch64-linux-android, x86_64-linux-android
  • macOS: aarch64-apple-darwin, x86_64-apple-darwin
  • Linux: aarch64-unknown-linux-gnu, x86_64-unknown-linux-gnu

Benefits

Changes in C++ Resources

1. Fixed LMDB Compilation for Cross-Platform Builds

Modified: barretenberg/cpp/cmake/lmdb.cmake

Resolved cross-compilation issues with LMDB to ensure compatibility across all target platforms.

2. Compiler Compatibility Improvements

Modified: barretenberg/cpp/src/CMakeLists.txt

To minimize direct modifications to C++ source code, we suppressed minor warnings in the CMake configuration:

  • Dynamic feature detection using CHECK_CXX_COMPILER_FLAG
  • Graceful fallback for older Clang versions (Android NDK compatibility)
  • Suppressed false positive warnings in cross-compilation (-Wno-stringop-overflow)
  • Support for partial object initialization (-Wno-missing-field-initializers)

3. Platform-Specific Random Number Generation

Modified: barretenberg/cpp/src/barretenberg/numeric/random/engine.cpp

Refactored entropy source selection for improved platform reliability, enabling iOS simulator and Linux target support.

4. Constructor Syntax Updates

Modified:

  • barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.hpp
  • barretenberg/cpp/src/barretenberg/ecc/scalar_multiplication/scalar_multiplication.hpp
  • barretenberg/cpp/src/barretenberg/vm2/simulation/tx_context.hpp

The original code used C++20 designated initializers with move semantics, which fails on older Clang versions (Android NDK r26 uses Clang 17; iOS Xcode 15 uses Clang 15). Added explicit constructors to ensure compatibility with both older and newer compilers.

Validation

All platform builds have been successfully validated across all target architectures: https://github.com/zkmopro/aztec-packages/actions/runs/18745250959

Related Issues

@moven0831
Copy link
Author

Hi @madztheo , would love to have your review. Thank you!

mateuszmlc pushed a commit to polybase/aztec-packages that referenced this pull request Nov 3, 2025
Cleaning up and restricting the interface to cycle_scalar. The main
purpose of this thread of work is to make it easier to identify when
certain constraints need to be applied (e.g. primality) and to make
applying them less error prone:
- Add method `field_t::split_at_unrestricted()` (better name TBD!) to
implement hi/lo splitting logic previously housed in `cycle_scalar`
- Remove unused constructors `cycle_scalar(const field_t&)` and
`cycle_scalar(const ScalarField&)`
- remove option to `skip_primality_test` in method
`create_from_bn254_scalar()`
mateuszmlc pushed a commit to polybase/aztec-packages that referenced this pull request Nov 3, 2025
BEGIN_COMMIT_OVERRIDE
chore: Tube-related clean up (AztecProtocol#17064)
chore: cycle group cleanup zkpassport#5 (AztecProtocol#17026)
chore: `field_conversion` clean-up/int audit (AztecProtocol#16898)
fix: bigfield veridise audit fixes (AztecProtocol#16842)
END_COMMIT_OVERRIDE
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.

1 participant