diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2023-08-01 11:48:37 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2023-08-03 18:46:57 -0700 |
commit | 5a51c2e8b53358496f6c0ea743c2edf179a30239 (patch) | |
tree | 17ef87e6de12dc446c11ab88b5c18b23f37cd5bd | |
parent | 233e7e6be35a5a455b6ecd7c15de8c9cfc70ca10 (diff) |
CMake: remove check for statx() and replace with STATX_BASIC_STATS
We were already using this in qfilesystemengine_unix.cpp. In fact, the
only place where we had QT_CONFIG(statx) was in minimum-linux_p.h.
Saves 350 ms of CMake time.
Change-Id: Ifbf974a4d10745b099b1fffd177756e2edf2bf3e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
-rw-r--r-- | src/corelib/configure.cmake | 25 | ||||
-rw-r--r-- | src/corelib/global/minimum-linux_p.h | 6 | ||||
-rw-r--r-- | src/corelib/global/qconfig-bootstrapped.h | 5 |
3 files changed, 4 insertions, 32 deletions
diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 51961169f6..b845bc70bf 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -414,27 +414,6 @@ renameat2(AT_FDCWD, argv[1], AT_FDCWD, argv[2], RENAME_NOREPLACE | RENAME_WHITEO } ") -# statx -qt_config_compile_test(statx - LABEL "statx() in libc" - CODE -"#define _ATFILE_SOURCE 1 -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <fcntl.h> - -int main(void) -{ - /* BEGIN TEST: */ -struct statx statxbuf; -unsigned int mask = STATX_BASIC_STATS; -return statx(AT_FDCWD, \"\", AT_STATX_SYNC_AS_STAT, mask, &statxbuf); - /* END TEST: */ - return 0; -} -") - # syslog qt_config_compile_test(syslog LABEL "syslog" @@ -665,10 +644,6 @@ qt_feature("slog2" PRIVATE LABEL "slog2" CONDITION Slog2_FOUND ) -qt_feature("statx" PRIVATE - LABEL "statx() in libc" - CONDITION ( LINUX OR HURD ) AND TEST_statx -) qt_feature("syslog" PRIVATE LABEL "syslog" AUTODETECT OFF diff --git a/src/corelib/global/minimum-linux_p.h b/src/corelib/global/minimum-linux_p.h index a9aa6c5234..d52df474fb 100644 --- a/src/corelib/global/minimum-linux_p.h +++ b/src/corelib/global/minimum-linux_p.h @@ -22,6 +22,7 @@ // #include "private/qglobal_p.h" +#include <sys/stat.h> QT_BEGIN_NAMESPACE @@ -40,10 +41,10 @@ QT_BEGIN_NAMESPACE * - accept4 2.6.28 * - renameat2 3.16 QT_CONFIG(renameat2) * - getrandom 3.17 QT_CONFIG(getentropy) - * - statx 4.11 QT_CONFIG(statx) + * - statx 4.11 STATX_BASIC_STATS */ -#if QT_CONFIG(statx) && defined(__GLIBC__) +#if defined(__GLIBC__) && defined(STATX_BASIC_STATS) // if using glibc, the statx() function in sysdeps/unix/sysv/linux/statx.c // falls back to stat() for us. # define QT_ELF_NOTE_OS_MAJOR 4 @@ -58,6 +59,7 @@ QT_BEGIN_NAMESPACE # define QT_ELF_NOTE_OS_MINOR 16 # define QT_ELF_NOTE_OS_PATCH 0 #else + # define QT_ELF_NOTE_OS_MAJOR 2 # define QT_ELF_NOTE_OS_MINOR 6 # define QT_ELF_NOTE_OS_PATCH 28 diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h index 4b0903d19e..681f379ed1 100644 --- a/src/corelib/global/qconfig-bootstrapped.h +++ b/src/corelib/global/qconfig-bootstrapped.h @@ -82,11 +82,6 @@ #endif #define QT_FEATURE_shortcut -1 #define QT_FEATURE_slog2 -1 -#ifdef __GLIBC_PREREQ -# define QT_FEATURE_statx (__GLIBC_PREREQ(2, 28) ? 1 : -1) -#else -# define QT_FEATURE_statx -1 -#endif #define QT_FEATURE_syslog -1 #define QT_NO_SYSTEMLOCALE #define QT_FEATURE_temporaryfile 1 |