Bug 2937

Summary: gold taints sstate, can't rebuild
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ross Burton <ross.burton>
Component: coreAssignee: Khem Raj <raj.khem>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: Medium CC: bluelightning, jessica.zhang, meta.mr.watcher, meta.watcher, richard.purdie
Version: 1.3   
Target Milestone: 1.7   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2012-08-13 11:11:52 UTC
From a clean poky checkout, turn on the gold linker in local.conf:

DISTRO_FEATURES_append = " ld-is-gold"

Then bitbake core-image-minimal.  This works.

Decide that gold isn't for you after all.  Remove that line from local.conf, wipe tmp/ and do another bitbake.  As I understand it this should at least rebuild binutils.  But:

| checking for i586-poky-linux-readelf... i586-poky-linux-readelf
| checking for i586-poky-linux-nm... /home/ross/Yocto/poky-gold/build/tmp/sysroots/x86_64-linux/usr/libexec/i586-poky-linux.gcc-cross-intermediate/gcc/i586-poky-linux/4.7.2/nm
| checking for autoconf... autoconf
| checking whether autoconf works... yes
| configure: error:
| *** These critical programs are missing or too old: ld
| *** Check the INSTALL file for required versions.
| Configure failed. The contents of all config.log files follows to aid debugging
| ERROR: oe_runconf failed
| ERROR: Function failed: do_configure (see /home/ross/Yocto/poky-gold/build/tmp/work/i586-poky-linux/eglibc-2.16-r5+svnr19383/temp/log.do_configure.5280 for further information)
ERROR: Task 31 (/home/ross/Yocto/poky-gold/meta/recipes-core/eglibc/eglibc_2.16.bb, do_configure) failed with exit code '1'

eglibc fails to configure because the ld it finds is too "old".


$ /home/ross/Yocto/poky-gold/build/tmp/sysroots/x86_64-linux/usr/libexec/i586-poky-linux.gcc-cross-intermediate/gcc/i586-poky-linux/4.7.2/ld  --version
GNU gold (GNU Binutils 2.22) 1.11

Oh look, gold.

I guess this is really two bugs
- the intermediate binutils wasn't rebuilt
- eglibc fails when the intermediate ld is gold

But I'll leave this for people who know more about the build system to triage.
Comment 1 Paul Eggleton 2013-12-13 17:56:08 UTC
With latest master, it seems eglibc no longer gets rebuilt under these circumstances and thus you don't get the error; I'm not sure if that's the right thing or not; forcing a configure of eglibc after the fact succeeds though. We no longer have gcc-cross-intermediate of course, but gcc-cross *does* get rebuilt, FWIW.

I'm not sure where that leaves us. Khem / Ross, any suggestions?
Comment 2 Khem Raj 2014-02-26 20:52:50 UTC
I think this commit 

commit 542609b968f0dc6f56cc9d6aabe4ff0144041261
Author: Khem Raj <raj.khem@gmail.com>
Date:   Sun Feb 16 19:48:16 2014 +0000

    binutils: ld-is-gold should not affect native and crosssdk recipes


should help this case a bit too. Do we still see this issue with latest master ?
Comment 3 Richard Purdie 2014-05-03 19:30:08 UTC
I just restested this with master and it rebuilds everything it should and seems to work fine as far as I can tell.