You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[dependencies]
openssl = { version = "0.10.30", features = ["vendored"] }
Build script:
#!/bin/bash
# Ensure that `cargo` is in PATH, using the default location.
export PATH="$PATH:${HOME}/.cargo/bin"
# This obviously doesn't work for the app, only to build on desktop.
export OPENSSL_DIR="/usr/local/opt/openssl"
set -x
# Go to repo's root
cd "${SRCROOT}/../"
# Build binaries
RUSTFLAGS="-Z embed-bitcode" cargo +ios-arm64 build --target aarch64-apple-ios --release --lib
cargo build --target=x86_64-apple-ios --release
# Create fat binary
libtool -static -o ./ios_app/core/libcore ./target/aarch64-apple-ios/release/libcore.a ./target/x86_64-apple-ios/release/libcore.a
When the app is linking, it fails:
+ cd /Users/.../ios_app/../
+ RUSTFLAGS='-Z embed-bitcode'
+ cargo +ios-arm64 build --target aarch64-apple-ios --release --lib
Compiling openssl v0.10.30
Compiling openssl-sys v0.9.58
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-m64" "-L" "/Users/.../.rust-ios-arm64/toolchain-1.43.0/lib/rustlib/x86_64-apple-darwin/lib" "/Users/.../dev/match/apps/target/release/build/openssl-c9dd36216d69fda4/build_script_build-c9dd36216d69fda4.build_script_build.2u6htd52-cgu.0.rcgu.o" "/Users/.../apps/target/release/build/openssl-c9dd36216d69fda4/build_script_build-c9dd36216d69fda4.build_script_build.2u6htd52-cgu.1.rcgu.o" "/Users/.../apps/target/release/build/openssl-c9dd36216d69fda4/build_script_build-c9dd36216d69fda4.build_script_build.2u6htd52-cgu.2.rcgu.o" "/Users/.../apps/target/release/build/openssl-c9dd36216d69fda4/build_script_build-c9dd36216d69fda4.build_script_build.2u6htd52-cgu.3.rcgu.o" "/Users/.../apps/target/release/build/openssl-c9dd36216d69fda4/build_script_build-c9dd36216d69fda4.build_script_build.2u6htd52-cgu.4.rcgu.o" "/Users/.../apps/target/release/build/openssl-c9dd36216d69fda4/build_script_build-c9dd36216d69fda4.build_script_build.2u6htd52-cgu.5.rcgu.o" "/Users/.../apps/target/release/build/openssl-c9dd36216d69fda4/build_script_build-c9dd36216d69fda4.build_script_build.2u6htd52-cgu.6.rcgu.o" "/Users/.../apps/target/release/build/openssl-c9dd36216d69fda4/build_script_build-c9dd36216d69fda4.build_script_build.2u6htd52-cgu.7.rcgu.o" "/Users/.../apps/target/release/build/openssl-c9dd36216d69fda4/build_script_build-c9dd36216d69fda4.build_script_build.2u6htd52-cgu.8.rcgu.o" "/Users/.../apps/target/release/build/openssl-c9dd36216d69fda4/build_script_build-c9dd36216d69fda4.build_script_build.2u6htd52-cgu.9.rcgu.o" "-o" "/Users/.../apps/target/release/build/openssl-c9dd36216d69fda4/build_script_build-c9dd36216d69fda4" "/Users/.../apps/target/release/build/openssl-c9dd36216d69fda4/build_script_build-c9dd36216d69fda4.2v08avjo20u7n477.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/.../apps/target/release/deps" "-L" "/Users/.../.rust-ios-arm64/toolchain-1.43.0/lib/rustlib/x86_64-apple-darwin/lib" "/Users/.../.rust-ios-arm64/toolchain-1.43.0/lib/rustlib/x86_64-apple-darwin/lib/libstd-fda0e7855b9402e8.rlib" "/Users/.../.rust-ios-arm64/toolchain-1.43.0/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-8db4d246b93490a3.rlib" "/Users/.../.rust-ios-arm64/toolchain-1.43.0/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-045cb03abe14acb0.rlib" "/Users/.../.rust-ios-arm64/toolchain-1.43.0/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-08f40434a91057b9.rlib" "/Users/.../.rust-ios-arm64/toolchain-1.43.0/lib/rustlib/x86_64-apple-darwin/lib/libbacktrace-85e9f4ed0eefd4eb.rlib" "/Users/.../.rust-ios-arm64/toolchain-1.43.0/lib/rustlib/x86_64-apple-darwin/lib/libbacktrace_sys-268fe4d097282e32.rlib" "/Users/.../.rust-ios-arm64/toolchain-1.43.0/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-58ce83a0b48d29df.rlib" "/Users/.../.rust-ios-arm64/toolchain-1.43.0/lib/rustlib/x86_64-apple-darwin/lib/libunwind-93b6de48441f0c71.rlib" "/Users/.../.rust-ios-arm64/toolchain-1.43.0/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-10b40de50aced175.rlib" "/Users/.../.rust-ios-arm64/toolchain-1.43.0/lib/rustlib/x86_64-apple-darwin/lib/liblibc-d2f2a948e54a1b51.rlib" "/Users/.../.rust-ios-arm64/toolchain-1.43.0/lib/rustlib/x86_64-apple-darwin/lib/liballoc-b63539fad2a53809.rlib" "/Users/.../.rust-ios-arm64/toolchain-1.43.0/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-115f860040d4f0e8.rlib" "/Users/.../.rust-ios-arm64/toolchain-1.43.0/lib/rustlib/x86_64-apple-darwin/lib/libcore-2952e6310f3dc706.rlib" "/Users/.../.rust-ios-arm64/toolchain-1.43.0/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-d051efb0275a42f6.rlib" "-lSystem" "-lresolv" "-lc" "-lm"
= note: ld: library not found for -lSystem
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: aborting due to previous error
error: could not compile `openssl`.
According to the docs, for vendored OpenSSL I need a C compiler, perl and make installed:
If the vendored Cargo feature is enabled, the openssl-src crate will be used to compile and statically link to a copy of OpenSSL. The build process requires a C compiler, perl, and make.
I checked: gcc, perl and make run in the terminal. The xcode tools also seem to be installed. I also ran brew update and brew upgrade gcc, just in case.
Someone suggested adding the path to libSystem.a to the linker flags. I couldn't find exactly libSystem.a in the SDK. I tried with libSystem.tbd and it didn't work.
I found a maybe related issue: alexcrichton/openssl-src-rs#41. My error is different and getting it both on the simulator and device.
Any ideas?
The text was updated successfully, but these errors were encountered:
Trying to use rust-openssl on iOS:
Build script:
When the app is linking, it fails:
According to the docs, for vendored OpenSSL I need a C compiler, perl and make installed:
I checked: gcc, perl and make run in the terminal. The xcode tools also seem to be installed. I also ran brew update and brew upgrade gcc, just in case.
Someone suggested adding the path to
libSystem.a
to the linker flags. I couldn't find exactlylibSystem.a
in the SDK. I tried withlibSystem.tbd
and it didn't work.I found a maybe related issue: alexcrichton/openssl-src-rs#41. My error is different and getting it both on the simulator and device.
Any ideas?
The text was updated successfully, but these errors were encountered: