-
-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot build for Android arm64: undefined reference to getgrnam_r #642
Comments
Same as #636? |
Not exactly.. It looks like the build is for termux in #636 , while mine is with the NDK, and the missing symbols are different. I suppose it's the same as in they're both for Android arm64. |
Ok. Thanks. I'm probably not going to work on this myself, as I don't really have a way to test it. If it's related to jemalloc, that can be deactivated. |
How? |
Either apply this patch: diff --git a/Cargo.toml b/Cargo.toml
index 2c052fe..d9342d2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -58,12 +58,6 @@ users = "0.10.0"
[target.'cfg(all(unix, not(target_os = "redox")))'.dependencies]
libc = "0.2"
-# FIXME: Re-enable jemalloc on macOS
-# jemalloc is currently disabled on macOS due to a bug in jemalloc in combination with macOS
-# Catalina. See https://github.com/sharkdp/fd/issues/498 for details.
-[target.'cfg(all(not(windows), not(target_os = "macos"), not(target_env = "musl")))'.dependencies]
-jemallocator = "0.3.0"
-
[dev-dependencies]
diff = "0.1"
tempdir = "0.3"
diff --git a/src/main.rs b/src/main.rs
index 4c95f06..5c12c58 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -32,12 +32,6 @@ use crate::filter::{SizeFilter, TimeFilter};
use crate::options::Options;
use crate::regex_helper::pattern_has_uppercase_char;
-// We use jemalloc for performance reasons, see https://github.com/sharkdp/fd/pull/481
-// FIXME: re-enable jemalloc on macOS, see comment in Cargo.toml file for more infos
-#[cfg(all(not(windows), not(target_os = "macos"), not(target_env = "musl")))]
-#[global_allocator]
-static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
-
fn run() -> Result<ExitCode> {
let matches = app::build_app().get_matches_from(env::args_os()); Or make sure that your target triple is properly excluded (like macOS). |
Disabling jemalloc for Android fixes a build failure since jemalloc does not build out of the box for that platform on older API versions. Android started using jemalloc as the system allocator around 2014 for most devices. In the latest Android version (11) the system allocator has been switched to Scudo, which while not being jemalloc is modern and actively maintained and should be used for most software on Android. See: - https://android-developers.googleblog.com/2020/06/system-hardening-in-android-11.html - https://blog.nsogroup.com/a-tale-of-two-mallocs-on-android-libc-allocators-part-2-jemalloc/ - https://stackoverflow.com/questions/2266762/android-libc-version-and-malloc-implementation
@sharkdp The problem is with the default android linker: # .cargo/config
[target.aarch64-linux-android]
ar = "/home/xxx/.NDK/arm64/bin/aarch64-linux-android-ar"
linker = "/home/xxx/.NDK/arm64/bin/aarch64-linux-android-clang"
After that, I could make |
@vfsfitvnm Thank you for the information! |
Describe the bug you encountered:
Cannot build for aarch64-linux-android21-clang with cargo-ndk
Describe what you expected to happen:
Building
What version of
fd
are you using?v8.1.1
Which operating system / distribution are you on?
Host:
Linux sync-android 5.3.0-62-generic #56-Ubuntu SMP Tue Jun 23 11:20:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Target:
aarch64-linux-android21-clang
Build command:
Error:
The text was updated successfully, but these errors were encountered: