Closed Bug 1847468 Opened 1 year ago Closed 1 year ago

undefined reference to `getgrgid_r' when using Android NDK r25c

Categories

(Toolkit :: Crash Reporting, defect)

defect

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: m_kato, Assigned: m_kato)

References

Details

Attachments

(1 file)

When using NDK r25c,bug 1689358's workaround doesn't work.

https://firefoxci.taskcluster-artifacts.net/C8Mnv8ShTzm7uM-vL0cgRA/0/public/logs/live_backing.log (job is https://treeherder.mozilla.org/jobs?repo=try&revision=56e62b847a0c8970b17d4ee4e8cb49eb38140840)

[task 2023-08-07T02:52:50.257Z] 02:52:50     INFO -  /builds/worker/fetches/binutils/bin/ld.bfd: /builds/worker/workspace/obj-build/aarch64-linux-android/debug/libgkrust.a(nix-397cbe82fe0a1711.nix.924e27781fc6b553-cgu.0.rcgu.o): in function `nix::unistd::Group::from_gid::{{closure}}':
[task 2023-08-07T02:52:50.257Z] 02:52:50     INFO -  /builds/worker/checkouts/gecko/third_party/rust/nix/src/unistd.rs:3285: undefined reference to `getgrgid_r'
[task 2023-08-07T02:52:50.257Z] 02:52:50     INFO -  /builds/worker/fetches/binutils/bin/ld.bfd: /builds/worker/checkouts/gecko/third_party/rust/nix/src/unistd.rs:3285: undefined reference to `getgrgid_r'
[task 2023-08-07T02:52:50.257Z] 02:52:50     INFO -  /builds/worker/fetches/binutils/bin/ld.bfd: /builds/worker/workspace/obj-build/aarch64-linux-android/debug/libgkrust.a(nix-397cbe82fe0a1711.nix.924e27781fc6b553-cgu.0.rcgu.o): in function `nix::unistd::Group::from_name::{{closure}}':
[task 2023-08-07T02:52:50.258Z] 02:52:50     INFO -  /builds/worker/checkouts/gecko/third_party/rust/nix/src/unistd.rs:3310: undefined reference to `getgrnam_r'
[task 2023-08-07T02:52:50.258Z] 02:52:50     INFO -  /builds/worker/fetches/binutils/bin/ld.bfd: /builds/worker/checkouts/gecko/third_party/rust/nix/src/unistd.rs:3310: undefined reference to `getgrnam_r'
[task 2023-08-07T02:52:50.258Z] 02:52:50    ERROR -  clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
[task 2023-08-07T02:52:50.258Z] 02:52:50    ERROR -  gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:526: libxul.so] Error 1

Even if NDK r25c, if __ANDROID_API__ isn't 24+, getgrnam_r etc isn't defined in android library. So I guess that we should use __ANDROID_API__ instead of ANDROID_NDK_MAJOR_VERSION.

When using NDK r25c, linker throws an error as undefined reference.

Even if NDK r25c, if __ANDROID_API__ isn't 24+, getgrnam_r and etc aren't
defined in NDK libraries. So we should use __ANDROID_API__ instead of
ANDROID_NDK_MAJOR_VERSION.

Assignee: nobody → m_kato
Status: NEW → ASSIGNED
Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/cc927f0fc3f9 Use __ANDROID_API__ instaed of ANDROID_NDK_MAJOR_VERSION. r=gsvelto
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: