summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/perl/perl-5.14.3/debian/fixes/h2ph-multiarch.diff
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/perl/perl-5.14.3/debian/fixes/h2ph-multiarch.diff')
-rw-r--r--meta/recipes-devtools/perl/perl-5.14.3/debian/fixes/h2ph-multiarch.diff70
1 files changed, 70 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl/perl-5.14.3/debian/fixes/h2ph-multiarch.diff b/meta/recipes-devtools/perl/perl-5.14.3/debian/fixes/h2ph-multiarch.diff
new file mode 100644
index 0000000000..3b6b4a078c
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl-5.14.3/debian/fixes/h2ph-multiarch.diff
@@ -0,0 +1,70 @@
1Upstream-Status:Inappropriate [debian patches]
2From 37969e249dfc593ebabfcb682893b6c69dc6b313 Mon Sep 17 00:00:00 2001
3From: Niko Tyni <ntyni@debian.org>
4Date: Wed, 18 May 2011 21:44:06 -0700
5Subject: Make h2ph correctly search gcc include directories
6
7Bug: http://rt.perl.org/rt3/Public/Bug/Display.html?id=90122
8Bug-Debian: http://bugs.debian.org/625808
9Origin: upstream, http://perl5.git.perl.org/perl.git/commit/e7ec705d9b91d35fa99dc50d0a232b6372160a77
10
11System header conversion with "h2ph -a" is currently broken on Ubuntu
12Natty and Oneiric (unless the gcc-multilib package is installed for
13backward compatibility), resulting in things like
14
15 # perl -e 'require "syscall.ph"'
16 Can't locate asm/unistd.ph in @INC [...]
17
18This happens because Ubuntu has switched to a 'multiarch' setup, see
19<https://wiki.ubuntu.com/MultiarchSpec> for details.
20
21The asm subdirectory isn't in $Config{usrinc} anymore: /usr/include/asm
22is now /usr/include/x86_64-linux-gnu/asm. (The third component of the
23new path varies with the actual architecture.)
24
25gcc --print-search-dirs doesn't really tell anything about where gcc
26looks for the include directories, it was just used to find the gcc
27internal directory prefix.
28
29Parse the output of "gcc -v -E" instead, and append $Config{usrinc}
30for safety. Duplicates shouldn't matter.
31
32The h2ph "-a" switch isn't currently tested automatically, and that
33seems nontrivial to do portably. Manual testing was done with
34
35 # mkdir ttt
36 # ./perl -Ilib ./utils/h2ph -a -d $(pwd)/ttt syscall.h
37
38The gcc invocation has been tested to work with gcc 4.6, 4.1, and 3.3.
39
40http://bugs.debian.org/625808
41https://bugs.launchpad.net/bugs/777903
42
43Patch-Name: fixes/h2ph-multiarch.diff
44---
45 utils/h2ph.PL | 12 ++----------
46 1 files changed, 2 insertions(+), 10 deletions(-)
47
48diff --git a/utils/h2ph.PL b/utils/h2ph.PL
49index 87f3c7d..4545d6d 100644
50--- a/utils/h2ph.PL
51+++ b/utils/h2ph.PL
52@@ -761,16 +761,8 @@ sub queue_includes_from
53 # non-GCC?) C compilers, but gcc uses additional include directories.
54 sub inc_dirs
55 {
56- my $from_gcc = `LC_ALL=C $Config{cc} -v 2>&1`;
57- if( !( $from_gcc =~ s:^Reading specs from (.*?)/specs\b.*:$1/include:s ) )
58- { # gcc-4+ :
59- $from_gcc = `LC_ALL=C $Config{cc} -print-search-dirs 2>&1`;
60- if ( !($from_gcc =~ s/^install:\s*([^\s]+[^\s\/])([\s\/]*).*$/$1\/include/s) )
61- {
62- $from_gcc = '';
63- };
64- };
65- length($from_gcc) ? ($from_gcc, $from_gcc . "-fixed", $Config{usrinc}) : ($Config{usrinc});
66+ my $from_gcc = `LC_ALL=C $Config{cc} -v -E - < /dev/null 2>&1 | awk '/^#include/, /^End of search list/' | grep '^ '`;
67+ length($from_gcc) ? (split(' ', $from_gcc), $Config{usrinc}) : ($Config{usrinc});
68 }
69
70