0003-Fix-qmake-build-with-glibc-2.28.patch 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. From 25feee4e061b99edab79503d81f5bd045c6c8e3d Mon Sep 17 00:00:00 2001
  2. From: Thiago Macieira <thiago.macieira@intel.com>
  3. Date: Tue, 7 Aug 2018 09:38:42 -0700
  4. Subject: [PATCH] Fix qmake build with glibc 2.28
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. We haven't yet run the configure checks to see if statx and renameat2
  9. are present in glibc, so this fails when we redefine the structures and
  10. functions.
  11. linux/stat.h:56:8: error: redefinition of 'struct statx_timestamp'
  12. bits/statx.h:25:8: note: previous definition of 'struct statx_timestamp'
  13. qfilesystemengine_unix.cpp:110:12: error: 'int renameat2(int, const char*, int, const char*, unsigned int)' was declared 'extern' and later 'static' [-fpermissive]
  14. Change-Id: Ia741b559c24d46c78fb2fffd1548a792d22e3368
  15. Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
  16. Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
  17. Downloaded from upstream commit
  18. http://code.qt.io/cgit/qt/qtbase.git/commit/?id=25feee4e061b99edab79503d81f5bd045c6c8e3d
  19. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  20. ---
  21. src/corelib/global/qconfig-bootstrapped.h | 12 ++++++++++--
  22. src/corelib/io/qfilesystemengine_unix.cpp | 2 +-
  23. 2 files changed, 11 insertions(+), 3 deletions(-)
  24. diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
  25. index 3469ebe5e6..c5585ea32a 100644
  26. --- a/src/corelib/global/qconfig-bootstrapped.h
  27. +++ b/src/corelib/global/qconfig-bootstrapped.h
  28. @@ -98,10 +98,18 @@
  29. #define QT_NO_QOBJECT
  30. #define QT_FEATURE_process -1
  31. #define QT_FEATURE_regularexpression -1
  32. -#define QT_FEATURE_renameat2 -1
  33. +#ifdef __GLIBC_PREREQ
  34. +# define QT_FEATURE_renameat2 (__GLIBC_PREREQ(2, 28) ? 1 : -1)
  35. +#else
  36. +# define QT_FEATURE_renameat2 -1
  37. +#endif
  38. #define QT_FEATURE_sharedmemory -1
  39. #define QT_FEATURE_slog2 -1
  40. -#define QT_FEATURE_statx -1
  41. +#ifdef __GLIBC_PREREQ
  42. +# define QT_FEATURE_statx (__GLIBC_PREREQ(2, 28) ? 1 : -1)
  43. +#else
  44. +# define QT_FEATURE_statx -1
  45. +#endif
  46. #define QT_FEATURE_syslog -1
  47. #define QT_NO_SYSTEMLOCALE
  48. #define QT_FEATURE_systemsemaphore -1
  49. diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
  50. index 0c9cdb8667..deb4a9f220 100644
  51. --- a/src/corelib/io/qfilesystemengine_unix.cpp
  52. +++ b/src/corelib/io/qfilesystemengine_unix.cpp
  53. @@ -91,7 +91,6 @@ extern "C" NSString *NSTemporaryDirectory();
  54. # include <sys/syscall.h>
  55. # include <sys/sendfile.h>
  56. # include <linux/fs.h>
  57. -# include <linux/stat.h>
  58. // in case linux/fs.h is too old and doesn't define it:
  59. #ifndef FICLONE
  60. @@ -112,6 +111,7 @@ static int renameat2(int oldfd, const char *oldpath, int newfd, const char *newp
  61. # endif
  62. # if !QT_CONFIG(statx) && defined(SYS_statx)
  63. +# include <linux/stat.h>
  64. static int statx(int dirfd, const char *pathname, int flag, unsigned mask, struct statx *statxbuf)
  65. { return syscall(SYS_statx, dirfd, pathname, flag, mask, statxbuf); }
  66. # elif !QT_CONFIG(statx) && !defined(SYS_statx)