diff options
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.diff | 69 |
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 @@ | |||
1 | From 37969e249dfc593ebabfcb682893b6c69dc6b313 Mon Sep 17 00:00:00 2001 | ||
2 | From: Niko Tyni <ntyni@debian.org> | ||
3 | Date: Wed, 18 May 2011 21:44:06 -0700 | ||
4 | Subject: Make h2ph correctly search gcc include directories | ||
5 | |||
6 | Bug: http://rt.perl.org/rt3/Public/Bug/Display.html?id=90122 | ||
7 | Bug-Debian: http://bugs.debian.org/625808 | ||
8 | Origin: upstream, http://perl5.git.perl.org/perl.git/commit/e7ec705d9b91d35fa99dc50d0a232b6372160a77 | ||
9 | |||
10 | System header conversion with "h2ph -a" is currently broken on Ubuntu | ||
11 | Natty and Oneiric (unless the gcc-multilib package is installed for | ||
12 | backward compatibility), resulting in things like | ||
13 | |||
14 | # perl -e 'require "syscall.ph"' | ||
15 | Can't locate asm/unistd.ph in @INC [...] | ||
16 | |||
17 | This happens because Ubuntu has switched to a 'multiarch' setup, see | ||
18 | <https://wiki.ubuntu.com/MultiarchSpec> for details. | ||
19 | |||
20 | The asm subdirectory isn't in $Config{usrinc} anymore: /usr/include/asm | ||
21 | is now /usr/include/x86_64-linux-gnu/asm. (The third component of the | ||
22 | new path varies with the actual architecture.) | ||
23 | |||
24 | gcc --print-search-dirs doesn't really tell anything about where gcc | ||
25 | looks for the include directories, it was just used to find the gcc | ||
26 | internal directory prefix. | ||
27 | |||
28 | Parse the output of "gcc -v -E" instead, and append $Config{usrinc} | ||
29 | for safety. Duplicates shouldn't matter. | ||
30 | |||
31 | The h2ph "-a" switch isn't currently tested automatically, and that | ||
32 | seems 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 | |||
37 | The gcc invocation has been tested to work with gcc 4.6, 4.1, and 3.3. | ||
38 | |||
39 | http://bugs.debian.org/625808 | ||
40 | https://bugs.launchpad.net/bugs/777903 | ||
41 | |||
42 | Patch-Name: fixes/h2ph-multiarch.diff | ||
43 | --- | ||
44 | utils/h2ph.PL | 12 ++---------- | ||
45 | 1 files changed, 2 insertions(+), 10 deletions(-) | ||
46 | |||
47 | diff --git a/utils/h2ph.PL b/utils/h2ph.PL | ||
48 | index 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 | |||