-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
ld.lld: error: undefined symbol: getgrgid_r
, getifaddrs
, freeifaddrs
#10468
Comments
Update: Seems to be related to #5354. Disabling = note: ld.lld: error: undefined symbol: getgrgid_r
>>> referenced by users.rs:20 (src/users.rs:20)
>>> sysinfo-5340c8098a34d76c.sysinfo.31be9c1b8a597830-cgu.11.rcgu.o:(core::ops::function::impls::_$LT$impl$u20$core..ops..function..FnMut$LT$A$GT$$u20$for$u20$$RF$mut$u20$F$GT$::call_mut::h384f78eb1a9c0060) in archive /home/porya/Github/trs_24/target/aarch64-linux-android/debug/deps/libsysinfo-5340c8098a34d76c.rlib
ld.lld: error: undefined symbol: getifaddrs
>>> referenced by network_helper_nix.rs:108 (src/network_helper_nix.rs:108)
>>> sysinfo-5340c8098a34d76c.sysinfo.31be9c1b8a597830-cgu.13.rcgu.o:(sysinfo::network_helper_nix::get_interface_address::hf6fcff828a5c07c3) in archive /home/porya/Github/trs_24/target/aarch64-linux-android/debug/deps/libsysinfo-5340c8098a34d76c.rlib
ld.lld: error: undefined symbol: freeifaddrs
>>> referenced by network_helper_nix.rs:43 (src/network_helper_nix.rs:43)
>>> sysinfo-5340c8098a34d76c.sysinfo.31be9c1b8a597830-cgu.08.rcgu.o:(core::ptr::drop_in_place$LT$sysinfo..network_helper_nix..InterfaceAddressIterator$GT$::h9b83b8f6ea7804a8 (.llvm.280503784009939295)) in archive /home/porya/Github/trs_24/target/aarch64-linux-android/debug/deps/libsysinfo-5340c8098a34d76c.rlib
>>> referenced by network_helper_nix.rs:43 (src/network_helper_nix.rs:43)
>>> sysinfo-5340c8098a34d76c.sysinfo.31be9c1b8a597830-cgu.08.rcgu.o:(sysinfo::network::refresh_networks_addresses::h156fa60fcd42db43) in archive /home/porya/Github/trs_24/target/aarch64-linux-android/debug/deps/libsysinfo-5340c8098a34d76c.rlib
clang-17: error: linker command failed with exit code 1 (use -v to see invocation)
error: could not compile `trs_24` (bin "trs_24") due to previous error
Error: Command `AR_aarch64-linux-android=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar CARGO_ENCODED_RUSTFLAGS=-Clink-arg=--target=aarch64-linux-android23\u{1f}-L\u{1f}/home/porya/Github/trs_24/target/cargo-apk-temp-extra-link-libraries CARGO_TARGET_AARCH64_LINUX_ANDROID_AR=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang CC_aarch64-linux-android=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang CFLAGS_aarch64-linux-android=--target=aarch64-linux-android23 CXXFLAGS_aarch64-linux-android=--target=aarch64-linux-android23 CXX_aarch64-linux-android=/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ cargo build --target aarch64-linux-android` had a non-zero exit code. |
--no-allow-shlib-undefined
: __system_property_read_callback
getgrgid_r
, getifaddrs
, freeifaddrs
Update 2: In order to fix the error relating It's not the end of it, however. After addressing that issue, an error regarding a missing A fix for this problem has been merged to the cargo install --git https://github.com/rust-mobile/cargo-apk/ --branch rustc-crate-type-cdylib It is also necessary to rename the [lib]
crate-type = ["staticlib", "cdylib"] Bonus: Add the following to your strip = "strip" This all seems a bit complicated, but at the moment it is the only way to do a real android build/run. |
Yup, you need most of the configuration from https://github.com/bevyengine/bevy/blob/main/examples/mobile/Cargo.toml If you set your project like this one, you shouldn't need a patched version of cargo-apk, it will work with the released version |
This is only to help users be aware that their target must be a library, not something that's necessary to fix a bug. It is unlikely to be merged as it breaks the multi-build scenario outlined in the last comment. Following the linked |
Bevy version
0.12.0
What you did
Tried to create an apk out of project via the suggested command on the docs for android:
What went wrong
Failure in build. No final APK was generated due to thrown error.
android-ndk version:
26.1
platform:
arch linux
kernel:
6.5.9-zen2-1-zen
Additional information
The text was updated successfully, but these errors were encountered: