Skip Menu |
Report information
Id: 89478
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: ntyni [at] debian.org
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: HasPatch
Severity: low
Type:
Perl Version: (no value)
Fixed In: (no value)

Attachments
0001-Append-CFLAGS-and-LDFLAGS-to-their-Config.pm-counter.patch



Subject: [PATCH] EU::CBuilder shouldn't override $Config{ccflags} with $ENV{CFLAGS}
Date: Thu, 28 Apr 2011 18:01:10 +0300
To: perlbug [...] perl.org
From: Niko Tyni <ntyni [...] debian.org>
On Wed, Apr 27, 2011 at 05:37:56PM -0500, Craig A. Berry wrote: Show quoted text
> On Wed, Apr 27, 2011 at 4:39 PM, Niko Tyni <ntyni@debian.org> wrote: >
> > Failed 4 tests out of 2037, 99.80% okay. > >        ../cpan/Module-Build/t/xs.t > >        ../dist/ExtUtils-ParseXS/t/basic.t > >        ../dist/ExtUtils-ParseXS/t/more.t > >        ../dist/ExtUtils-ParseXS/t/usage.t > > > > What's happening seems to be that when CFLAGS is set, it overrides > > other flags in ExtUtils::CBuilder. One of these, -D_FILE_OFFSET_BITS=64, > > is apparently crucial on this platform for some reason.
>
> > Bisecting shows the crucial thing that breaks this is > > -D_FILE_OFFSET_BITS=64 missing. Don't know why.
>
> > It looks like this is a change in ExtUtils::CBuilder, maybe > >  https://github.com/dagolden/extutils-cbuilder/commit/e653d24a
> > I doubt there's anything crucial about the particular flag, but rather > it's the fact that you're building extensions using flags that give > you code that is binary incompatible with the perl binary it's being > built against. It looks like your expectation is that you can add an > optimization flag by specifying only that flag in CFLAGS. Sounds > reasonable, but clearly what EU::CB is doing is dropping everything it > got from $Config{ccflags} and replacing rather than supplementing it > with what you gave it in CFLAGS.
Yes, I see. Thanks. Perlbugging this with the attached proposed patch. FWIW, I think LDFLAGS should be treated in the same way. Show quoted text
> With options like -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64' used > to build Perl but dropped when testing extension building, you could > be getting a different and incompatible stat structure or other binary > incompatible differences between the extension and the Perl core. > > It seems like the principle of least surprise might be to make EU::CB > take CFLAGS as a supplement to $Config{ccflags} rather than as a > replacement. It would still be possible to create binary > incompatibilities, but perhaps less likely.
-- Niko Tyni ntyni@debian.org

Message body is not shown because sender requested not to inline it.

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.6k
On Thu Apr 28 08:02:02 2011, ntyni@debian.org wrote: Show quoted text
> On Wed, Apr 27, 2011 at 05:37:56PM -0500, Craig A. Berry wrote:
> > On Wed, Apr 27, 2011 at 4:39 PM, Niko Tyni <ntyni@debian.org> wrote: > >
> > > Failed 4 tests out of 2037, 99.80% okay. > > > � � � �../cpan/Module-Build/t/xs.t > > > � � � �../dist/ExtUtils-ParseXS/t/basic.t > > > � � � �../dist/ExtUtils-ParseXS/t/more.t > > > � � � �../dist/ExtUtils-ParseXS/t/usage.t > > > > > > What's happening seems to be that when CFLAGS is set, it overrides > > > other flags in ExtUtils::CBuilder. One of these,
-D_FILE_OFFSET_BITS=64, Show quoted text
> > > is apparently crucial on this platform for some reason.
> >
> > > Bisecting shows the crucial thing that breaks this is > > > -D_FILE_OFFSET_BITS=64 missing. Don't know why.
> >
> > > It looks like this is a change in ExtUtils::CBuilder, maybe > > > �https://github.com/dagolden/extutils-cbuilder/commit/e653d24a
> > > > I doubt there's anything crucial about the particular flag, but rather > > it's the fact that you're building extensions using flags that give > > you code that is binary incompatible with the perl binary it's being > > built against. It looks like your expectation is that you can add an > > optimization flag by specifying only that flag in CFLAGS. Sounds > > reasonable, but clearly what EU::CB is doing is dropping everything it > > got from $Config{ccflags} and replacing rather than supplementing it > > with what you gave it in CFLAGS.
> > Yes, I see. Thanks. Perlbugging this with the attached proposed patch. > FWIW, I think LDFLAGS should be treated in the same way.
Thank you. Applied as 011e8fb47.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org