Subject: | Apple have started to apply -Werror by default breaking lots of XS modules |
Apple seem to have started to apply -Werror by default when building C code in the latest version of XCode. This breaks plenty of XS modules. For example, when building Digest::SHA256 this happens: http://paste.scsys.co.uk/592749
The attached patch to ExtUtils::MM_Darwin seems to fix it at least for that case. However there is a nasty caveat. It seems you can't just say `-Wno-error`, it has to be `-Wno-error=...` so it will almost certainly need twiddling to add more things that lazy programmers have been getting away with previously and are now breaking.
Subject: | eumm-Werror.patch |
--- perl5/perlbrew/perls/perl-blead//lib/5.33.3/ExtUtils/MM_Darwin.pm~ 2020-10-08 15:10:30.000000000 +0100
+++ perl5/perlbrew/perls/perl-blead//lib/5.33.3/ExtUtils/MM_Darwin.pm 2020-10-08 15:28:42.000000000 +0100
@@ -46,4 +46,18 @@
$self->SUPER::init_dist(@_);
}
+=head3 cflags
+
+Over-ride Apple's automatic setting of -Werror
+
+=cut
+
+sub cflags {
+ my $self = shift;
+
+ $self->{CCFLAGS} .= ($self->{CCFLAGS} ? ' ' : '').'-Wno-error=implicit-function-declaration';
+
+ $self->SUPER::cflags(@_);
+}
+
1;