Project

General

Profile

« Previous | Next » 

Revision ac4d6876

Added by kjtsanaktsidis (KJ Tsanaktsidis) about 2 years ago

[ruby/zlib] Fix misdetection of {crc32,alder32}_z in cloudflare zlib fork

We use the Cloudflare fork of zlib
(https://github.com/cloudflare/zlib), which we find gives improved
performance on AWS Graviton ARM instances. That fork does not define
crc32_z and alder32_z functions.

Until two days ago, Ruby's zlib gem worked fine, because cloudflare zlib
also did not define z_size_t, which meant Ruby did not try and use
these functions.

Since https://github.com/cloudflare/zlib/commit/a3ba99596d6271224d39ef9d6853511f51821e05
however, cloudflare zlib does define z_size_t (but NOT crc32_z or
alder32_z). The zlib gem would try and use these nonexistant
functions and not compile.

This patch fixes it by actually specifically detecting the functions
that the gem wants to call, rather than just the presence of the
z_size_t type.

https://github.com/ruby/zlib/commit/c96e8b9a57