Bug 937

Summary: Adding -feliminate-dwarf2-dups to compiler flags for libnfsidmap causes prelink to segfault
Product: [Yocto Project Subprojects] Cross-prelink Reporter: Richard Purdie <richard.purdie>
Component: cross-prelinkAssignee: Mark Hatle <mark.hatle>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: jessica.zhang, sgw, yp.cp.watcher, yp.watcher
Version: unspecified   
Target Milestone: 1.3   
Hardware: x86   
OS: x86   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Richard Purdie 2011-03-29 05:19:05 UTC
Adding -feliminate-dwarf2-dups to FULL_OPTIMIZATION which are the flags passed to the compiler and rebuilding libnfsidmap results in a segfault at rootfs construction time of poky-image-sato on qemux86:

 Size before prelinking 323300.
| /media/build2/builds/rptest/b2/tmp/sysroots/x86_64-linux/usr/sbin/prelink: /usr/lib/libnfsidmap.so.0.3.0: Symbol section index outside of section numbers
| /media/build2/builds/rptest/b2/tmp/work/qemux86-poky-linux/poky-image-sato-1.0-r0/temp/run.do_rootfs.17151: line 138: 23698 Segmentation fault      (core dumped) /media/build2/builds/rptest/b2/tmp/sysroots/x86_64-linux/usr/sbin/prelink --root /media/build2/builds/rptest/b2/tmp/work/qemux86-poky-linux/poky-image-sato-1.0-r0/rootfs -amR

This isn't the only binary affected, its just an easy to reproduce test case. It appears prelink has some problem with the -feliminate-dwarf2-dups optimisation flag.
Comment 1 Richard Purdie 2011-03-29 06:28:28 UTC
In master we've dropped the problematic compiler flag for now but we should still figure out this problem...
Comment 2 Mark Hatle 2012-01-03 10:25:49 UTC
Update.  I've not yet reproduced this.  However, since the issue was filed a number of fixes for dwarf2 issues have gone into the prelinker.
Comment 3 Mark Hatle 2012-01-05 12:32:29 UTC
current testing on head of poky indicates an internal compiler error:

/home/mhatle/git/oss/poky/build-test/tmp/work/x86_64-poky-linux/gcc-runtime-4.6.2+svnr181430-r20/gcc-4_6-branch/build.x86_64-poky-linux.x86_64-poky-linux/libstdc++-v3/include/bits/unordered_set.h:398:1: internal compiler error: in build_abbrev_table, at dwarf2out.c:10534

Unable to reproduce this issue due to the ICE...
Comment 4 Mark Hatle 2012-01-05 13:09:21 UTC
-feliminate-dwarf2-dups is "iffy" with the current version of gcc.  It is likely addressed in gcc 4.7.  We need to wait until that has been released/update before work can result on this item.
Comment 5 Mark Hatle 2012-05-08 15:40:07 UTC
Uprev to gcc 4.7 is a prerequisite to this item.

It is expected most of the work is simply validation and that 4.7 will correct the issue.
Comment 6 Mark Hatle 2012-08-24 21:39:45 UTC
It is believed now that we have the new gcc this is fixed, it should be retested.