Perl-Toolchain-Gang / ExtUtils-MakeMaker

Perl module to make Makefiles and build modules (what backs Makefile.PL)
https://metacpan.org/release/ExtUtils-MakeMaker
64 stars 76 forks source link

lib/ExtUtils/MM_Darwin.pm: Unbreak Perl build #444

Open sevan opened 1 year ago

sevan commented 1 year ago

On modern macOS the compiler defaults to '-Werror,-Wimplicit-function-declaration' This breaks the build on code which calls a function without a prototype (invalid in C99). Turning the check off with '-Wno-error=implicit-function-declaration' breaks the build of Perl itself on legacy versions of Darwin with compilers which do not recognise the flags. Removing it allows Perl to once again build on Mac OS X as old as 10.4 with GCC 4.0.1.

Leont commented 1 year ago

Given that the entire cflags method didn't exist in MM_Darwin until a07d951129587be9c6246e967afc754f4b0cbd68, I'm wondering if we shouldn't remove it entirely. @haarg?

haarg commented 1 year ago

Yeah, it looks like the method should just be removed.

sevan commented 1 year ago

Ah ok, propagating CFLAGS is no longer a requirement? https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/8537a20d07008e10179b398f22ffeecf4b1a3d02

haarg commented 1 year ago

They will be handled properly by the parent method. The extra work was only needed because they were being modified, which is being removed.

sevan commented 1 year ago

Method removed.

haarg commented 1 year ago

This is the other half of Perl/perl5#21023.

As I commented on that ticket, I think this is generally a good change, but it will break a number of XS modules. The original ticket that added this has some commentary: https://rt.cpan.org/Ticket/Display.html?id=133493. With the upcoming perl 5.38 release, I'm not sure when the best time to make these changes is.

sevan commented 1 year ago

The fixes for the affected modules is a trivial one line fix to prototype each defined function. Is there a list of the modules which break?

haarg commented 1 year ago

There is not - we should probably look into doing some smoke runs to find out. While a fix may be trivial, getting releases done for all of the modules likely won't be.