Skip to content

Commit

Permalink
add readme + patcher script for issue with iOS cross-compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
madztheo committed Dec 18, 2024
1 parent 2c9fd96 commit e1af688
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
27 changes: 27 additions & 0 deletions barretenberg/bb_rs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# bb.rs

Rust bindings for Barretenberg C++ codebase.

## Build

```
# Build on your own machine
cargo build -vvvv
# Cross-compile for iOS
cargo build -vvvv --target aarch64-apple-ios
# Cross-compile for Android
cargo build -vvvv --target aarch64-linux-android
```

## Known issues

### Missing `sys/random.h`

random.h is not available in the iOS SDK includes but it is available in the MacOS SDK includes. So you can copy it from `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys` and paste it in `/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/sys`. This will work, no compability issues, it's just not there for some reason.

You can also run `scripts/patcher.sh` to do this (you may need to run it as `sudo`).



4 changes: 4 additions & 0 deletions barretenberg/bb_rs/scripts/patcher.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Fix some issues that can only be fixed manually

# Copy random.h from MacOS to iOS
cp /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/random.h /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/sys/random.h

0 comments on commit e1af688

Please sign in to comment.