-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix misdetection of {crc32,alder32}_z in cloudflare zlib fork #68
Fix misdetection of {crc32,alder32}_z in cloudflare zlib fork #68
Conversation
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 cloudflare/zlib@a3ba995 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.
967d89d
to
c96e8b9
Compare
@KJTsanaktsidis @ioquatix This changeset caused build failure on cross-compiling to android30
|
Eurgh - thanks for letting me know. Looking at it now... |
OK, so this is pretty amusing. When extconf runs (with the toolchain from android-ndk-r21e), it actually detects that the
We can see:
The problem is that in android-ndk-r21e:
So the link test succeeds, and thus There's two things which could be considered to be "the problem" here:
Obviously we can't fix the NDK... so I think our choices are:
Obviously point 1 requires a ticket, some analysis as to what will break in the ecosystem, and probably presentation at a dev meeting, so I'll open a PR to hack around it with option 2. |
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 cloudflare/zlib@a3ba995 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.