diff options
Diffstat (limited to 'meta/recipes-devtools/perl/perl-5.12.2/debian/fixes/h2ph-gcc-4.5.diff')
-rw-r--r-- | meta/recipes-devtools/perl/perl-5.12.2/debian/fixes/h2ph-gcc-4.5.diff | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl/perl-5.12.2/debian/fixes/h2ph-gcc-4.5.diff b/meta/recipes-devtools/perl/perl-5.12.2/debian/fixes/h2ph-gcc-4.5.diff new file mode 100644 index 0000000000..c2baf2fa76 --- /dev/null +++ b/meta/recipes-devtools/perl/perl-5.12.2/debian/fixes/h2ph-gcc-4.5.diff | |||
@@ -0,0 +1,106 @@ | |||
1 | Author: Robin Barker <rmbarker@cpan.org> | ||
2 | Subject: h2ph fix for gcc 4.5 | ||
3 | Bug-Debian: http://bugs.debian.org/599933 | ||
4 | Origin: upstream, http://perl5.git.perl.org/perl.git/commit/8d66b3f930dc6d88b524d103e304308ae73a46e7 | ||
5 | |||
6 | Fix h2ph and test. Needed to build with GCC 4.5. | ||
7 | |||
8 | |||
9 | --- | ||
10 | lib/h2ph.t | 12 ++++++++++-- | ||
11 | utils/h2ph.PL | 28 +++++++++++++++++++++++----- | ||
12 | 2 files changed, 33 insertions(+), 7 deletions(-) | ||
13 | |||
14 | diff --git a/lib/h2ph.t b/lib/h2ph.t | ||
15 | index 27dd7b9..8d62d46 100755 | ||
16 | --- a/lib/h2ph.t | ||
17 | +++ b/lib/h2ph.t | ||
18 | @@ -18,7 +18,7 @@ if (!(-e $extracted_program)) { | ||
19 | exit 0; | ||
20 | } | ||
21 | |||
22 | -plan(4); | ||
23 | +plan(5); | ||
24 | |||
25 | # quickly compare two text files | ||
26 | sub txt_compare { | ||
27 | @@ -41,8 +41,16 @@ $result = runperl( progfile => 'lib/h2ph.pht', | ||
28 | stderr => 1 ); | ||
29 | like( $result, qr/syntax OK$/, "output compiles"); | ||
30 | |||
31 | +$result = runperl( progfile => '_h2ph_pre.ph', | ||
32 | + switches => ['-c'], | ||
33 | + stderr => 1 ); | ||
34 | +like( $result, qr/syntax OK$/, "preamble compiles"); | ||
35 | + | ||
36 | $result = runperl( switches => ["-w"], | ||
37 | - prog => '$SIG{__WARN__} = sub { die $_[0] }; require q(lib/h2ph.pht);'); | ||
38 | + stderr => 1, | ||
39 | + prog => <<'PROG' ); | ||
40 | +$SIG{__WARN__} = sub { die $_[0] }; require q(lib/h2ph.pht); | ||
41 | +PROG | ||
42 | is( $result, '', "output free of warnings" ); | ||
43 | |||
44 | # cleanup | ||
45 | diff --git a/utils/h2ph.PL b/utils/h2ph.PL | ||
46 | index 8f56db4..1255807 100644 | ||
47 | --- a/utils/h2ph.PL | ||
48 | +++ b/utils/h2ph.PL | ||
49 | @@ -401,7 +401,10 @@ if ($opt_e && (scalar(keys %bad_file) > 0)) { | ||
50 | exit $Exit; | ||
51 | |||
52 | sub expr { | ||
53 | - $new = '"(assembly code)"' and return if /\b__asm__\b/; # freak out. | ||
54 | + if (/\b__asm__\b/) { # freak out | ||
55 | + $new = '"(assembly code)"'; | ||
56 | + return | ||
57 | + } | ||
58 | my $joined_args; | ||
59 | if(keys(%curargs)) { | ||
60 | $joined_args = join('|', keys(%curargs)); | ||
61 | @@ -770,7 +773,7 @@ sub inc_dirs | ||
62 | sub build_preamble_if_necessary | ||
63 | { | ||
64 | # Increment $VERSION every time this function is modified: | ||
65 | - my $VERSION = 2; | ||
66 | + my $VERSION = 3; | ||
67 | my $preamble = "$Dest_dir/_h2ph_pre.ph"; | ||
68 | |||
69 | # Can we skip building the preamble file? | ||
70 | @@ -798,7 +801,16 @@ sub build_preamble_if_necessary | ||
71 | # parenthesized value: d=(v) | ||
72 | $define{$_} = $1; | ||
73 | } | ||
74 | - if ($define{$_} =~ /^([+-]?(\d+)?\.\d+([eE][+-]?\d+)?)[FL]?$/) { | ||
75 | + if (/^(\w+)\((\w)\)$/) { | ||
76 | + my($macro, $arg) = ($1, $2); | ||
77 | + my $def = $define{$_}; | ||
78 | + $def =~ s/$arg/\$\{$arg\}/g; | ||
79 | + print PREAMBLE <<DEFINE; | ||
80 | +unless (defined &$macro) { sub $macro(\$) { my (\$$arg) = \@_; \"$def\" } } | ||
81 | + | ||
82 | +DEFINE | ||
83 | + } elsif | ||
84 | + ($define{$_} =~ /^([+-]?(\d+)?\.\d+([eE][+-]?\d+)?)[FL]?$/) { | ||
85 | # float: | ||
86 | print PREAMBLE | ||
87 | "unless (defined &$_) { sub $_() { $1 } }\n\n"; | ||
88 | @@ -807,8 +819,14 @@ sub build_preamble_if_necessary | ||
89 | print PREAMBLE | ||
90 | "unless (defined &$_) { sub $_() { $1 } }\n\n"; | ||
91 | } elsif ($define{$_} =~ /^\w+$/) { | ||
92 | - print PREAMBLE | ||
93 | - "unless (defined &$_) { sub $_() { &$define{$_} } }\n\n"; | ||
94 | + my $def = $define{$_}; | ||
95 | + if ($isatype{$def}) { | ||
96 | + print PREAMBLE | ||
97 | + "unless (defined &$_) { sub $_() { \"$def\" } }\n\n"; | ||
98 | + } else { | ||
99 | + print PREAMBLE | ||
100 | + "unless (defined &$_) { sub $_() { &$def } }\n\n"; | ||
101 | + } | ||
102 | } else { | ||
103 | print PREAMBLE | ||
104 | "unless (defined &$_) { sub $_() { \"", | ||
105 | -- | ||
106 | tg: (c823880..) fixes/h2ph-gcc-4.5 (depends on: upstream) | ||