Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendored build of rust-openssl fails on x86_64-apple-ios #41

Open
edbaskerville opened this issue Oct 9, 2019 · 0 comments
Open

Vendored build of rust-openssl fails on x86_64-apple-ios #41

edbaskerville opened this issue Oct 9, 2019 · 0 comments

Comments

@edbaskerville
Copy link

edbaskerville commented Oct 9, 2019

(Filed here as requested by @sfackler – copied from sfackler/rust-openssl#1172)

When building a crate using vendored OpenSSL for iOS using cargo lipo, the build succeeds on aarch64-apple-ios but fails on x86_64-apple-ios.

Rust 1.37.0 / Xcode 10.2.1 / macOS 10.14.5.

There is no actual code in the crate (empty lib.rs). Cargo.toml includes:

[dependencies]
openssl = { version = "0.10", features = ["vendored"] }

[lib]
name = "opensslios"
crate-type = ["staticlib"]

Stderr messages begin with:

ar: creating archive libssl.a
Undefined symbols for architecture x86_64:
  "_aesni_cbc_encrypt", referenced from:
      _aesni_init_key in libcrypto.a(e_aes.o)
      _aesni_cbc_cipher in libcrypto.a(e_aes.o)

and end with:

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [apps/openssl] Error 1
make: *** [all] Error 2
thread 'main' panicked at '


Error building OpenSSL:
    Command: "make"
    Exit status: exit code: 2


    ', /Users/ed/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/openssl-src-111.6.0+1.1.1d/src/lib.rs:363:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

[ERROR cargo_lipo] Failed to build "testcrate" for "x86_64-apple-ios": Executing "/Users/ed/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo" "--color" "auto" "build" "-p" "testcrate" "--target" "x86_64-apple-ios" "--lib" finished with error status: exit code: 101

I did modify openssl-src-rs/src/lib.rs a couple months back to get this to work, but because (1) I didn't understand what I was doing and (2) doing it correctly should be very straightforward for someone who does...I'm going to just link to the history rather than actually submitting a pull request:

https://github.com/edbaskerville/openssl-src-rs/commits/master/src/lib.rs

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

No branches or pull requests

1 participant