Bug 4001 - qemu-native:do_configure failed with gcc version 4.3.4 on x86
Summary: qemu-native:do_configure failed with gcc version 4.3.4 on x86
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.4
Hardware: x86 Multiple
: Undecided normal
Target Milestone: 1.4 M6
Assignee: Hongxu Jia
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-03-11 03:25 UTC by Hongxu Jia
Modified: 2013-03-18 06:34 UTC (History)
8 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hongxu Jia 2013-03-11 03:25:04 UTC
tree/branch: poky/master
commit d823759b4594143d522eae0b2a2498436a6dcb1e

Test Env:
SUSE Linux Enterprise Desktop 11 SP2  (i586) 
Linux version 3.0.13-0.27-pae (geeko@buildhost) 
(gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux) ) 

*problem
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'
...

*analysis
1, In the following header include map, `-->' 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>
...
and '__u64' is defined in <asm-generic/int-ll64.h>.

2, 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, etc.
The above `<asm/sigcontext.h> --> <linux/types.h>' is prevented.

*resolution
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/
Comment 1 Hongxu Jia 2013-03-18 06:34:06 UTC
Merged into master:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=e609afe4d747059480b406602cab90b7c36a0572

Please verify.