Bug#1097248: libpdl-io-hdf5-perl: ftbfs with GCC-15

Niko Tyni ntyni at debian.org
Fri Feb 21 16:25:54 GMT 2025


On Wed, Feb 19, 2025 at 09:48:49PM +0200, Niko Tyni wrote:
> On Wed, Feb 19, 2025 at 08:51:47AM +0100, Sebastiaan Couwenberg wrote:
> > Discussion with upstream suggests that perl, pdl, and libpdl-io-hdf5-perl need to be built with the same GCC version to resolve this issue.
> 
> AFAIK this has not been a requirement with earlier GCC upgrades, and it
> seems rather onerous. I'm not at all sure how the relevant dependencies
> should look like.
> 
> I think we need to understand properly why Perl thinks the XS ABI is
> different when modules are built with GCC 15 vs. 14, and whether this
> is somehow specific to the PDL ecosystem or a wider issue.

This is specific to libpdl-io-hdf5-perl and libpdl-netcdf-perl, not a
wider issue. It is caused by them adding -Dbool=int to the build flags.
I doubt it would work even if perl, pdl, and libpdl-io-hdf5-perl were
all built with GCC 15 (but I didn't bother to try.)

The Perl headers #include <stdbool.h> if available, which is the case
on Debian. This system header #defines bool only on C17 and lower, as
it has become a keyword of its own on C23. GCC 15 changes the default
C language version from C17 to C23.

The combined effect is that for C17 (gcc -std=gnu17, default on GCC 14)
the stdbool.h definition overrides the -Dbool=int command line definition,
rendering it harmless (if nonsensical). But for C23 (gcc -std=gnu23,
default on GCC 15) -Dbool=int actually changes the bool size, breaking
the XS module interface.

My suggestion is to remove the -Dbool=int fiddling from the respective
Makefile.PL files, at least on Debian. The PDL-NetCDF git history suggests
that it was added to fix a build problem on Red Hat Linux 5.2 with perl
5.00404, so presumably 1998 or so.

Hope this helps,
-- 
Niko



More information about the pkg-perl-maintainers mailing list