I have a situation with clang's 'lld-link' linker
in Wget2 where the symbol 'crc32()' in Gnulib is called
instead of the correct symbol 'crc32()' in Zlib.
In Zlib's inflate.c:
#ifdef GUNZIP
if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */
state->check = crc32(0L, Z_NULL, 0);
The above in fact calls Gnulib's crc32() an crashes due to 'buf == NULL'.
Zlib's 'crc32(crc, buf, len)' on the other hand supports a 'buf == NULL'.
1st line in crc32.c:
if (buf == Z_NULL) return 0UL;
Wget2 is using only static libraries. When using MSVC linker,
this never happens.
I fail to understand how this happens. Experimenting
with '-wholearchive' etc. created other link errors
due to e.g. '_version_etc_copyright' defined in IDN2 too.
But would it be possible to give 'crc32' another name
like 'gl_crc32()'? Or handle 'buf == NULL' as Zlib does?
--
--gv