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