Commit 70c3070b authored by Vilius Sutkus 89's avatar Vilius Sutkus 89
Browse files

Fix statx feature test for Android

statx syscall was introduced in Android-30.
Compiling for Android<30 should fail, yet it doesn't, which results in false positive for a feature that is actually not available.
Would guess that this happens because of the same name for both the function and the struct, which is not #ifdef'ed for legacy Android.

Current check "host_system != 'android'" doesn't guard the feature test against android,
because host_system is never just android, it's android-$abi, like android-x86_64.
parent e54cfb82
Pipeline #246089 passed with stages
in 9 minutes and 43 seconds
......@@ -329,7 +329,7 @@ if cc.has_header('linux/netlink.h')
glib_conf.set('HAVE_NETLINK', 1)
endif
# Is statx() supported? Android systems don’t reliably support it as of August 2020.
# Is statx() supported?
statx_code = '''
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
......@@ -342,7 +342,10 @@ statx_code = '''
return statx (AT_FDCWD, "/", AT_SYMLINK_NOFOLLOW, STATX_BASIC_STATS | STATX_BTIME, &stat_buf);
}
'''
if host_system != 'android' and cc.compiles(statx_code, name : 'statx() test')
# For legacy Android (statx introduced in Android-30) test compiles successfully,
# failure observable only when linking.
if cc.links(statx_code, name : 'statx() test')
glib_conf.set('HAVE_STATX', 1)
endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment