From: "Ludovic Courtès" <ludo@gnu.org>
To: "Wiktor Żelazny" <wz@freeshell.de>
Cc: "Wiktor Żelazny" <wzelazny@vurv.cz>, 57337@debbugs.gnu.org
Subject: [bug#57337] [PATCH 0/2] Add docxbox
Date: Thu, 08 Sep 2022 14:46:02 +0200 [thread overview]
Message-ID: <8735d2hw51.fsf_-_@gnu.org> (raw)
In-Reply-To: <20220822093651.31574-1-wz@freeshell.de> ("Wiktor Żelazny"'s message of "Mon, 22 Aug 2022 11:36:50 +0200")
Wiktor Żelazny <wz@freeshell.de> skribis:
> From: Wiktor Żelazny <wzelazny@vurv.cz>
>
> * gnu/packages/cpp.scm (miniz-cpp): New variable.
[...]
> +++ b/gnu/packages/patches/miniz-cpp-fixed-duplicated-symbols.patch
> @@ -0,0 +1,2734 @@
> +commit 64f974213ac16f78c008bd148c8a2a07e902f148
> +Author: Kay Stenschke <info@stenschke.com>
> +Date: Mon Apr 27 12:13:34 2020 +0200
> +
> + Fixed duplicated symbols
> +
> + Using miniz-cpp from multiple translation units caused linker error.
> + Done: marked declarations as static for correct linking from multiple translation units.
> +
> +diff --git a/zip_file.hpp b/zip_file.hpp
> +index c324f70..3aff33c 100644
> +--- a/zip_file.hpp
> ++++ b/zip_file.hpp
> +@@ -226,12 +226,12 @@
> + //#define MINIZ_NO_MALLOC
> +
> + #if defined(__TINYC__) && (defined(__linux) || defined(__linux__))
> +- // TODO: Work around "error: include file 'sys\utime.h' when compiling with tcc on Linux
> ++// TODO: Work around "error: include file 'sys\utime.h' when compiling with tcc on Linux
> + #define MINIZ_NO_TIME
> + #endif
> +
> + #if !defined(MINIZ_NO_TIME) && !defined(MINIZ_NO_ARCHIVE_APIS)
> +- #include <time.h>
> ++#include <time.h>
> + #endif
> +
> + #if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__i386) || defined(__i486__) || defined(__i486) || defined(i386) || defined(__ia64__) || defined(__x86_64__)
> +@@ -272,15 +272,15 @@ extern "C" {
> + typedef unsigned long mz_ulong;
> +
> + // mz_free() internally uses the MZ_FREE() macro (which by default calls free() unless you've modified the MZ_MALLOC macro) to release a block allocated from the heap.
> +-void mz_free(void *p);
> ++static void mz_free(void *p);
> +
> + #define MZ_ADLER32_INIT (1)
> + // mz_adler32() returns the initial adler-32 value to use when called with ptr==NULL.
> +-mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len);
> ++static mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len);
> +
> + #define MZ_CRC32_INIT (0)
> + // mz_crc32() returns the initial CRC-32 value to use when called with ptr==NULL.
> +-mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len);
> ++static mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len);
> +
> + // Compression strategies.
> + enum { MZ_DEFAULT_STRATEGY = 0, MZ_FILTERED = 1, MZ_HUFFMAN_ONLY = 2, MZ_RLE = 3, MZ_FIXED = 4 };
> +@@ -343,7 +343,7 @@ typedef struct mz_stream_s
> + typedef mz_stream *mz_streamp;
> +
> + // Returns the version string of miniz.c.
> +-const char *mz_version(void);
> ++static const char *mz_version(void);
> +
> + // mz_deflateInit() initializes a compressor with default options:
> + // Parameters:
[...]
> ++#define Z_NO_FLUSH MZ_NO_FLUSH
> ++#define Z_PARTIAL_FLUSH MZ_PARTIAL_FLUSH
> ++#define Z_SYNC_FLUSH MZ_SYNC_FLUSH
> ++#define Z_FULL_FLUSH MZ_FULL_FLUSH
> ++#define Z_FINISH MZ_FINISH
> ++#define Z_BLOCK MZ_BLOCK
> ++#define Z_OK MZ_OK
> ++#define Z_STREAM_END MZ_STREAM_END
> ++#define Z_NEED_DICT MZ_NEED_DICT
> ++#define Z_ERRNO MZ_ERRNO
> ++#define Z_STREAM_ERROR MZ_STREAM_ERROR
> ++#define Z_DATA_ERROR MZ_DATA_ERROR
> ++#define Z_MEM_ERROR MZ_MEM_ERROR
> ++#define Z_BUF_ERROR MZ_BUF_ERROR
> ++#define Z_VERSION_ERROR MZ_VERSION_ERROR
> ++#define Z_PARAM_ERROR MZ_PARAM_ERROR
> ++#define Z_NO_COMPRESSION MZ_NO_COMPRESSION
> ++#define Z_BEST_SPEED MZ_BEST_SPEED
> ++#define Z_BEST_COMPRESSION MZ_BEST_COMPRESSION
> ++#define Z_DEFAULT_COMPRESSION MZ_DEFAULT_COMPRESSION
> ++#define Z_DEFAULT_STRATEGY MZ_DEFAULT_STRATEGY
> ++#define Z_FILTERED MZ_FILTERED
> ++#define Z_HUFFMAN_ONLY MZ_HUFFMAN_ONLY
> ++#define Z_RLE MZ_RLE
> ++#define Z_FIXED MZ_FIXED
> ++#define Z_DEFLATED MZ_DEFLATED
> ++#define Z_DEFAULT_WINDOW_BITS MZ_DEFAULT_WINDOW_BITS
> ++#define alloc_func mz_alloc_func
> ++#define free_func mz_free_func
> ++#define internal_state mz_internal_state
> ++#define z_stream mz_stream
> ++#define deflateInit mz_deflateInit
> ++#define deflateInit2 mz_deflateInit2
> ++#define deflateReset mz_deflateReset
> ++#define deflate mz_deflate
> ++#define deflateEnd mz_deflateEnd
> ++#define deflateBound mz_deflateBound
> ++#define compress mz_compress
> ++#define compress2 mz_compress2
> ++#define compressBound mz_compressBound
> ++#define inflateInit mz_inflateInit
> ++#define inflateInit2 mz_inflateInit2
> ++#define inflate mz_inflate
> ++#define inflateEnd mz_inflateEnd
> ++#define uncompress mz_uncompress
> ++#define crc32 mz_crc32
> ++#define adler32 mz_adler32
It would seem that the code uses a bundled copy of zlib, which is why it
needs to rename things. Do I get it right?
If so, it would be best to remove the bundled zlib and instead add zlib
as an input.
Thanks,
Ludo’.
next prev parent reply other threads:[~2022-09-08 12:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-22 9:27 [bug#57337] [PATCH 0/2] Add docxbox Wiktor Żelazny
2022-08-22 9:36 ` [bug#57337] [PATCH 1/2] gnu: Add miniz-cpp Wiktor Żelazny
2022-08-22 9:36 ` [bug#57337] [PATCH 2/2] gnu: Add docxbox Wiktor Żelazny
2022-09-08 12:49 ` [bug#57337] [PATCH 0/2] " Ludovic Courtès
2022-09-23 18:04 ` Wiktor Żelazny
2022-09-08 12:46 ` Ludovic Courtès [this message]
2022-09-23 17:46 ` Wiktor Żelazny
2022-09-08 12:44 ` Ludovic Courtès
2022-09-23 18:21 ` Wiktor Żelazny
2022-12-26 14:57 ` [bug#57337] [v2 " Wiktor Żelazny
2022-12-26 14:57 ` [bug#57337] [v2 1/2] gnu: Add miniz-cpp Wiktor Żelazny
2023-01-25 22:17 ` Ludovic Courtès
2022-12-26 14:57 ` [bug#57337] [v2 2/2] gnu: Add docxbox Wiktor Żelazny
2023-01-25 22:21 ` Ludovic Courtès
2023-01-28 19:50 ` Wiktor Żelazny
2023-02-05 20:18 ` [bug#57337] [PATCH v3 1/2] gnu: Add miniz-cpp Wiktor Żelazny
2023-02-05 20:18 ` [bug#57337] [PATCH v3 2/2] gnu: Add docxbox Wiktor Żelazny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8735d2hw51.fsf_-_@gnu.org \
--to=ludo@gnu.org \
--cc=57337@debbugs.gnu.org \
--cc=wz@freeshell.de \
--cc=wzelazny@vurv.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).