Skip to content
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

zlib-ng: add #1710

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

zlib-ng: add #1710

wants to merge 1 commit into from

Conversation

bgilbert
Copy link
Contributor

Based on zlib.wrap and zlib-ng's CMake build.

The wrap omits these upstream features:

  • Support for building without optimizations (WITH_OPTIM=OFF), with -march=native (WITH_NATIVE_INSTRUCTIONS=ON), without new strategies, without runtime CPU detection, or with reduced memory requirements
  • Support for building as C99
  • Configurable API function name prefix
  • Forcible override of optimization levels greater than 2, enablement of -fno-semantic-interposition, and use of software floating point on 32-bit ARM. It's not the build system's job to override the user's settings. We do forcibly disable LTO to prevent it potentially merging blocks built for different CPU subarches. (GCC, at least, won't do that in any case.)
  • Defining HAVE_SYMVER (optional, and currently a no-op)
  • Defining ZLIB_DEBUG in debug builds. Wrap users probably don't want this.
  • Naming the static build zlibstatic on Windows
  • Maintainer warnings
  • Sanitizers, fuzzers, benchmarks, coverage, and most tests

Also, the exact build logic differs from upstream in a number of small details.

The wrap always uses the dependency name zlib-ng, even when building in zlib-compat mode. Meson will not allow zlib and zlib-ng to share the dependency name zlib within WrapDB. Parent projects can invoke meson.override_dependency('zlib', ...) if desired.

@okias
Copy link

okias commented Sep 24, 2024

Thank you for this PR!

@dcbaker
Copy link
Member

dcbaker commented Sep 24, 2024

The wrap always uses the dependency name zlib-ng, even when building in zlib-compat mode. Meson will not allow zlib and zlib-ng to share the dependency name zlib within WrapDB. Parent projects can invoke meson.override_dependency('zlib', ...) if desired.

This seems like a place that the wrap infrastructure could be enhanced, there are likely more cases where a dependency can be provided by multiple upstreams. Not saying you have to do this, just noting it.

Based on zlib.wrap and zlib-ng's CMake build.

The wrap omits these upstream features:

- Support for building without optimizations (WITH_OPTIM=OFF), with
  -march=native (WITH_NATIVE_INSTRUCTIONS=ON), without new strategies,
  without runtime CPU detection, or with reduced memory requirements
- Support for building as C99
- Configurable API function name prefix
- Forcible override of optimization levels greater than 2, enablement of
  -fno-semantic-interposition, and use of software floating point on
  32-bit ARM.  It's not the build system's job to override the user's
  settings.  We do forcibly disable LTO to prevent it potentially merging
  blocks built for different CPU subarches.  (GCC, at least, won't do that
  in any case.)
- Defining HAVE_SYMVER (optional, and currently a no-op)
- Defining ZLIB_DEBUG in debug builds.  Wrap users probably don't want
  this.
- Naming the static build "zlibstatic" on Windows
- Maintainer warnings
- Sanitizers, fuzzers, benchmarks, coverage, and most tests

Also, the exact build logic differs from upstream in a number of small
details.

The wrap always uses the dependency name "zlib-ng", even when building in
zlib-compat mode.  Meson will not allow zlib and zlib-ng to share the
dependency name "zlib" within WrapDB.  Parent projects can invoke
meson.override_dependency('zlib', ...) if desired.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants