[MacPorts] #71435: Perl 5.34 possibly needs a patch on Tiger because of " $cf->{ccflags} .= ($cf->{ccflags} ? ' ' : '').'-Wno-error=implicit-function-declaration'; "

MacPorts noreply at macports.org
Mon Dec 2 00:44:49 UTC 2024


#71435: Perl 5.34 possibly needs a patch on Tiger because of " $cf->{ccflags} .=
($cf->{ccflags} ? ' ' : '').'-Wno-error=implicit-function-declaration';"
------------------------+--------------------
  Reporter:  ballapete  |      Owner:  (none)
      Type:  defect     |     Status:  new
  Priority:  Normal     |  Milestone:
 Component:  ports      |    Version:  2.10.5
Resolution:             |   Keywords:  tiger
      Port:  perl5.34   |
------------------------+--------------------

Old description:

> `/opt/local/lib/perl5/5.34/ExtUtils/CBuilder/Platform/darwin.pm` has
> these 26 lines:
>
> {{{
>       1 package ExtUtils::CBuilder::Platform::darwin;
>       2
>       3 use warnings;
>       4 use strict;
>       5 use ExtUtils::CBuilder::Platform::Unix;
>       6
>       7 our $VERSION = '0.280236'; # VERSION
>       8 our @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
>       9
>      10 sub compile {
>      11   my $self = shift;
>      12   my $cf = $self->{config};
>      13
>      14   # -flat_namespace isn't a compile flag, it's a linker flag.
> But
>      15   # it's mistakenly in Config.pm as both.  Make the correction
> here.
>      16   local $cf->{ccflags} = $cf->{ccflags};
>      17   $cf->{ccflags} =~ s/-flat_namespace//;
>      18
>      19   # XCode 12 makes this fatal, breaking tons of XS modules
>      20   $cf->{ccflags} .= ($cf->{ccflags} ? ' ' : '').'-Wno-error
> =implicit-function-declaration';
>      21
>      22   $self->SUPER::compile(@_);
>      23 }
>      24
>      25
>      26 1;
> }}}
>
> Lines #19 and #20 are the interesting ones. When `test`ing Perl Modules
> that use `Build.PL` to build with self-written `Portfile`s I encounter
> complaints, and `compiler error`s about the passed argument `-Wno-error
> =implicit-function-declaration`. I think MacPorts' regular `Portfile`s
> use this work-around:
>
> {{{
>     compiler.blacklist-append \
>                      *gcc-4.*
> }}}
>
> together with
>
> {{{
>     perl5.use_module_build
> }}}
>
> Shouldn't a patch for
> `/opt/local/lib/perl5/5.34/ExtUtils/CBuilder/Platform/darwin.pm` be
> preferred? The XCode 12 problem does not exist in a dozen of Mac OS X and
> macOS versions and could be sharper formulated.

New description:

 `/opt/local/lib/perl5/5.34/ExtUtils/CBuilder/Platform/darwin.pm` has these
 26 lines:

 {{{
       1 package ExtUtils::CBuilder::Platform::darwin;
       2
       3 use warnings;
       4 use strict;
       5 use ExtUtils::CBuilder::Platform::Unix;
       6
       7 our $VERSION = '0.280236'; # VERSION
       8 our @ISA = qw(ExtUtils::CBuilder::Platform::Unix);
       9
      10 sub compile {
      11   my $self = shift;
      12   my $cf = $self->{config};
      13
      14   # -flat_namespace isn't a compile flag, it's a linker flag.  But
      15   # it's mistakenly in Config.pm as both.  Make the correction
 here.
      16   local $cf->{ccflags} = $cf->{ccflags};
      17   $cf->{ccflags} =~ s/-flat_namespace//;
      18
      19   # XCode 12 makes this fatal, breaking tons of XS modules
      20   $cf->{ccflags} .= ($cf->{ccflags} ? ' ' : '').'-Wno-error
 =implicit-function-declaration';
      21
      22   $self->SUPER::compile(@_);
      23 }
      24
      25
      26 1;
 }}}

 Lines !#19 and !#20 are the interesting ones. When `test`ing Perl Modules
 that use `Build.PL` to build with self-written `Portfile`s I encounter
 complaints, and `compiler error`s about the passed argument `-Wno-error
 =implicit-function-declaration`. I think MacPorts' regular `Portfile`s use
 this work-around:

 {{{
     compiler.blacklist-append \
                      *gcc-4.*
 }}}

 together with

 {{{
     perl5.use_module_build
 }}}

 Shouldn't a patch for
 `/opt/local/lib/perl5/5.34/ExtUtils/CBuilder/Platform/darwin.pm` be
 preferred? The XCode 12 problem does not exist in a dozen of Mac OS X and
 macOS versions and could be sharper formulated.

--

Comment (by ryandesign):

 `-Wno-error=implicit-function-declaration` should not be used. Instead,
 functions should be declared before they are called.

-- 
Ticket URL: <https://trac.macports.org/ticket/71435#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list