如何解决如何在iOS上使用rust-openssl?
我正在尝试生成带有rust-openssl的RSA密钥对:Rsa::generate(4096)
:
[dependencies]
openssl = { version = "0.10.30",features = ["vendored"] }
这是我的构建脚本:
#!/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
应用程序链接时,失败:
+ 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: 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,对于供应的OpenSSL,我需要一个C编译器,perl并进行安装:
如果启用了供应商提供的货运功能,则将使用openssl-src板条箱编译并静态链接到OpenSSL副本。构建过程需要C编译器,perl和make。
我检查了:gcc
,perl
和make
在终端中运行。 xcode工具似乎也已安装。
我还运行了brew update
和brew upgrade gcc
(在这里我得到gcc 10.2.0 already installed
)(尽管这应该由xcode工具提供)。
有什么想法吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。