Commit 19baedd0 authored by Konstantin Pavlov's avatar Konstantin Pavlov

contrib: qt: fixed FTBFS on glibc 2.28.

This is backported from the upstream 5.11.2 and can be dropped once we
bump Qt version.
parent b0ab406f
Description: Fix qmake build with glibc 2.28
We haven't yet run the configure checks to see if statx and renameat2
are present in glibc, so this fails when we redefine the structures and
functions.
Author: Thiago Macieira <thiago.macieira@intel.com>
Origin: upstream
Applied-Upstream: commit:25feee4
Last-Update: 2018-08-25
--- a/src/corelib/global/qconfig-bootstrapped.h
+++ b/src/corelib/global/qconfig-bootstrapped.h
@@ -98,10 +98,18 @@
#define QT_NO_QOBJECT
#define QT_FEATURE_process -1
#define QT_FEATURE_regularexpression -1
-#define QT_FEATURE_renameat2 -1
+#ifdef __GLIBC_PREREQ
+# define QT_FEATURE_renameat2 (__GLIBC_PREREQ(2, 28) ? 1 : -1)
+#else
+# define QT_FEATURE_renameat2 -1
+#endif
#define QT_FEATURE_sharedmemory -1
#define QT_FEATURE_slog2 -1
-#define QT_FEATURE_statx -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_systemsemaphore -1
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -91,7 +91,6 @@ extern "C" NSString *NSTemporaryDirector
# include <sys/syscall.h>
# include <sys/sendfile.h>
# include <linux/fs.h>
-# include <linux/stat.h>
// in case linux/fs.h is too old and doesn't define it:
#ifndef FICLONE
@@ -112,6 +111,7 @@ static int renameat2(int oldfd, const ch
# endif
# if !QT_CONFIG(statx) && defined(SYS_statx)
+# include <linux/stat.h>
static int statx(int dirfd, const char *pathname, int flag, unsigned mask, struct statx *statxbuf)
{ return syscall(SYS_statx, dirfd, pathname, flag, mask, statxbuf); }
# elif !QT_CONFIG(statx) && !defined(SYS_statx)
......@@ -33,6 +33,7 @@ ifdef HAVE_WIN32
ifndef HAVE_WIN64
$(APPLY) $(SRC)/qt/0001-disable-qt_random_cpu.patch
endif
$(APPLY) $(SRC)/qt/fix-glibc-2.28-build.patch
ifndef HAVE_CROSS_COMPILE
cd qt-$(QT_VERSION_FULL); for i in QtFontDatabaseSupport QtWindowsUIAutomationSupport QtEventDispatcherSupport QtCore; do \
sed -i -e 's,"../../../../../src,"../src,g' include/$$i/$(QT_VERSION)/$$i/private/*.h; done
......
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