Closed AbduSharif closed 7 months ago
A fix for me was to edit the https://github.com/madler/zlib/blob/develop/zlib.map file and remove gz_intmax in line 18
ZLIB_1.2.0 {
global:
compressBound;
deflateBound;
inflateBack;
inflateBackEnd;
inflateBackInit_;
inflateCopy;
local:
deflate_copyright;
inflate_copyright;
inflate_fast;
inflate_table;
zcalloc;
zcfree;
z_errmsg;
gz_error;
- gz_intmax;
_*;
};
Same issue when building latest zlib with LLVM clang 17.0.2 on Ubuntu 22.04 x86_64. The exact error from clang is:
ld.lld: error: version script assignment of 'local' to symbol 'gz_intmax' failed: symbol not defined
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The workaround suggested in the upstream issue is to add -Wl,--undefined-version
to the linker flags. I have added this to LDFLAGS
before calling cmake and the build now works.
I think the problem here with zlib is that the symbol gz_intmax
should be conditionally enabled. It depends on the definition of INT_MAX
. But the map-file unconditionally asks the linker to provide it, which seems wrong. However I'm not sure what a better solution would be...
Note that I have, a few days ago, posted a proposal for a proper fix for this issue.
@madler: Can you look this ticket?
@madler: Can you look this ticket?
gz_intmax()
is now always there.
With NDK 26-rc1, Zlib fails to compile for this:
Reason was most likely was: https://reviews.llvm.org/D135402
That means, the error (for now) could be ignored with passing this: