Skip Menu |

This queue is for tickets about the Devel-PatchPerl CPAN distribution.

Report information
The Basics
Id: 123634
Status: resolved
Priority: 0/
Queue: Devel-PatchPerl

People
Owner: BINGOS [...] cpan.org
Requestors: DAKKAR [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.48
Fixed in: 1.58



Subject: patch needed to build perl <=5.18 under gcc >=4.9
Building (via perlbrew, for example) perl 5.18 or earlier on a Linux machine using gcc 4.9 or later fails. The problem has been reported against perlbrew: https://github.com/gugod/App-perlbrew/issues/448 and Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=742818 Also see https://rt.perl.org/Public/Bug/Display.html?id=121505 for possible patches vetted by p5p
Adding -fwrapv is not enough: h2ph gets confused by some newer CPP symbols. The attached patch (which I'm pretty sure can be safely applied regardless of gcc version) is needed for 5.14, 5.16, 5.18.
Subject: h2ph.patch
--- utils/h2ph.PL 2017-11-15 11:25:51.553006000 +0000 +++ utils/h2ph.PL 2017-11-15 11:26:30.161006000 +0000 @@ -797,7 +797,7 @@ # parenthesized value: d=(v) $define{$_} = $1; } - if (/^(\w+)\((\w)\)$/) { + if (/^(\w+)\((\w+)\)$/) { my($macro, $arg) = ($1, $2); my $def = $define{$_}; $def =~ s/$arg/\$\{$arg\}/g; @@ -814,6 +814,18 @@ # integer: print PREAMBLE "unless (defined &$_) { sub $_() { $1 } }\n\n"; + } elsif ($define{$_} =~ /^([+-]?0x[\da-f]+)U?L{0,2}$/i) { + # hex integer + # Special cased, since perl warns on hex integers + # that can't be represented in a UV. + # + # This way we get the warning at time of use, so the user + # only gets the warning if they happen to use this + # platform-specific definition. + my $code = $1; + $code = "hex('$code')" if length $code > 10; + print PREAMBLE + "unless (defined &$_) { sub $_() { $code } }\n\n"; } elsif ($define{$_} =~ /^\w+$/) { my $def = $define{$_}; if ($isatype{$def}) {
On Wed Nov 15 10:07:06 2017, DAKKAR wrote: Show quoted text
> Adding -fwrapv is not enough: h2ph gets confused by some newer CPP > symbols. > > The attached patch (which I'm pretty sure can be safely applied > regardless of gcc version) is needed for 5.14, 5.16, 5.18.
I believe I added all these patches.
thank you!