diff options
| author | Hongxu Jia <hongxu.jia@windriver.com> | 2013-03-12 09:54:06 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-03-15 01:53:04 +0000 |
| commit | e609afe4d747059480b406602cab90b7c36a0572 (patch) | |
| tree | 31436d72bf4650c9d1185ea9353d7ba8226c6002 | |
| parent | bc7bbe9df753550a91da06ec32721efbe4880e88 (diff) | |
| download | poky-e609afe4d747059480b406602cab90b7c36a0572.tar.gz | |
qemu-native:fix do_compile failed on SLED 11.2
1, When build qemu-native on SLED 11.2, there is an error:
...
| In file included from /usr/include/bits/sigcontext.h:28,
| from /usr/include/signal.h:339,
| from /buildarea2/tmp/work/i686-linux/qemu-native/1.4.0-r0/
qemu-1.4.0/include/qemu-common.h:42,
| from fsdev/virtfs-proxy-helper.c:23:
| /usr/include/asm/sigcontext.h:28: error: expected specifier-
qualifier-list before '__u64'
| /usr/include/asm/sigcontext.h:191: error: expected specifier-
qualifier-list before '__u64'
...
2, The virtfs-proxy-helper.c includes <sys/capability.h> and
qemu-common.h in sequence. The header include map is:
(`-->' presents `include')
...
"virtfs-proxy-helper.c" --> <sys/capability.h>
...
"virtfs-proxy-helper.c" --> "qemu-common.h" --> <signal.h> -->
<bits/sigcontext.h> --> <asm/sigcontext.h> --> <linux/types.h> -->
<asm/types.h> --> <asm-generic/types.h> --> <asm-generic/int-ll64.h>
...
3, The bug is found on SLED 11.2 x86. In libcap header file
/usr/include/sys/capability.h, it does evil stuff like this:
...
25 /*
26 * Make sure we can be included from userland by preventing
27 * capability.h from including other kernel headers
28 */
29 #define _LINUX_TYPES_H
30 #define _LINUX_FS_H
31 #define __LINUX_COMPILER_H
32 #define __user
33
34 typedef unsigned int __u32;
35 typedef __u32 __le32;
...
This completely prevents including /usr/include/linux/types.h.
The above `<asm/sigcontext.h> --> <linux/types.h>' is prevented,
and '__u64' is defined in <asm-generic/int-ll64.h>.
4, Modify virtfs-proxy-helper.c to include <sys/capability.h>
last to workaround the issue.
http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html
http://patchwork.linuxtv.org/patch/12748/
[YOCTO #4001]
(From OE-Core rev: 1267bb2fd91f205d35e805aa019d25ab7a921b14)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/qemu/files/fix-libcap-header-issue-on-some-distro.patch | 84 | ||||
| -rw-r--r-- | meta/recipes-devtools/qemu/qemu.inc | 4 |
2 files changed, 88 insertions, 0 deletions
diff --git a/meta/recipes-devtools/qemu/files/fix-libcap-header-issue-on-some-distro.patch b/meta/recipes-devtools/qemu/files/fix-libcap-header-issue-on-some-distro.patch new file mode 100644 index 0000000000..13a6ea23b1 --- /dev/null +++ b/meta/recipes-devtools/qemu/files/fix-libcap-header-issue-on-some-distro.patch | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | fix libcap header issue on some distro | ||
| 2 | |||
| 3 | 1, When build qemu-native on SLED 11.2, there is an error: | ||
| 4 | ... | ||
| 5 | | In file included from /usr/include/bits/sigcontext.h:28, | ||
| 6 | | from /usr/include/signal.h:339, | ||
| 7 | | from /buildarea2/tmp/work/i686-linux/qemu-native/1.4.0-r0/ | ||
| 8 | qemu-1.4.0/include/qemu-common.h:42, | ||
| 9 | | from fsdev/virtfs-proxy-helper.c:23: | ||
| 10 | | /usr/include/asm/sigcontext.h:28: error: expected specifier- | ||
| 11 | qualifier-list before '__u64' | ||
| 12 | | /usr/include/asm/sigcontext.h:191: error: expected specifier- | ||
| 13 | qualifier-list before '__u64' | ||
| 14 | ... | ||
| 15 | |||
| 16 | 2, The virtfs-proxy-helper.c includes <sys/capability.h> and | ||
| 17 | qemu-common.h in sequence. The header include map is: | ||
| 18 | (`-->' presents `include') | ||
| 19 | ... | ||
| 20 | "virtfs-proxy-helper.c" --> <sys/capability.h> | ||
| 21 | ... | ||
| 22 | "virtfs-proxy-helper.c" --> "qemu-common.h" --> <signal.h> --> | ||
| 23 | <bits/sigcontext.h> --> <asm/sigcontext.h> --> <linux/types.h> --> | ||
| 24 | <asm/types.h> --> <asm-generic/types.h> --> <asm-generic/int-ll64.h> | ||
| 25 | ... | ||
| 26 | |||
| 27 | 3, The bug is found on SLED 11.2 x86. In libcap header file | ||
| 28 | /usr/include/sys/capability.h, it does evil stuff like this: | ||
| 29 | ... | ||
| 30 | 25 /* | ||
| 31 | 26 * Make sure we can be included from userland by preventing | ||
| 32 | 27 * capability.h from including other kernel headers | ||
| 33 | 28 */ | ||
| 34 | 29 #define _LINUX_TYPES_H | ||
| 35 | 30 #define _LINUX_FS_H | ||
| 36 | 31 #define __LINUX_COMPILER_H | ||
| 37 | 32 #define __user | ||
| 38 | 33 | ||
| 39 | 34 typedef unsigned int __u32; | ||
| 40 | 35 typedef __u32 __le32; | ||
| 41 | ... | ||
| 42 | This completely prevents including /usr/include/linux/types.h. | ||
| 43 | The above `<asm/sigcontext.h> --> <linux/types.h>' is prevented, | ||
| 44 | and '__u64' is defined in <asm-generic/int-ll64.h>. | ||
| 45 | |||
| 46 | 4, Modify virtfs-proxy-helper.c to include <sys/capability.h> | ||
| 47 | last to workaround the issue. | ||
| 48 | |||
| 49 | http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html | ||
| 50 | http://patchwork.linuxtv.org/patch/12748/ | ||
| 51 | |||
| 52 | Upstream-Status: Pending | ||
| 53 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 54 | --- | ||
| 55 | fsdev/virtfs-proxy-helper.c | 7 +++++-- | ||
| 56 | 1 file changed, 5 insertions(+), 2 deletions(-) | ||
| 57 | |||
| 58 | diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c | ||
| 59 | --- a/fsdev/virtfs-proxy-helper.c | ||
| 60 | +++ b/fsdev/virtfs-proxy-helper.c | ||
| 61 | @@ -12,7 +12,6 @@ | ||
| 62 | #include <sys/resource.h> | ||
| 63 | #include <getopt.h> | ||
| 64 | #include <syslog.h> | ||
| 65 | -#include <sys/capability.h> | ||
| 66 | #include <sys/fsuid.h> | ||
| 67 | #include <sys/vfs.h> | ||
| 68 | #include <sys/ioctl.h> | ||
| 69 | @@ -26,7 +25,11 @@ | ||
| 70 | #include "virtio-9p-marshal.h" | ||
| 71 | #include "hw/9pfs/virtio-9p-proxy.h" | ||
| 72 | #include "fsdev/virtio-9p-marshal.h" | ||
| 73 | - | ||
| 74 | +/* | ||
| 75 | + * Include this one last due to some versions of it being buggy: | ||
| 76 | + * http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html | ||
| 77 | + */ | ||
| 78 | +#include <sys/capability.h> | ||
| 79 | #define PROGNAME "virtfs-proxy-helper" | ||
| 80 | |||
| 81 | #ifndef XFS_SUPER_MAGIC | ||
| 82 | -- | ||
| 83 | 1.7.10.4 | ||
| 84 | |||
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 5616a06335..f9b22f3a75 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
| @@ -32,6 +32,10 @@ SRC_URI_append_class-nativesdk = "\ | |||
| 32 | file://relocatable_sdk.patch \ | 32 | file://relocatable_sdk.patch \ |
| 33 | " | 33 | " |
| 34 | 34 | ||
| 35 | SRC_URI_append_class-native = "\ | ||
| 36 | file://fix-libcap-header-issue-on-some-distro.patch \ | ||
| 37 | " | ||
| 38 | |||
| 35 | EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror --disable-vnc-tls --audio-drv-list=oss,alsa --audio-card-list=ac97,es1370 ${SDL} --disable-curl --disable-vnc-jpeg --disable-bluez --with-system-pixman" | 39 | EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror --disable-vnc-tls --audio-drv-list=oss,alsa --audio-card-list=ac97,es1370 ${SDL} --disable-curl --disable-vnc-jpeg --disable-bluez --with-system-pixman" |
| 36 | 40 | ||
| 37 | EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror --disable-vnc-tls \ | 41 | EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror --disable-vnc-tls \ |
