Не удалось запустить компоновщик Rust для цели armv7-linux-android - PullRequest
0 голосов
/ 11 апреля 2019

Я пытаюсь скомпилировать проект Rust в *.so lib для arm.

Cargo.toml:

[package]
name = "light_processor"
version = "0.1.0"
edition = "2018"

[dependencies]
libc = "0.2.51"
sync = "0.1.0"
enum-primitive-derive = "0.1.2"
num-traits = "0.2.6"

[lib]
name = "NativePluginRust"
crate-type = ["dylib"]

[target.'cfg(target_os="android")'.dependencies]
jni = { version = "0.5", default-features = false }

.cargo / config

[target.x86_64-linux-android]
ar = "C:\\NDK\\x86\\bin\\x86_64-linux-android-ar"
linker = "C:\\NDK\\x86_64\\bin\\x86_64-linux-android-clang++"

[target.aarch64-linux-android]
ar = "C:\\NDK\\arm64\\bin\\aarch64-linux-android-ar"
linker = "C:\\NDK\\arm64\\bin\\aarch64-linux-android-clang++"

[target.armv7-linux-androideabi]
ar = "C:\\NDK\\arm\\bin\\arm-linux-androideabi-ar"
linker = "C:\\NDK\\arm\\bin\\arm-linux-androideabi-clang++"

[target.i686-linux-android]
ar = "C:\\NDK\\x86\\bin\\i686-linux-android-ar"
linker = "C:\\NDK\\x86\\bin\\i686-linux-android-clang++"

Платформа и другие

Cargo/rustc version: cargo 1.35.0-nightly (0e35bd8af 2019-03-13)
Windows 10
NDK - r19c

Когда я запускаю cargo build --target armv7-linux-androideabi --release, я получаю эту ошибку компиляции:

error: could not exec the linker
`C:\NDK\arm\bin\arm-linux-androideabi-clang++`

= note: %1 is not a valid Win32 application. (os error 193)
= note: "C:\\NDK\\arm\\bin\\arm-linux-androideabi-clang++" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-Wl,--allow-multiple-definition" "-march=armv7-a" "-L"
"C:\\Users\\User\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\armv7-linux-androideabi\\lib"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.NativePluginRust.aeolmuqr-cgu.0.rcgu.o"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.NativePluginRust.aeolmuqr-cgu.1.rcgu.o"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.NativePluginRust.aeolmuqr-cgu.10.rcgu.o"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.NativePluginRust.aeolmuqr-cgu.11.rcgu.o"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.NativePluginRust.aeolmuqr-cgu.12.rcgu.o"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.NativePluginRust.aeolmuqr-cgu.13.rcgu.o"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.NativePluginRust.aeolmuqr-cgu.14.rcgu.o"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.NativePluginRust.aeolmuqr-cgu.2.rcgu.o"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.NativePluginRust.aeolmuqr-cgu.3.rcgu.o"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.NativePluginRust.aeolmuqr-cgu.4.rcgu.o"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.NativePluginRust.aeolmuqr-cgu.5.rcgu.o"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.NativePluginRust.aeolmuqr-cgu.6.rcgu.o"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.NativePluginRust.aeolmuqr-cgu.7.rcgu.o"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.NativePluginRust.aeolmuqr-cgu.8.rcgu.o"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.NativePluginRust.aeolmuqr-cgu.9.rcgu.o" "-o" "C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\libNativePluginRust.so"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.2sbup2a6qpfbk1uq.rcgu.o"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps\\NativePluginRust.j6dacp3pd956ibr.rcgu.o" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L"
"C:\\other\\light_processor\\target\\armv7-linux-androideabi\\release\\deps" "-L" "C:\\other\\light_processor\\target\\release\\deps" "-L" "C:\\Users\\User\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\armv7-linux-androideabi\\lib" "-Wl,-Bstatic" "-Wl,--whole-archive"
"C:\\Users\\User\\AppData\\Local\\Temp\\rustc7zLh6u\\liblibc-dcfb7bb75e1bfeb5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive"
"C:\\Users\\User\\AppData\\Local\\Temp\\rustc7zLh6u\\libnum_traits-be8894f2a1f013ae.rlib" "-Wl,--no-whole-archive" "-Wl,--start-group" "-Wl,--whole-archive"
"C:\\Users\\User\\AppData\\Local\\Temp\\rustc7zLh6u\\libstd-97937ccdc225868f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive"
"C:\\Users\\User\\AppData\\Local\\Temp\\rustc7zLh6u\\libpanic_unwind-527aca3d5ee99993.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive"
"C:\\Users\\User\\AppData\\Local\\Temp\\rustc7zLh6u\\libbacktrace_sys-a0c445accc9b96e3.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive"
"C:\\Users\\User\\AppData\\Local\\Temp\\rustc7zLh6u\\librustc_demangle-c3cf34e8879986a1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive"
"C:\\Users\\User\\AppData\\Local\\Temp\\rustc7zLh6u\\libunwind-0b9df9c0d003ddcb.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive"
"C:\\Users\\User\\AppData\\Local\\Temp\\rustc7zLh6u\\liblibc-26698ce62cc62b28.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive"
"C:\\Users\\User\\AppData\\Local\\Temp\\rustc7zLh6u\\liballoc-d934247b7fc04a98.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive"
"C:\\Users\\User\\AppData\\Local\\Temp\\rustc7zLh6u\\librustc_std_workspace_core-beae7b27ff1a115e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive"
"C:\\Users\\User\\AppData\\Local\\Temp\\rustc7zLh6u\\libcore-449b58af4aafb370.rlib" "-Wl,--no-whole-archive" "-Wl,--end-group"
"C:\\Users\\User\\AppData\\Local\\Temp\\rustc7zLh6u\\libcompiler_builtins-24a897e39347c695.rlib" "-Wl,-Bdynamic" "-ldl" "-llog" "-lgcc" "-lc" "-lm" "-shared"

Screenshot linker directory

В чем проблемаза этой ошибкой?

...