Bug#628522: perl: ExtUtils::MakeMaker overriding CCFLAGS when passed to WriteMakefile

Niko Tyni ntyni at debian.org
Fri Jun 3 04:41:44 UTC 2011


On Thu, Jun 02, 2011 at 09:53:52PM +0100, Dominic Hargreaves wrote:
> On Thu, Jun 02, 2011 at 09:29:11PM +0300, Niko Tyni wrote:
> > I expect that you didn't build libdbd-oracle-perl (it's in contrib
> > as it needs some Oracle binaries), but if you still have the build
> > logs available, could you please check if any other log contains
> > $Config{ccflags} twice? 
> > 
> > Such packages would be currently using CCFLAGS "correctly" and potentially
> > be affected negatively by the fix. I doubt that having the flags twice
> > breaks anything, but verifying that would be good.
> > 
> > Grepping for -D_REENTRANT.*-D_REENTRANT or something like that should do.
> Sure.

Thanks. I see there are more packages using CCFLAGS "correctly" than
I thought. Interestingly, some of these modify the $Config{ccflags}
settings.

>From libsearch-xapian-perl:

  my $CCFLAGS = $Config{'ccflags'};
  # Perl is built with -Wdeclaration-after-statement on RHEL5 - this isn't
  # meaningful for C++ - it only emits a warning but it's easy to fix.
  $CCFLAGS =~ s/(?:^|\s+)-Wdeclaration-after-statement(?:\s+|$)/ /;
  # The generated code causes "variable may be used uninitialized" warnings
  # if Perl was built with -Wall.
  $CCFLAGS =~ s/(^|\s+)-Wall(\s+|$)/$1-Wall -Wno-uninitialized$2/;
  
  $CCFLAGS .= ' ' . $var{CPPFLAGS} if exists $var{CPPFLAGS};
  $CCFLAGS .= ' ' . $var{CXXFLAGS} if exists $var{CXXFLAGS};

and from libverilog-perl:
  # Grr; some flags cause warnings in g++
  (my $ccflags = $Config{ccflags}) =~ s/ *-Wdeclaration-after-statement//;

Doing that would be impossible with the patch I proposed.

This seems to imply that blindly overriding CCFLAGS isn't quite the right
thing to do after all. A better approach might be to update the EU::MM
documentation, optionally add a new CCEXTRAFLAGS that automatically
includes $Config{ccflags}, and fix the modules that currently don't use
$Config{ccflags} at all.

I'll comment on the upstream ticket too.

The real positives are

> libdbd-pg-perl_2.18.1-1+b1-i386-20110602-1244
> graphicsmagick_1.3.12-1+b3-i386-20110602-0111
> imagemagick_6.6.9.7-2+b1-i386-20110602-0934
> libsearch-xapian-perl_1.2.5.0-3+b1-i386-20110602-0259
> libalgorithm-permute-perl_0.12-1+b2-i386-20110601-2333
> libverilog-perl_3.306-1+b1-i386-20110602-1303
these use $Config{ccflags} to set CCFLAGS

> libzeromq-perl_0.15-1+b1-i386-20110602-0429
uses $Config{ccflags} to set CCFLAGS via inc/Module/Install/XSUtil.pm

> libunicode-japanese-perl_0.47-1+b2-i386-20110602-0422
> nginx_1.0.1-1+b1-i386-20110602-0922
these use ExtUtils::Embed::ccopts() to set CCFLAGS

False positives:

> freeradius_2.1.10+dfsg-3+b1-i386-20110602-1216
> libxml-xerces-perl_2.7.0-0+deb1-2+b2-i386-20110602-0427
these explicitly concatenate -D_REENTRANT with the flags from
ExtUtils::Embed::ccopts / Config{ccflags}

> frozen-bubble_2.2.0-2+b2-i386-20110602-1305
> kvirc_4.1.1~svn5829-1+b1-i386-20110601-2312
> net-snmp_5.4.3~dfsg-2.2+b1-i386-20110602-0320
> sdlperl_2.2.5-1+b3-i386-20110602-1300
> subversion_1.6.16dfsg-1+b3-i386-20110602-0329
> vim_7.3.154+hg~74503f6ee649-2+b2-i386-20110602-1110
these pick up -D_REENTRANT from somewhere else besides ExtUtils::Embed

> xmms2_0.7DrNo+dfsg-2+b3-i386-20110601-2336
picks up -D_REENTRANT from somewhere else besides $Config{ccflags}

-- 
Niko Tyni   ntyni at debian.org






More information about the Perl-maintainers mailing list