Bug 581

Summary: blktrace build fails with internal BFD error
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Tom Zanussi <tom.zanussi>
Component: meta-yoctoAssignee: Tom Zanussi <tom.zanussi>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: High CC: ke.yu, kevin.tian, poky.bs.watcher, poky.watcher, richard.purdie, sgw
Version: 1.0   
Target Milestone: 1.0 M3   
Hardware: x86   
OS: x86   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Tom Zanussi 2010-12-09 16:03:11 UTC
Building blktrace for atom-pc sometimes fails with a BFD internal error.  I've also seen this once when building blktrace for crownbay: 

BFD (GNU Binutils) 2.20.1.20100303

i586-poky-linux-gcc -m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/usr/local/src/yocto/p/build/tmp/sysr
oots/atom-poky-linux -fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -ggdb -feliminate-unused-debu
g-types -I. -I.. -I../btt -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -UCOUNT_IOS -UDEBUG -DNDEBUG -o btrep
lay btreplay.o -laio -lrt
/usr/local/src/yocto/p/build/tmp/sysroots/x86_64-linux/usr/libexec/atom-poky-linux/gcc/i586-poky-linux/4.5.1/ld: BFD (GN
U Binutils) 2.20.1.20100303 internal error, aborting at /usr/local/src/yocto/p/build/tmp/work/atom-poky-linux/binutils-c
ross-2.20.1-r3/binutils-2.20.1/bfd/merge.c line 872 in _bfd_merged_section_offset

/usr/local/src/yocto/p/build/tmp/sysroots/x86_64-linux/usr/libexec/atom-poky-linux/gcc/i586-poky-linux/4.5.1/ld: Please 
report this bug.

collect2: ld returned 1 exit status
make[1]: *** [btreplay] Error 1
make[1]: Leaving directory `/usr/local/src/yocto/p/build/tmp/work/atom-poky-linux/blktrace-1.0.1+git0+1e09f6e9012826fca6
9fa07222b7bc53c3e629ee-r0/git/btreplay'
make: *** [btreplay/btrecord] Error 2
Comment 1 Tom Zanussi 2010-12-28 17:20:32 UTC
The other error message that results from this failure is "truncated object file".

I've only seen these problems happening with btrecord.o and btreplay.o.

The problem appears to only happen when using PARALLEL_MAKE, e.g. "-j 8", which causes make to enter the btreplay directory multiple times in parallel and build the object files there multiple times in parallel, which race and occasionally cause later steps to see bogus object files in the process of being written, and thus produce these error messages.

The solution should be to find a way to prevent the parallel make from building in the same directory simultaneously.