From 633c6c2c004b585b7b3a9d2782fcbf0f29d57efa Mon Sep 17 00:00:00 2001 From: Sevan Janiyan Date: Mon, 17 Apr 2023 14:24:31 +0100 Subject: [PATCH] Unbreak Perl build on legacy Darwin systems 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. Bump version and document. This requires a similar change to cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Darwin.pm which will be handled separately. --- dist/ExtUtils-CBuilder/Changes | 12 ++++++++++++ dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm | 2 +- dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm | 2 +- .../lib/ExtUtils/CBuilder/Platform/Unix.pm | 2 +- .../lib/ExtUtils/CBuilder/Platform/VMS.pm | 2 +- .../lib/ExtUtils/CBuilder/Platform/Windows.pm | 2 +- .../lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm | 2 +- .../lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm | 2 +- .../lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm | 2 +- .../lib/ExtUtils/CBuilder/Platform/aix.pm | 2 +- .../lib/ExtUtils/CBuilder/Platform/android.pm | 2 +- .../lib/ExtUtils/CBuilder/Platform/cygwin.pm | 2 +- .../lib/ExtUtils/CBuilder/Platform/darwin.pm | 5 +---- .../lib/ExtUtils/CBuilder/Platform/dec_osf.pm | 2 +- .../lib/ExtUtils/CBuilder/Platform/os2.pm | 2 +- 15 files changed, 26 insertions(+), 17 deletions(-) diff --git a/dist/ExtUtils-CBuilder/Changes b/dist/ExtUtils-CBuilder/Changes index 5c5c7ce3e58e..f1158fba3beb 100644 --- a/dist/ExtUtils-CBuilder/Changes +++ b/dist/ExtUtils-CBuilder/Changes @@ -1,5 +1,17 @@ Revision history for Perl extension ExtUtils::CBuilder. +0.280239 - 2023-04-15 + + Fix: + - Unbreak Perl build on legacy Darwin systems. + 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. + https://github.com/Perl/perl5/issues/18902 + 0.280238 Fix: diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm index 705d30af0347..454e7b9c6c3e 100644 --- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm +++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder.pm @@ -7,7 +7,7 @@ use Perl::OSType qw/os_type/; use warnings; use strict; -our $VERSION = '0.280238'; # VERSION +our $VERSION = '0.280239'; # VERSION our @ISA; # We only use this once - don't waste a symbol table entry on it. diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm index 0494cafd9506..b21a5af35742 100644 --- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm +++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Base.pm @@ -9,7 +9,7 @@ use Text::ParseWords; use IPC::Cmd qw(can_run); use File::Temp qw(tempfile); -our $VERSION = '0.280238'; # VERSION +our $VERSION = '0.280239'; # VERSION # More details about C/C++ compilers: # http://developers.sun.com/sunstudio/documentation/product/compiler.jsp diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Unix.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Unix.pm index 2eaf591bbe55..7a6ece5cba42 100644 --- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Unix.pm +++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Unix.pm @@ -4,7 +4,7 @@ use warnings; use strict; use ExtUtils::CBuilder::Base; -our $VERSION = '0.280238'; # VERSION +our $VERSION = '0.280239'; # VERSION our @ISA = qw(ExtUtils::CBuilder::Base); sub link_executable { diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm index d09a608fef3c..0964cf81b27b 100644 --- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm +++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm @@ -4,7 +4,7 @@ use warnings; use strict; use ExtUtils::CBuilder::Base; -our $VERSION = '0.280238'; # VERSION +our $VERSION = '0.280239'; # VERSION our @ISA = qw(ExtUtils::CBuilder::Base); use File::Spec::Functions qw(catfile catdir); diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows.pm index 2fffc83d13cd..7650ec440551 100644 --- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows.pm +++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows.pm @@ -8,7 +8,7 @@ use File::Spec; use ExtUtils::CBuilder::Base; use IO::File; -our $VERSION = '0.280238'; # VERSION +our $VERSION = '0.280239'; # VERSION our @ISA = qw(ExtUtils::CBuilder::Base); =begin comment diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm index 6ab48ba88ff4..f8f1bcae8501 100644 --- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm +++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/BCC.pm @@ -1,6 +1,6 @@ package ExtUtils::CBuilder::Platform::Windows::BCC; -our $VERSION = '0.280238'; # VERSION +our $VERSION = '0.280239'; # VERSION use strict; use warnings; diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm index c3eb7a0e633d..f354ecd8aa2c 100644 --- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm +++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/GCC.pm @@ -1,6 +1,6 @@ package ExtUtils::CBuilder::Platform::Windows::GCC; -our $VERSION = '0.280238'; # VERSION +our $VERSION = '0.280239'; # VERSION use warnings; use strict; diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm index ce5e99f08227..5514fd6fe835 100644 --- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm +++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Windows/MSVC.pm @@ -1,6 +1,6 @@ package ExtUtils::CBuilder::Platform::Windows::MSVC; -our $VERSION = '0.280238'; # VERSION +our $VERSION = '0.280239'; # VERSION use warnings; use strict; diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/aix.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/aix.pm index 35de7fa89cbd..156c7c4991e9 100644 --- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/aix.pm +++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/aix.pm @@ -5,7 +5,7 @@ use strict; use ExtUtils::CBuilder::Platform::Unix; use File::Spec; -our $VERSION = '0.280238'; # VERSION +our $VERSION = '0.280239'; # VERSION our @ISA = qw(ExtUtils::CBuilder::Platform::Unix); sub need_prelink { 1 } diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/android.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/android.pm index 44ad646f1f38..52f2def4bd98 100644 --- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/android.pm +++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/android.pm @@ -6,7 +6,7 @@ use File::Spec; use ExtUtils::CBuilder::Platform::Unix; use Config; -our $VERSION = '0.280238'; # VERSION +our $VERSION = '0.280239'; # VERSION our @ISA = qw(ExtUtils::CBuilder::Platform::Unix); # The Android linker will not recognize symbols from diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/cygwin.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/cygwin.pm index 14d814ca5a8e..18e17750f29f 100644 --- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/cygwin.pm +++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/cygwin.pm @@ -5,7 +5,7 @@ use strict; use File::Spec; use ExtUtils::CBuilder::Platform::Unix; -our $VERSION = '0.280238'; # VERSION +our $VERSION = '0.280239'; # VERSION our @ISA = qw(ExtUtils::CBuilder::Platform::Unix); # TODO: If a specific exe_file name is requested, if the exe created diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/darwin.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/darwin.pm index 7e8ae7a4c717..3b0c80cc4179 100644 --- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/darwin.pm +++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/darwin.pm @@ -5,7 +5,7 @@ use strict; use ExtUtils::CBuilder::Platform::Unix; use Config; -our $VERSION = '0.280238'; # VERSION +our $VERSION = '0.280239'; # VERSION our @ISA = qw(ExtUtils::CBuilder::Platform::Unix); my ($osver) = split /\./, $Config{osvers}; @@ -20,9 +20,6 @@ sub compile { local $cf->{ccflags} = $cf->{ccflags}; $cf->{ccflags} =~ s/-flat_namespace//; - # XCode 12 makes this fatal, breaking tons of XS modules - $cf->{ccflags} .= ($cf->{ccflags} ? ' ' : '').'-Wno-error=implicit-function-declaration'; - $self->SUPER::compile(@_); } diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/dec_osf.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/dec_osf.pm index 6b97095b51d5..9437af4a09aa 100644 --- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/dec_osf.pm +++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/dec_osf.pm @@ -5,7 +5,7 @@ use strict; use ExtUtils::CBuilder::Platform::Unix; use File::Spec; -our $VERSION = '0.280238'; # VERSION +our $VERSION = '0.280239'; # VERSION our @ISA = qw(ExtUtils::CBuilder::Platform::Unix); sub link_executable { diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/os2.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/os2.pm index a7d11dceea11..315bb2f6447d 100644 --- a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/os2.pm +++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/os2.pm @@ -4,7 +4,7 @@ use warnings; use strict; use ExtUtils::CBuilder::Platform::Unix; -our $VERSION = '0.280238'; # VERSION +our $VERSION = '0.280239'; # VERSION our @ISA = qw(ExtUtils::CBuilder::Platform::Unix); sub need_prelink { 1 }