Bug 2519 - mklibs: Does not work with compiler from sstate cache
Summary: mklibs: Does not work with compiler from sstate cache
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: Future
Assignee: Mark Hatle
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2012-05-29 19:49 UTC by Mark Hatle
Modified: 2014-05-03 17:58 UTC (History)
10 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hatle 2012-05-29 19:49:00 UTC
When using the sstate cache, mklibs fails.  Steps to reproduce:

. ./oe-init-build-env o1
Use the sstate-cache directory of ${TOPDIR}/../sstate-cache
build an image (core-image-minimal is fine)

cd ..
rm -rf o1

. ./oe-init-build-env o2
Use the same configuration as before and enable mklibs:
Enable mklibs in local.conf: MKLIBS_OPTIMIZED_IMAGES ?= "all"
build an image (same as before)

You should get an error:


| reducing libutil.so.1
| Command failed with status 1 : i586-wrs-linux-gcc -nostdlib -nostartfiles -shared -Wl,-soname=libutil.so.1 -uopenpty -o /space/jw/5/o2/bitbake_build/tmp/work/common_pc-wrs-linux/wrlinux-image-glibc-small-1.0-r0/mklibs/dest/libutil.so.1-so /space/jw/5/o2/bitbake_build/tmp/sysroots/common-pc/usr/lib//libutil_pic.a -Wl,--version-script=/space/jw/5/o2/bitbake_build/tmp/sysroots/common-pc/usr/lib//libutil_pic.map -lgcc -L/space/jw/5/o2/bitbake_build/tmp/work/common_pc-wrs-linux/wrlinux-image-glibc-small-1.0-r0/mklibs/dest -L/space/jw/5/o2/bitbake_build/tmp/sysroots/common-pc/usr/X11R6/lib/ -lc
| With output:
| ERROR: Function failed: do_rootfs (see /space/jw/5/o2/bitbake_build/tmp/work/common_pc-wrs-linux/wrlinux-image-glibc-small-1.0-r0/temp/log.do_rootfs.15750 for further information)
Comment 1 Saul Wold 2012-08-22 01:02:31 UTC
So I dug into this and it seems that gcc has internally cached the sysroot from the prior build, so when mklibs calls gcc with no --sysroot set, it defaults to the one from the o1 build and fails.  If I changed change the call to mklibs scripts to include a --gcc-options with --sysroot=o2/..., then it works correctly since the --sysroot option is passed on to gcc via mklibs.

At this point, I think its a mklibs.bbclass or a mklib (the script_ bug that it does not pass --sysroot on the --gcc-options or use the --sysroot that is set on the mklibs to pass on to gcc, I am not sure.
Comment 2 Mark Hatle 2012-08-22 01:40:00 UTC
A patch to master has already been incorporated that should fix this:

oe-core: d2cd2ccea8bc4d110647ba3bd202772e5407000a
Comment 3 Saul Wold 2012-08-22 14:35:09 UTC
Nope, I just tested this yesterday and this issue still exists, that might have solved a different issue, but not this particular one.
Comment 4 Nicolas Dechesne 2013-11-22 22:43:08 UTC
i have been debugging this issue today, and came up with the same conclusion as Saul. I have submitted the following patch

http://lists.openembedded.org/pipermail/openembedded-core/2013-November/086887.html

I could verify it solved the problem on my setup.

the patch applies to dylan, dora and master (i haven't tried older release). Since it's a bug, i hope we can get it merged on dylan and dora since i am using both for products.
Comment 5 Khem Raj 2013-11-23 02:17:49 UTC
(In reply to comment #4)
> i have been debugging this issue today, and came up with the same conclusion
> as Saul. I have submitted the following patch
> 
> http://lists.openembedded.org/pipermail/openembedded-core/2013-November/
> 086887.html

This patch look ok to me.

> 
> I could verify it solved the problem on my setup.
> 
> the patch applies to dylan, dora and master (i haven't tried older release).
> Since it's a bug, i hope we can get it merged on dylan and dora since i am
> using both for products.