Comments (1)
Investigation
Following up on my own issue, after a lot of digging and testing, I realized that the command line to build the library, which was provided in the README.md, is the issue. The command line specifies --no-default-features, which disables most of the code for the library. In fact, the Cargo.toml includes an empty Default feature definition anyway, so with or without the command line option, the resulting library would be unusable.
I believe the correct command line for building for an iPhone is:
cargo build --lib --release --features "device ffi-bindings" --target aarch64-apple-ios
Obviously, if you were building for a different platform which required the JNI bindings you would need to include that in the feature list as well.
Conclusion
This is a documentation bug and should be resolved to prevent this issue for others.
I admit that my knowledge of Cargo at the start of this was quite limited, so I was relying heavily on the README.md and the information available in the repository. Having dug a little deeper into the package manger, I realized that no features were enabled by default and in fact the resulting library contained virtually no Wireguard code. Why the code was shipped this way is a bit of a mystery to me.
It seems like adding a minimal set of features to the Default feature and removing the --no-default-features flag from the documentation would be a good solution here.
Other useful information
As a side note, it is probably also worth mentioning that the nm included with the XCode command line tools does not appear compatible with the object format produced by the Rust LLVM. That leads to a lot of errors and missing symbols when dumping the library contents. For example:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm: error:
libboringtun.a(boringtun.boringtun.d968bf83758f975a-cgu.0.rcgu.o): Unknown attribute kind (86)
(Producer: 'LLVM17.0.6-rust-1.77.1-stable' Reader: 'LLVM APPLE_1_1500.3.9.4_0')
I found that Objdump was able to dump the library without issues.
objdump -d libboringtun.a
I also found the binutils, available from Homebrew, provided a usable nm. I was able to use gnm to successfully dump the contents of the library. This can be installed and used with the following commands.
brew install binutils
/usr/local/opt/binutils/bin/gnm libboringtun.a
from boringtun.
Related Issues (20)
- Slow work during testing on VM HOT 17
- The wireguard_write encryption result is different from the official one HOT 5
- libboringtun.so shared lib
- Decapsulate error InvalidCounter (not a huge problem, just curious why it happens and whether I should worry) HOT 2
- Tag 0.6.0?
- Intermittent connection loss with HANDSHAKE(REKEY_TIMEOUT) errors HOT 11
- Add support for mips(el) with ring 0.17.0
- Failed to initialize tunnel, error: Socket kind: NotFound
- any benchmarks against Wireguard? HOT 5
- Apple Silicon Support? HOT 2
- i found it's hard to compile this project to shared lib for android, lets share it here HOT 1
- Bad latest handshake timestamp and keepalives not being sent
- Fails to create API socket when /var/lib/wireguard does not exist
- Appetite for refactoring to be SANS-IO (including time?)
- centos7 host based debian docker image failed to implement boringtun in usersapce
- creation of "connected socket" returns unsupported HOT 1
- `daemonize` dependency is out of date and has code that will be rejected by a future version of Rust
- Is this project dead/abandoned? HOT 6
- How to use tauri?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boringtun.