The zlib third party module provided by qt 5.15.16 does not use time_t,
so building zlib with _TIME_BITS enabled causes compiler issues. The upstream
zlib repository already has a patch that fixes this issues. Import it to
resolve the issue.

Signed-off-by: Fabian Pfitzner <[email protected]>
---
 .../0600-undefine-_TIME_BITS.patch            | 30 +++++++++++++++++++
 .../series                                    |  4 ++-
 2 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 
patches/qt-everywhere-opensource-src-5.15.16/0600-undefine-_TIME_BITS.patch

diff --git 
a/patches/qt-everywhere-opensource-src-5.15.16/0600-undefine-_TIME_BITS.patch 
b/patches/qt-everywhere-opensource-src-5.15.16/0600-undefine-_TIME_BITS.patch
new file mode 100644
index 000000000..f19c6a151
--- /dev/null
+++ 
b/patches/qt-everywhere-opensource-src-5.15.16/0600-undefine-_TIME_BITS.patch
@@ -0,0 +1,30 @@
+From: Fabian Pfitzner <[email protected]>
+Date: Wed, 7 May 2025 14:00:26 +0200
+Subject: [PATCH] undefine _TIME_BITS
+
+zlib does not use time_t, so _TIME_BITS is irrelevant.
+This was already fixed in the upstream zlib repo [1].
+
+[1] 
https://github.com/madler/zlib/commit/a566e156b3fa07b566ddbf6801b517a9dba04fa3
+
+Signed-off-by: Fabian Pfitzner <[email protected]>
+---
+ qtwebengine/src/3rdparty/chromium/third_party/zlib/gzguts.h | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/qtwebengine/src/3rdparty/chromium/third_party/zlib/gzguts.h 
b/qtwebengine/src/3rdparty/chromium/third_party/zlib/gzguts.h
+index 57faf37165a3..d2057e40bcea 100644
+--- a/qtwebengine/src/3rdparty/chromium/third_party/zlib/gzguts.h
++++ b/qtwebengine/src/3rdparty/chromium/third_party/zlib/gzguts.h
+@@ -7,9 +7,8 @@
+ #  ifndef _LARGEFILE_SOURCE
+ #    define _LARGEFILE_SOURCE 1
+ #  endif
+-#  ifdef _FILE_OFFSET_BITS
+-#    undef _FILE_OFFSET_BITS
+-#  endif
++#  undef _FILE_OFFSET_BITS
++#  undef _TIME_BITS
+ #endif
+ 
+ #ifdef HAVE_HIDDEN
diff --git a/patches/qt-everywhere-opensource-src-5.15.16/series 
b/patches/qt-everywhere-opensource-src-5.15.16/series
index a8f77806b..b1088ce9f 100644
--- a/patches/qt-everywhere-opensource-src-5.15.16/series
+++ b/patches/qt-everywhere-opensource-src-5.15.16/series
@@ -22,4 +22,6 @@
 0402-HACK-qtwebengine-workaround-for-too-long-file-names.patch
 #tag:kms --start-number 500
 0500-eglfs_kms-device-ordering-robustness.patch
-# 544d9b0673000ed50ea790699663a6c7  - git-ptx-patches magic
+#tag:time64 --start-number 600
+0600-undefine-_TIME_BITS.patch
+# ce289d22eb7c2f55726ff2f0e24cb65f  - git-ptx-patches magic
-- 
2.39.5


Reply via email to