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