[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Android NDK r26 and utmpx
From: |
Po Lu |
Subject: |
Android NDK r26 and utmpx |
Date: |
Sun, 21 Jan 2024 09:46:33 +0800 |
utmpx.h is provided by this new release of the Android NDK, defining
functions as nonfunctional as utmp.h does.
The more pressing problem is that its presence suppresses the definition
of UTMP_NAME_FUNCTION when a program is built with an __ANDROID_API__
lower than 34, where the utmpx* series of functions were introduced,
because the conditional for HAVE_UTMPX_H in readutmp.h does not search
for a `utmpname' function if `utmpxname' is unavailable, with the result
that get_android_boot_time is never invoked. Here are the relevant
portions of config.log:
configure:9462: checking for utmpx.h
configure:9462:
/opt/android/ndk/android-ndk-r26/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android22-clang
-c -O2 -g3 -Werror=implicit-function-declaration conftest.c >&5
configure:9462: $? = 0
configure:9462: result: yes
configure:16416:
/opt/android/ndk/android-ndk-r26/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android22-clang
-o conftest -O2 -g3 -Werror=implicit-function-declaration conftest.c >&5
ld.lld: error: undefined symbol: utmpxname
>>> referenced by conftest.c:116
>>> /tmp/conftest-c4f4cf.o:(main)
>>> did you mean: utmpname
>>> defined in:
>>> /opt/android/ndk/android-ndk-r26/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/aarch64-linux-android/22/libc.so
I will install a workaround in Emacs, but it ought to be fixed at the
source.