2017-05-24 15 views
0

私は、rlib(rust-opensslに依存する)とbin(rlibに依存する)を含むマルチモジュールプロジェクトを持っています。 。--target = i386-apple-ios(iOSシミュレータ)

それは私が一人でrlibを構築する際にokですが、私はビンを構築する際に失敗した、私はエラーを得た:

... 
ld: warning: URGENT: building for OSX, but linking in object file (/Users/travis/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/i386-apple-ios/lib/liballoc_jemalloc-ea49ffd3fee5264c.rlib(pages.pic.o)) built for iOS. Note: This will be an error in the future. 
      ld: warning: URGENT: building for OSX, but linking in object file (/Users/travis/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/i386-apple-ios/lib/liballoc_jemalloc-ea49ffd3fee5264c.rlib(quarantine.pic.o)) built for iOS. Note: This will be an error in the future. 
      ld: warning: URGENT: building for OSX, but linking in object file (/Users/travis/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/i386-apple-ios/lib/liballoc_jemalloc-ea49ffd3fee5264c.rlib(rtree.pic.o)) built for iOS. Note: This will be an error in the future. 
      Undefined symbols for architecture i386: 
      "_fputs$UNIX2003", referenced from: 
       _write_string in libopenssl_sys-f183dd940b82d26e.rlib(ui_openssl.o) 
       _read_string in libopenssl_sys-f183dd940b82d26e.rlib(ui_openssl.o) 
      "_fopen$UNIX2003", referenced from: 
       _open_console in libopenssl_sys-f183dd940b82d26e.rlib(ui_openssl.o) 
       _openssl_fopen in libopenssl_sys-f183dd940b82d26e.rlib(o_fopen.o) 
      "_strerror$UNIX2003", referenced from: 
       _openssl_strerror_r in libopenssl_sys-f183dd940b82d26e.rlib(o_str.o) 
      "_fwrite$UNIX2003", referenced from: 
       _file_write in libopenssl_sys-f183dd940b82d26e.rlib(bss_file.o) 
       _file_puts in libopenssl_sys-f183dd940b82d26e.rlib(bss_file.o) 
       _read_string in libopenssl_sys-f183dd940b82d26e.rlib(ui_openssl.o) 
       _read_string_inner in libopenssl_sys-f183dd940b82d26e.rlib(ui_openssl.o) 
       _test_rc4_init_key in libopenssl_sys-f183dd940b82d26e.rlib(eng_openssl.o) 
      ld: symbol(s) not found for architecture i386 
      clang: error: linker command failed with exit code 1 (use -v to see invocation) 
... 

log on travis-ci

ターゲットのi386-リンゴのIOSに失敗しました。 ターゲットaarch64-apple-ios armv7-apple-ios armv7s-apple-ios ok。

私は〜/ .cargo /設定に

[target.i386-apple-ios] 
rustflags = [ 
"-C", "link-arg=-mios-simulator-version-min=7.0.0" 
] 

を追加しようと、このような別のエラーで終了:

ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/user/project/target/i386-apple-ios/debug/deps/libopenssl_sys-9f3b06cb5b388503.rlib(wp-mmx.o)) built for OSX. Note: This will be an error in the future. 
      ld: warning: object file (/Users/user/project/target/i386-apple-ios/debug/deps/libopenssl_sys-9f3b06cb5b388503.rlib(wp-mmx.o)) was built for newer OSX version (10.12) than being linked (7.0) 
      Undefined symbols for architecture i386: 
      "_fputs$UNIX2003", referenced from: 
       _write_string in libopenssl_sys-9f3b06cb5b388503.rlib(ui_openssl.o) 

    process didn't exit successfully: `rustc --crate-name ssurl src/bin/ssurl.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=e779ded66ad6a046 -C extra-filename=-e779ded66ad6a046 --out-dir /Users/user/project/target/i386-apple-ios/debug/deps --target i386-apple-ios -L dependency=/Users/user/project/target/i386-apple-ios/debug/deps -L dependency=/Users/user/project/target/debug/deps --extern serde_json=/Users/user/project/target/i386-apple-ios/debug/deps/libserde_json-a20ebb8bb7b96947.rlib --extern birdcrypto=/Users/user/project/target/i386-apple-ios/debug/deps/libbirdcrypto-7b7f8b4d9b356742.rlib --extern tokio_io=/Users/user/project/target/i386-apple-ios/debug/deps/libtokio_io-ffe06c22ad81dd5f.rlib --extern bytes=/Users/user/project/target/i386-apple-ios/debug/deps/libbytes-3515e9da1291588d.rlib --extern qrcode=/Users/user/project/target/i386-apple-ios/debug/deps/libqrcode-0b5b9eed05c8d5fb.rlib --extern net2=/Users/user/project/target/i386-apple-ios/debug/deps/libnet2-ecef00d50a8ddca3.rlib --extern lru_cache=/Users/user/project/target/i386-apple-ios/debug/deps/liblru_cache-3a583fd605a1b3b3.rlib --extern tokio_core=/Users/user/project/target/i386-apple-ios/debug/deps/libtokio_core-57e0150d22448791.rlib --extern byteorder=/Users/user/project/target/i386-apple-ios/debug/deps/libbyteorder-240cc8a1e1423fad.rlib --extern domain=/Users/user/project/target/i386-apple-ios/debug/deps/libdomain-fc3ea0606d179f92.rlib --extern futures=/Users/user/project/target/i386-apple-ios/debug/deps/libfutures-8985671f9fa6f7b8.rlib --extern time=/Users/user/project/target/i386-apple-ios/debug/deps/libtime-65bf99b4b8c3df95.rlib --extern log=/Users/user/project/target/i386-apple-ios/debug/deps/liblog-d4c0e5c2504fbbea.rlib --extern base64=/Users/user/project/target/i386-apple-ios/debug/deps/libbase64-3733960102cc46b7.rlib --extern env_logger=/Users/user/project/target/i386-apple-ios/debug/deps/libenv_logger-8778ad732965ba61.rlib --extern num_cpus=/Users/user/project/target/i386-apple-ios/debug/deps/libnum_cpus-9b2a7df0e5b9fd16.rlib --extern clap=/Users/user/project/target/i386-apple-ios/debug/deps/libclap-95e5c3504e3f13b5.rlib --extern birdnet=/Users/user/project/target/i386-apple-ios/debug/deps/libbirdnet-baa74095bd0c6dca.rlib -C link-arg=-mios-simulator-version-min=7.0.0 -L native=/Users/user/project/tmp/openssl-1.1.0e-i386-apple-ios/lib -L native=/Users/user/project/target/i386-apple-ios/debug/build/rust-crypto-38b42e435c8bcaf2/out` (exit code: 101)    _read_string in libopenssl_sys-9f3b06cb5b388503.rlib(ui_openssl.o) 
      "_fopen$UNIX2003", referenced from: 
       _open_console in libopenssl_sys-9f3b06cb5b388503.rlib(ui_openssl.o) 
       _openssl_fopen in libopenssl_sys-9f3b06cb5b388503.rlib(o_fopen.o) 
      "_strerror$UNIX2003", referenced from: 
       _openssl_strerror_r in libopenssl_sys-9f3b06cb5b388503.rlib(o_str.o) 
      "_fwrite$UNIX2003", referenced from: 
       _file_write in libopenssl_sys-9f3b06cb5b388503.rlib(bss_file.o) 
       _file_puts in libopenssl_sys-9f3b06cb5b388503.rlib(bss_file.o) 
       _read_string in libopenssl_sys-9f3b06cb5b388503.rlib(ui_openssl.o) 
       _read_string_inner in libopenssl_sys-9f3b06cb5b388503.rlib(ui_openssl.o) 
       _test_rc4_init_key in libopenssl_sys-9f3b06cb5b388503.rlib(eng_openssl.o) 
      ld: symbol(s) not found for architecture i386 
      clang: error: linker command failed with exit code 1 (use -v to see invocation) 

demo project to reproduce the error

答えて

1

2つの問題があります。

  1. 記号(複数可)した後、正常にビルドのi386-リンゴ-IOSを、https://github.com/chshawkn/openssl-buildからhttps://github.com/x2on/OpenSSL-for-iPhoneにopensslの静的libが置き換え対象i386アーキテクチャ が見つかりません。

  2. ル(/Users/user/project/target/i386-apple-ios/debug/deps/libopenssl_sys-9f3b06cb5b388503.rlib(wp-mmx.oは))OSX用に構築されました。 〜/ .cargo/bin/ccにスクリプトを入れてこれを修正してください。

#!/usr/bin/env bash 
if [ -n "$(echo [email protected] | grep i386-apple-ios)" ] || [ -n "$(echo [email protected] | grep 
x86_64-apple-ios)" ]; then 
    xcrun --sdk iphonesimulator --show-sdk-path 
    exec xcrun --sdk iphonesimulator cc -mios-simulator-version-min=7.0.0 $* 
elif [ -n "$(echo [email protected] | grep apple-ios)" ]; then 
    xcrun --sdk iphoneos --show-sdk-path 
    exec xcrun --sdk iphoneos cc -mios-version-min=7.0.0 $* 
else 
    exec /usr/bin/cc $* 
fi 
関連する問題