Skip to content

configure: fix libbz2 detection on GCC 14 and newer - #47

Open
evs38 wants to merge 1 commit into
pgul:masterfrom
evs38:master
Open

configure: fix libbz2 detection on GCC 14 and newer#47
evs38 wants to merge 1 commit into
pgul:masterfrom
evs38:master

Conversation

@evs38

@evs38 evs38 commented Aug 10, 2026

Copy link
Copy Markdown

The conftest for libbz2 passed (unsigned long*) as the destLen argument
of BZ2_bzBuffToBuffCompress() and BZ2_bzBuffToBuffDecompress(), while
bzlib.h declares both as unsigned int*.

Up to GCC 13 this was only a -Wincompatible-pointer-types warning, so
the test still linked and bzip2 support was detected. GCC 14 promotes
-Wincompatible-pointer-types to an error by default, so the conftest
fails to compile and configure reports:

checking for libbz2... no
configure: error: bz2 lib not found in /usr /usr/local /usr/local/bzlib2

regardless of bzip2 headers and libraries being installed. Building on
AlmaLinux 10 (GCC 14.3.1) reproduces this.

Note that the neighbouring zlib check is correct as it stands: zlib
declares the same argument as uLongf*, i.e. unsigned long*.

Both mkfls/unix/configure.in and the shipped mkfls/unix/configure are
updated, since the latter is what users actually run.

@valcomm

valcomm commented Aug 11, 2026

Copy link
Copy Markdown

This fixed the issue with compiling --with-bzip2 for me on Gentoo.
Thanks

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.

2 participants