1From 77196464454a1c66e57ad5aac237a55de211a107 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
3Date: Sun, 14 Apr 2019 13:27:58 +0200
4Subject: [PATCH] Avoid renameeat2 for native(sdk) builds
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Recently pseudo changed to not support reanameeat2 as glibc wrapper [1]. This
10causes massive failures at do_install [2] on qtbase.
11
12To work around tell Qt build configuration not to use ranameet2 independent
13of glibc version.
14
15[1] https://git.openembedded.org/openembedded-core/commit/?id=0fb257121b68f38b40c078150db8f7d0979b7ea5
16[2] https://github.com/meta-qt5/meta-qt5/issues/187
17
18Upstream-Status: Inappropriate [OE-specific]
19
20Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
21---
22 src/corelib/global/qconfig-bootstrapped.h |  4 ++--
23 src/corelib/io/qfilesystemengine_unix.cpp | 10 ----------
24 2 files changed, 2 insertions(+), 12 deletions(-)
25
26diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
27index b3daf43c04..e1df2ac580 100644
28--- a/src/corelib/global/qconfig-bootstrapped.h
29+++ b/src/corelib/global/qconfig-bootstrapped.h
30@@ -107,7 +107,7 @@
31 #define QT_FEATURE_process -1
32 #define QT_FEATURE_regularexpression -1
33 #ifdef __GLIBC_PREREQ
34-# define QT_FEATURE_renameat2 (__GLIBC_PREREQ(2, 28) ? 1 : -1)
35+# define QT_FEATURE_renameat2 -1
36 #else
37 # define QT_FEATURE_renameat2 -1
38 #endif
39@@ -115,7 +115,7 @@
40 #define QT_FEATURE_signaling_nan -1
41 #define QT_FEATURE_slog2 -1
42 #ifdef __GLIBC_PREREQ
43-# define QT_FEATURE_statx (__GLIBC_PREREQ(2, 28) ? 1 : -1)
44+# define QT_FEATURE_statx -1
45 #else
46 # define QT_FEATURE_statx -1
47 #endif
48diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
49index 231e5cb0ea..8da5872c5e 100644
50--- a/src/corelib/io/qfilesystemengine_unix.cpp
51+++ b/src/corelib/io/qfilesystemengine_unix.cpp
52@@ -1443,16 +1443,6 @@ bool QFileSystemEngine::renameFile(const QFileSystemEntry &source, const QFileSy
53     Q_CHECK_FILE_NAME(srcPath, false);
54     Q_CHECK_FILE_NAME(tgtPath, false);
55
56-#if defined(RENAME_NOREPLACE) && QT_CONFIG(renameat2)
57-    if (renameat2(AT_FDCWD, srcPath, AT_FDCWD, tgtPath, RENAME_NOREPLACE) == 0)
58-        return true;
59-
60-    // We can also get EINVAL for some non-local filesystems.
61-    if (errno != EINVAL) {
62-        error = QSystemError(errno, QSystemError::StandardLibraryError);
63-        return false;
64-    }
65-#endif
66 #if defined(Q_OS_DARWIN) && defined(RENAME_EXCL)
67     if (renameatx_np(AT_FDCWD, srcPath, AT_FDCWD, tgtPath, RENAME_EXCL) == 0)
68         return true;
69