<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/ext/zlib/extconf.rb, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/zlib] Check for z_size_t along with {crc,adler}32_z in</title>
<updated>2023-10-26T09:56:21+00:00</updated>
<author>
<name>KJ Tsanaktsidis</name>
<email>kj@kjtsanaktsidis.id.au</email>
</author>
<published>2023-10-26T09:56:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e74ea904ad29931c476b3af493e3ee089f5b4afa'/>
<id>e74ea904ad29931c476b3af493e3ee089f5b4afa</id>
<content type='text'>
extconf.rb
(https://github.com/ruby/zlib/pull/69)

The android NDK (android-ndk-r21e) does not have crc32_z, adler32_z, nor
z_size_t in its zlib.h header file. However, it _does_ have the crc32_z
and adler32_z symbols in the libz.a static library!

mkmf performs two tests for have_func:
* It sees if a program that includes the header and takes the address of
  the symbol can compile
* It sees if a program that defines the symbol as `extern void sym_name()`
  and calls it can be linked

If either test works, it considers the function present. The
android-ndk-r21e is passing the second test but not the first for
crc32_z/adler32_z. So, we define HAVE_ZLIB_SIZE_T_FUNCS, but then can't
actually compile the extension (since the prototypes aren't in the
header file).

We can keep this working how it was working before by _also_ checking
for `have_type("z_size_t", "zlib.h")`. The have_type check _only_ looks
in the header file for the type; if a program including the header file
and using the type can't compile, the type is considered absent
regardless of what might be in libz.a.

https://github.com/ruby/zlib/commit/3b9fe962d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
extconf.rb
(https://github.com/ruby/zlib/pull/69)

The android NDK (android-ndk-r21e) does not have crc32_z, adler32_z, nor
z_size_t in its zlib.h header file. However, it _does_ have the crc32_z
and adler32_z symbols in the libz.a static library!

mkmf performs two tests for have_func:
* It sees if a program that includes the header and takes the address of
  the symbol can compile
* It sees if a program that defines the symbol as `extern void sym_name()`
  and calls it can be linked

If either test works, it considers the function present. The
android-ndk-r21e is passing the second test but not the first for
crc32_z/adler32_z. So, we define HAVE_ZLIB_SIZE_T_FUNCS, but then can't
actually compile the extension (since the prototypes aren't in the
header file).

We can keep this working how it was working before by _also_ checking
for `have_type("z_size_t", "zlib.h")`. The have_type check _only_ looks
in the header file for the type; if a program including the header file
and using the type can't compile, the type is considered absent
regardless of what might be in libz.a.

https://github.com/ruby/zlib/commit/3b9fe962d8
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/zlib] Fix misdetection of {crc32,alder32}_z in cloudflare zlib fork</title>
<updated>2023-10-26T02:17:54+00:00</updated>
<author>
<name>KJ Tsanaktsidis</name>
<email>ktsanaktsidis@zendesk.com</email>
</author>
<published>2023-10-15T22:45:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ac4d687656b0350879ea2e033d2f13d1765a7ce3'/>
<id>ac4d687656b0350879ea2e033d2f13d1765a7ce3</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/zlib] Check for functions with arguments and the header</title>
<updated>2023-01-09T10:46:02+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-01-09T09:41:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0a2bf5f1e256de7f030668c6130379cbd0d6d708'/>
<id>0a2bf5f1e256de7f030668c6130379cbd0d6d708</id>
<content type='text'>
With arguments, mkmf skips compilation check for the function as RHS.

https://github.com/ruby/zlib/commit/9ed9d6d36e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With arguments, mkmf skips compilation check for the function as RHS.

https://github.com/ruby/zlib/commit/9ed9d6d36e
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/zlib] Use `z_size_t` version functions</title>
<updated>2022-04-02T10:34:05+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-04-02T10:03:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=07acd6006c69370c7af4ca50221f1a8166d78e3f'/>
<id>07acd6006c69370c7af4ca50221f1a8166d78e3f</id>
<content type='text'>
https://github.com/ruby/zlib/commit/1ce6625fff
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/zlib/commit/1ce6625fff
</pre>
</div>
</content>
</entry>
<entry>
<title>Found library is not usable if the header is not found</title>
<updated>2021-07-05T16:17:38+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-07-05T14:22:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=eecc4570cd0f775cc83b3ce9c811cd5142e838f2'/>
<id>eecc4570cd0f775cc83b3ce9c811cd5142e838f2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix linking bundled zlib</title>
<updated>2021-07-03T03:52:46+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2021-07-02T16:02:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6d8422659a4c8a51f37433b6e63cc98d8526abe9'/>
<id>6d8422659a4c8a51f37433b6e63cc98d8526abe9</id>
<content type='text'>
* Prefix "./" to the import library name to expanded when static
  linking exts.

* Copy zlib shared library to the top build directory.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Prefix "./" to the import library name to expanded when static
  linking exts.

* Copy zlib shared library to the top build directory.
</pre>
</div>
</content>
</entry>
<entry>
<title>zlib: patches for mswin64</title>
<updated>2020-11-23T23:27:08+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2020-11-23T23:27:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=48d1e8682c343bca9d40e81200876eae3af01def'/>
<id>48d1e8682c343bca9d40e81200876eae3af01def</id>
<content type='text'>
* cast to suppress C4267 warnings; no possible loss of data as
  following the comparison.

* shift base address to suppress LNK4281; although /DYNAMICBASE is
  preferable, not sure from which version of link.exe supports it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* cast to suppress C4267 warnings; no possible loss of data as
  following the comparison.

* shift base address to suppress LNK4281; although /DYNAMICBASE is
  preferable, not sure from which version of link.exe supports it.
</pre>
</div>
</content>
</entry>
<entry>
<title>zlib for mingw</title>
<updated>2017-03-03T09:27:27+00:00</updated>
<author>
<name>nobu</name>
<email>nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2017-03-03T09:27:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d2e61b41f50ef1688dac98f6c48dd44c80ac5c6e'/>
<id>d2e61b41f50ef1688dac98f6c48dd44c80ac5c6e</id>
<content type='text'>
* ext/zlib/extconf.rb: fix building zlib for mingw, and for
  cross-compiling.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* ext/zlib/extconf.rb: fix building zlib for mingw, and for
  cross-compiling.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>zlib: clean zlib</title>
<updated>2017-03-01T05:44:37+00:00</updated>
<author>
<name>nobu</name>
<email>nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2017-03-01T05:44:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9da188550ca78525de507442aad1436eb636b3d7'/>
<id>9da188550ca78525de507442aad1436eb636b3d7</id>
<content type='text'>
* ext/zlib/extconf.rb: clean zlib libraries generated in the
  place.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* ext/zlib/extconf.rb: clean zlib libraries generated in the
  place.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>{ext,test}/zlib: Specify frozen_string_literal: true.</title>
<updated>2017-02-07T12:49:57+00:00</updated>
<author>
<name>kazu</name>
<email>kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2017-02-07T12:49:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=026ded9384de4e375858917ecdd08640662bf8e9'/>
<id>026ded9384de4e375858917ecdd08640662bf8e9</id>
<content type='text'>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
</feed>
