libnxz / power-gzip

POWER NX zlib compliant library
23 stars 18 forks source link

Incompatibility with zlib-ng compat headers #208

Closed tuliom closed 9 months ago

tuliom commented 9 months ago

Fedora Rawhide (and Fedora 40) is transitioning from zlib to zlib-ng compat.

Both libnxz and zlib-ng compat define the same macros:

/root/power-gzip/lib/nx_crc.c:48:9: error: "ZEXPORT" redefined [-Werror]
   48 | #define ZEXPORT
      |         ^~~~~~~
In file included from /usr/include/zlib.h:41,
                 from /root/power-gzip/lib/nx_zlib.h:57,
                 from /root/power-gzip/lib/nx_crc.c:39:
/usr/include/zconf.h:114:11: note: this is the location of the previous definition
  114 | #  define ZEXPORT Z_EXPORT
      |           ^~~~~~~
/root/power-gzip/lib/nx_crc.c:49:9: error: "ZEXTERN" redefined [-Werror]
   49 | #define ZEXTERN extern
      |         ^~~~~~~
/usr/include/zconf.h:111:11: note: this is the location of the previous definition
  111 | #  define ZEXTERN Z_EXTERN
      |           ^~~~~~~

This environment can be recreated with podman:

podman run -it --rm fedora:rawhide bash
sachinmonga64 commented 9 months ago

@tuliom

Can you please share what are you compiling and how ? Will be helpful for me

tuliom commented 9 months ago

Can you please share what are you compiling and how ? Will be helpful for me

@sachinmonga64 I'm compiling libnxz on Fedora Rawhide (aka. what will become Fedora 40). This Fedora already has GCC 14 and it also switched its default zlib implementation to zlib-ng in compat mode.

IMHO, the easiest way to get the same environment is by using a container image with the command:

podman run -it --rm fedora:rawhide bash

I can reproduce the issue with a simple ../libnxz/configure && make -j$(nproc).

I'm suggesting a fix in PR #209.

tuliom commented 9 months ago

By the way, you can access the complete logs in https://koji.fedoraproject.org/koji/taskinfo?taskID=112080308

tuliom commented 9 months ago

Fixed in the devel branch.