From 5b2924b4b0ff0df70f3937bbfe310e90e6788242 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Thu, 1 Sep 2022 09:00:27 -0400 Subject: [PATCH] Update zconf.h prefixes to match zlib v1.2.12 update Historically Qt has used `Z_PREFIX` within zconf.h of its bundled zlib copy to prefix all zlib symbols with `z_` in order to prevent clashes with a potential system install of the library when linking statically; however, v1.2.12 introduced 3 new functions that were erroneously not accounted for in the upstream repository: - crc32_combine_gen - crc32_combine_gen64 - crc32_combine_op `403020` updated our bundled zlib to this new version and therefore Qt has inherited this oversight, now clashing with external zlib builds. Manually add prefix macro definitions for these three symbols to restore built-in zlib to its previous clash free state while waiting for the issue to be addressed upstream. Change-Id: I83f88109a08cf7e7117f1c94b4557a2c36f519c3 Reviewed-by: Kai Koehne (cherry picked from commit 54ea62756a7b0d47370551b0ec07f602cb341228) Reviewed-by: Qt Cherry-pick Bot --- src/3rdparty/zlib/qtpatches.diff | 14 ++++++++++++-- src/3rdparty/zlib/src/zconf.h | 3 +++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/zlib/qtpatches.diff b/src/3rdparty/zlib/qtpatches.diff index 07018605a25..e4e212dda5f 100644 --- a/src/3rdparty/zlib/qtpatches.diff +++ b/src/3rdparty/zlib/qtpatches.diff @@ -54,7 +54,17 @@ diff -ruN orig/zconf.h src/zconf.h /* * If you *really* need a unique prefix for all types and library functions, * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. -@@ -136,6 +139,7 @@ +@@ -38,6 +41,9 @@ + # define crc32 z_crc32 + # define crc32_combine z_crc32_combine + # define crc32_combine64 z_crc32_combine64 ++# define crc32_combine_gen z_crc32_combine_gen ++# define crc32_combine_gen64 z_crc32_combine_gen64 ++# define crc32_combine_op z_crc32_combine_op + # define crc32_z z_crc32_z + # define deflate z_deflate + # define deflateBound z_deflateBound +@@ -136,6 +142,7 @@ # endif # define zlibCompileFlags z_zlibCompileFlags # define zlibVersion z_zlibVersion @@ -62,7 +72,7 @@ diff -ruN orig/zconf.h src/zconf.h /* all zlib typedefs in zlib.h and zconf.h */ # define Byte z_Byte -@@ -431,7 +435,7 @@ +@@ -431,7 +438,7 @@ typedef unsigned long z_crc_t; #endif diff --git a/src/3rdparty/zlib/src/zconf.h b/src/3rdparty/zlib/src/zconf.h index afd234fa547..837f7bcc577 100644 --- a/src/3rdparty/zlib/src/zconf.h +++ b/src/3rdparty/zlib/src/zconf.h @@ -41,6 +41,9 @@ # define crc32 z_crc32 # define crc32_combine z_crc32_combine # define crc32_combine64 z_crc32_combine64 +# define crc32_combine_gen z_crc32_combine_gen +# define crc32_combine_gen64 z_crc32_combine_gen64 +# define crc32_combine_op z_crc32_combine_op # define crc32_z z_crc32_z # define deflate z_deflate # define deflateBound z_deflateBound