On 21/09/2025 21:50, Collin Funk wrote:
Bruno Haible via GNU coreutils General Discussion <coreutils@gnu.org>
writes:

On Android 9.0, in the Termux app, there are also some compilation warnings:

../src/ls.c:1215:13: warning: call to undeclared function 'statx'; ISO C99 and 
later do not support implicit function declarations 
[-Wimplicit-function-declaration]
../src/stat.c:1397:8: warning: call to undeclared function 'statx'; ISO C99 and 
later do not support implicit function declarations 
[-Wimplicit-function-declaration]
../src/sync.c:144:25: warning: call to undeclared function 'syncfs'; ISO C99 
and later do not support implicit function declarations 
[-Wimplicit-function-declaration]

statx is only available in Android API 30 or newer. This is its
declaration in <sys/stat.h>:

--------------------------------------------------------------------------------
#if defined(__USE_GNU)
/**
  * [statx(2)](http://man7.org/linux/man-pages/man2/statx.2.html) returns
  * extended file status information.
  *
  * Returns 0 on success and returns -1 and sets `errno` on failure.
  *
  * Available since API level 30.
  */

#if __ANDROID_API__ >= 30
int statx(int __dir_fd, const char* _Nonnull __path, int __flags, unsigned 
__mask, struct statx* _Nonnull __buf) __INTRODUCED_IN(30);
#endif /* __ANDROID_API__ >= 30 */

#endif
--------------------------------------------------------------------------------

Bruno

Pádraig, okay to commit the attached patch before the release? It
allows me to build on Android 16 using the following:

     $ ./configure LDFLAGS='-landroid-selinux'

This uses the default API level of 24 where statx and syncfs are
missing. Therefore we need to use gl_CHECK_FUNCS_ANDROID.

Collin

P.S. I guess LDFLAGS='-landroid-selinux' should be in Gnulib somewhere,
but termux already passes it to configure so that is not a new thing.

This looks fine. Please apply.

thank you,
Padraig.

Reply via email to