diff options
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/0012-fix-libcap-header-issue-on-some-distro.patch')
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/0012-fix-libcap-header-issue-on-some-distro.patch | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/0012-fix-libcap-header-issue-on-some-distro.patch b/meta/recipes-devtools/qemu/qemu/0012-fix-libcap-header-issue-on-some-distro.patch new file mode 100644 index 0000000000..aa24f7294e --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/0012-fix-libcap-header-issue-on-some-distro.patch | |||
@@ -0,0 +1,85 @@ | |||
1 | From bb9e48e331eee06d7bac1dce809c70191d1a3b4d Mon Sep 17 00:00:00 2001 | ||
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
3 | Date: Tue, 12 Mar 2013 09:54:06 +0800 | ||
4 | Subject: [PATCH] fix libcap header issue on some distro | ||
5 | |||
6 | 1, When build qemu-native on SLED 11.2, there is an error: | ||
7 | ... | ||
8 | | In file included from /usr/include/bits/sigcontext.h:28, | ||
9 | | from /usr/include/signal.h:339, | ||
10 | | from /buildarea2/tmp/work/i686-linux/qemu-native/1.4.0-r0/ | ||
11 | qemu-1.4.0/include/qemu-common.h:42, | ||
12 | | from fsdev/virtfs-proxy-helper.c:23: | ||
13 | | /usr/include/asm/sigcontext.h:28: error: expected specifier- | ||
14 | qualifier-list before '__u64' | ||
15 | | /usr/include/asm/sigcontext.h:191: error: expected specifier- | ||
16 | qualifier-list before '__u64' | ||
17 | ... | ||
18 | |||
19 | 2, The virtfs-proxy-helper.c includes <sys/capability.h> and | ||
20 | qemu-common.h in sequence. The header include map is: | ||
21 | (`-->' presents `include') | ||
22 | ... | ||
23 | "virtfs-proxy-helper.c" --> <sys/capability.h> | ||
24 | ... | ||
25 | "virtfs-proxy-helper.c" --> "qemu-common.h" --> <signal.h> --> | ||
26 | <bits/sigcontext.h> --> <asm/sigcontext.h> --> <linux/types.h> --> | ||
27 | <asm/types.h> --> <asm-generic/types.h> --> <asm-generic/int-ll64.h> | ||
28 | ... | ||
29 | |||
30 | 3, The bug is found on SLED 11.2 x86. In libcap header file | ||
31 | /usr/include/sys/capability.h, it does evil stuff like this: | ||
32 | ... | ||
33 | 25 /* | ||
34 | 26 * Make sure we can be included from userland by preventing | ||
35 | 27 * capability.h from including other kernel headers | ||
36 | 28 */ | ||
37 | 29 #define _LINUX_TYPES_H | ||
38 | 30 #define _LINUX_FS_H | ||
39 | 31 #define __LINUX_COMPILER_H | ||
40 | 32 #define __user | ||
41 | 33 | ||
42 | 34 typedef unsigned int __u32; | ||
43 | 35 typedef __u32 __le32; | ||
44 | ... | ||
45 | This completely prevents including /usr/include/linux/types.h. | ||
46 | The above `<asm/sigcontext.h> --> <linux/types.h>' is prevented, | ||
47 | and '__u64' is defined in <asm-generic/int-ll64.h>. | ||
48 | |||
49 | 4, Modify virtfs-proxy-helper.c to include <sys/capability.h> | ||
50 | last to workaround the issue. | ||
51 | |||
52 | http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html | ||
53 | http://patchwork.linuxtv.org/patch/12748/ | ||
54 | |||
55 | Upstream-Status: Pending | ||
56 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
57 | --- | ||
58 | fsdev/virtfs-proxy-helper.c | 7 +++++-- | ||
59 | 1 file changed, 5 insertions(+), 2 deletions(-) | ||
60 | |||
61 | diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c | ||
62 | index 6f132c5ff1..8329950c26 100644 | ||
63 | --- a/fsdev/virtfs-proxy-helper.c | ||
64 | +++ b/fsdev/virtfs-proxy-helper.c | ||
65 | @@ -13,7 +13,6 @@ | ||
66 | #include <sys/resource.h> | ||
67 | #include <getopt.h> | ||
68 | #include <syslog.h> | ||
69 | -#include <sys/capability.h> | ||
70 | #include <sys/fsuid.h> | ||
71 | #include <sys/vfs.h> | ||
72 | #include <sys/ioctl.h> | ||
73 | @@ -27,7 +26,11 @@ | ||
74 | #include "9p-iov-marshal.h" | ||
75 | #include "hw/9pfs/9p-proxy.h" | ||
76 | #include "fsdev/9p-iov-marshal.h" | ||
77 | - | ||
78 | +/* | ||
79 | + * Include this one last due to some versions of it being buggy: | ||
80 | + * http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html | ||
81 | + */ | ||
82 | +#include <sys/capability.h> | ||
83 | #define PROGNAME "virtfs-proxy-helper" | ||
84 | |||
85 | #ifndef XFS_SUPER_MAGIC | ||