Bug 2545

Summary: gcc-4.7 build fails on systemtap-sdt-devel installed host
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Jiajun Xu <jiajun.xu>
Component: devtools / tool chainAssignee: Saul Wold <sgw>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: High CC: alexandru.c.georgescu, bogdan.a.marinescu, hongnax.xu, laurentiu.serban, meta.mr.watcher, meta.watcher, ningx.ma, raj.khem, ross.burton, sgw, yilongx.y.sun
Version: unspecified   
Target Milestone: 1.3 M1   
Hardware: x86   
OS: Multiple   
Whiteboard: patch pending in mut
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
do_compile failed for gcc-4.7
none
log for do_configure of gcc-4.7
none
config.log for gcc-4.7/gcc none

Description Jiajun Xu 2012-06-06 01:27:15 UTC
tree/branch: poky/master
commit: 348da93e283b2b8454fd9cde80d4b17378e2a168

With latest commit, gcc-4.7 will report do_compile failure with error that "sys/sdt.h: No such file or directory". The error is caused by that the host system has systemtap-sdt-devel installed and gcc-4.7 find the sys/sdt.h on host during do_configure, but fails to find the header during do_compile.

The error log as below:
########
/distro/m1-full/self-hosted/tmp/work-shared/gcc-4.7.0+svnr186651-r1/gcc-4_7-branch/libgcc/unwind-dw2.c:42:21: fatal error: sys/sdt.h: No such file or directory
compilation terminated.
make[2]: *** [unwind-dw2.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/distro/m1-full/self-hosted/tmp/work/x86_64-poky-linux/gcc-4.7.0+svnr186651-r1/gcc-4_7-branch/build.x86_64-poky-linux.x86_64-poky-linux/x86_64-poky-linux/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/distro/m1-full/self-hosted/tmp/work/x86_64-poky-linux/gcc-4.7.0+svnr186651-r1/gcc-4_7-branch/build.x86_64-poky-linux.x86_64-poky-linux'
make: *** [all] Error 2
ERROR: oe_runmake failed
########
Comment 1 Jiajun Xu 2012-06-06 01:35:45 UTC
Created attachment 560 [details]
do_compile failed for gcc-4.7
Comment 2 Ross Burton 2012-06-12 09:10:18 UTC
Yep, I'm getting this too.
Comment 3 Jiajun Xu 2012-06-12 09:18:36 UTC
There is no sdt.h in target sysroot:
#####
[build@jiajun-desktop build]$ find tmp/sysroots | grep sdt
[build@jiajun-desktop build]$
#####
Comment 4 Jiajun Xu 2012-06-12 09:19:38 UTC
Created attachment 567 [details]
log for do_configure of gcc-4.7
Comment 5 Jiajun Xu 2012-06-12 09:21:09 UTC
Created attachment 568 [details]
config.log for gcc-4.7/gcc
Comment 6 Khem Raj 2012-06-12 13:55:19 UTC
config.log shows

configure:26743: checking sys/sdt.h in the target C library
configure:26752: result: yes

now can you check if you have sdt.h in /usr/include on your build machine ?

Just for checks can you move that header out if its there and then rerun do_configure and send me the config.log ?
Comment 7 Ross Burton 2012-06-12 13:57:21 UTC
I also have that problem. That header file is in /usr/include/sys, and removing it (by removing systemtap-sdt-devel, and the vast amount of perl that ultimately depends on it) fixes the build.
Comment 8 Bogdan Marinescu 2012-06-12 13:58:09 UTC
(In reply to comment #6)
> config.log shows
> 
> configure:26743: checking sys/sdt.h in the target C library
> configure:26752: result: yes
> 
> now can you check if you have sdt.h in /usr/include on your build machine ?
> 
> Just for checks can you move that header out if its there and then rerun
> do_configure and send me the config.log ?

Hi Khem,

This bug only appears if the systemtap-sdt-devel is installed on my Ubuntu x86_64 host. It seems that the configure step always looks for this header in /usr/include, regardless of the target (native or cross). Not sure how to fix this.
Comment 10 Bogdan Marinescu 2012-06-13 08:07:28 UTC
(In reply to comment #9)
> Try this patch
> 
> http://git.openembedded.org/openembedded-core-contrib/commit/?h=kraj/
> misc&id=df9ccc1a7b01ab9730ed3747e6b48f4ecabc822e
> 
> and see if it fixes the issue.

It does, thank you. I'll send the patch to the mailing list.
Comment 12 Laurentiu Serban 2012-06-18 09:37:11 UTC
verified on fedora 17 with package systemtap-sdt-devel-1.7-7.fc17.x86_64 installed