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>
bb10
Thiago Macieira 2023-08-01 11:48:37 -07:00
parent 233e7e6be3
commit 5a51c2e8b5
3 changed files with 4 additions and 32 deletions

View File

@ -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

View File

@ -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

View File

@ -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