From 7148dfc67ff20c1c625d203aa47b574b3aaa5db1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 18 Mar 2019 07:46:15 -0700 Subject: Accept that glibc's statx() falls back for us So we don't need to have a high kernel requirement on its account. I needed to introduce a configure-time check because we need to include a header to get the __GLIBC__ macro, but we can't include any header in assembler until we know it's glibc (we need to know that the header is assembler-safe). glibc, uClibc and MUSL do provide an assembler-safe features.h, but Bionic does not. And we need to know that it's glibc's implementation, since the fallback was not required. The other three libraries may not implement such a thing when they get around to adding the system call. Fixes: QTBUG-74526 Change-Id: I1004b4b819774c4c9296fffd158d14da98bf571c Reviewed-by: Fabian Vogt Reviewed-by: Simon Hausmann --- src/corelib/configure.json | 16 ++++++++++++++++ src/corelib/global/minimum-linux_p.h | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/corelib/configure.json b/src/corelib/configure.json index a22a7459bd..5f5a00a64f 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -374,6 +374,16 @@ ] } }, + "glibc": { + "label": "GNU libc", + "type": "compile", + "test": { + "include": "stdlib.h", + "main": [ + "return __GLIBC__;" + ] + } + }, "inotify": { "label": "inotify", "type": "compile", @@ -593,6 +603,12 @@ "condition": "libs.glib", "output": [ "privateFeature", "feature" ] }, + "glibc": { + "label": "GNU libc", + "autoDetect": "config.linux", + "condition": "tests.glibc", + "output": [ "privateFeature" ] + }, "iconv": { "label": "iconv", "purpose": "Provides internationalization on Unix.", diff --git a/src/corelib/global/minimum-linux_p.h b/src/corelib/global/minimum-linux_p.h index 9c074e13ba..5112015663 100644 --- a/src/corelib/global/minimum-linux_p.h +++ b/src/corelib/global/minimum-linux_p.h @@ -78,7 +78,11 @@ QT_BEGIN_NAMESPACE * - statx 4.11 QT_CONFIG(statx) */ -#if QT_CONFIG(statx) +#if QT_CONFIG(statx) && !QT_CONFIG(glibc) +// if using glibc, the statx() function in sysdeps/unix/sysv/linux/statx.c +// falls back to stat() for us. +// (Using QT_CONFIG(glibc) instead of __GLIBC__ because the macros aren't +// defined in assembler mode) # define MINLINUX_MAJOR 4 # define MINLINUX_MINOR 11 # define MINLINUX_PATCH 0 -- cgit v1.2.3