Bug 937 - Adding -feliminate-dwarf2-dups to compiler flags for libnfsidmap causes prelink to segfault
Summary: Adding -feliminate-dwarf2-dups to compiler flags for libnfsidmap causes preli...
Status: RESOLVED FIXED
Alias: None
Product: Cross-prelink
Classification: Yocto Project Subprojects
Component: cross-prelink (show other bugs)
Version: unspecified
Hardware: x86 x86
: Medium normal
Target Milestone: 1.3
Assignee: Mark Hatle
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2011-03-29 05:19 UTC by Richard Purdie
Modified: 2012-08-24 21:39 UTC (History)
4 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 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.