Open vadimkantorov opened 3 days ago
If you set the environment variable BUILD_ZLIB
to 0
it will disable building of a private zlib library.
If you set the environment variable
BUILD_ZLIB
to0
it will disable building of a private zlib library.
Trying this now. Thanks!
But I think that the name clashes should also not happen for the default mode which builds a built-in copy of zlib: maybe via symbol prefixing or via modification of symbol visibility... (with version 5.36.0 of perl there were more symbol name clashes with some crc32 symbols, but in 5.40.0 only name clash with z_errmsg
remained) - I consider this part more of a bug
But I think that the name clashes should also not happen for the default mode which build a built-in copy of zlib: maybe via symbol prefixing or via modification of symbol visibility... (with version 5.36.0 of perl there were more name clashes with some crc32 symbols, but in 5.40.0 only name clash with
z_errmsg
remained)
The upstream zlib source has logic in place to allow all the external symbols to have a prefix added to them. That is supposed to avoid name clashes like this. For some reason z_errmsg
isn't included in that logic. I'll see about reporting this upstream.
I'm building a custom fully static perl install with various static modules (including
Compress::Raw::Zlib
and some others). Some of these modules require linking withlibz.a
. And I'm also linking withZlib.a
(the static library produced byCompress::Raw::Zlib
). This led to a multiple definitions ofz_errmsg
symbol (fromZlib.a/zutil.o
):/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: /lib/libz.a(zutil.o):(.data.rel.ro.local+0x0): multiple definition of 'z_errmsg'; /__w/busybiber/busybiber/packfs/lib/perl5/5.40.0/x86_64-linux/auto/Compress/Raw/Zlib/Zlib.a(zutil.o):(.data.rel.ro.local+0x0): first defined here
As a workaround, I renamed this symbol in
Zlib.a
and then linking went all fine. But I think this name clash should be fixed in upstream (maybe via prefixing this and other zlib-symbols or making them private).Also wondering, if I can instruct somehow
Compress::Raw::Zlib
to not build a private zlib copy and instead rely on later static linking withlibz.a
. Is there anywhere an example of such configure and perl build command? My current commands:Original issue and repro/artifacts: