Comments (7)
The target (and minimum version) is specified in cflags (i.e. --target=aarch64-linux-android21). If you look at the aarch64-linux-android21-clang
file it's just a wrapper that adds the --target
argument.
from cargokit.
Also the linker error looks like you need to link with libc++, so a missing linker flag, but Rust doesn't use libc++ so I'd assume that whichever crate is compiling and linking c++ code should take care of that.
from cargokit.
Also the linker error looks like you need to link with libc++, so a missing linker flag, but Rust doesn't use libc++ so I'd assume that whichever crate is compiling and linking c++ code should take care of that.
The C library I am compiling is not compiling inside Rust itself, it is compiled in the build.rs file of my Rust crate but I am using the Rust std::process::Command
crate to actually call the make
and make install
commands of the C library, passing to it the parameters needed for each Android arch.
from cargokit.
I think on Android you can either manually link with libc++_static.a
, or have to include libc++_shared.so
in your APK.
https://developer.android.com/ndk/guides/cpp-support#selecting_a_c_runtime
from cargokit.
The target (and minimum version) is specified in cflags (i.e. --target=aarch64-linux-android21). If you look at the
aarch64-linux-android21-clang
file it's just a wrapper that adds the--target
argument.
Finally I verified our C library does not like the format of the compiler + flags from Cargokit, so I will set them manually from paths.
I see there is a env var called CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER
, is it supposed to be used as the LD
(linker) in the environment or similar?
from cargokit.
I think on Android you can either manually link with
libc++_static.a
, or have to includelibc++_shared.so
in your APK.https://developer.android.com/ndk/guides/cpp-support#selecting_a_c_runtime
I actually included the libc++_shared.so
in the APK, in the arm64-v8a folder, but somehow when is packaged into the APK the library loses all its symbols. On the other hand, if I copy same library to an aarch64 folder the symbols are kept, but of course Android does not use it.
from cargokit.
Finally I verified our C library does not like the format of the compiler + flags from Cargokit, so I will set them manually from paths.
I have no idea what that means. The --target
argument is a clang argument, nothing to do with your library, unless there is no way to pass custom compile flags, which woould be very weird.
I actually included the libc++_shared.so in the APK, in the arm64-v8a folder, but somehow when is packaged into the APK the library loses all its symbols.
gradle strips libraries (there is a way to configure it not to at project level), but public symbols should not get stripped.
from cargokit.
Related Issues (20)
- Can Rust breakpoints work when linked to the Flutter app? HOT 2
- Build fails if esp rustup toolchains (rust for ESP32) is installed HOT 1
- Rust compiler errors hidden in `flutter run` HOT 1
- Missing debug symbols for Android HOT 2
- Add config option to disable certain target architectures HOT 3
- Cargokit error in MacOS HOT 2
- External command fails, but works fine after running it manually HOT 1
- Allow overriding URL prefix and public key in cargokit_options.yaml
- shasum: command not found HOT 2
- Cmake cannot find NDK on MacOS HOT 1
- Can we link `libc++` to Android apps?
- iOS podspec affects Android build HOT 3
- Sentry plugin fails with cargokit issue HOT 1
- `nightly`-only options in `~/.cargo/config.toml` break build of default setup HOT 12
- Xcode Library setting clear (reset) by cargokit
- Precompiled builds HOT 3
- failing to build a flutter_rust_bridge_codegen app for android under fedora (can not find crate core) HOT 1
- No such file or directory in run_build_tool.sh
- The iOS bundle is too big
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargokit.