diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-25 00:34:09 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-25 12:25:45 +0000 |
commit | c0e1272d1526484f1921f3dd14ca042798d530d9 (patch) | |
tree | e29de33c2cb3edf5c1c43bd772a4c98a77ec36a4 /meta/recipes-core | |
parent | 23cb814b2761cbe42f1f76e66abb61d8d4584c54 (diff) | |
download | openembedded-core-c0e1272d1526484f1921f3dd14ca042798d530d9.tar.gz openembedded-core-c0e1272d1526484f1921f3dd14ca042798d530d9.tar.bz2 openembedded-core-c0e1272d1526484f1921f3dd14ca042798d530d9.tar.xz openembedded-core-c0e1272d1526484f1921f3dd14ca042798d530d9.zip |
gcc/libc: Change bootstrap to use an intermediate sysroot and hence no longer overwrite files
Based upon patches from Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/eglibc/eglibc-initial.inc | 7 | ||||
-rw-r--r-- | meta/recipes-core/eglibc/eglibc.inc | 15 | ||||
-rw-r--r-- | meta/recipes-core/glibc/glibc-initial.inc | 7 | ||||
-rw-r--r-- | meta/recipes-core/glibc/glibc.inc | 15 |
4 files changed, 44 insertions, 0 deletions
diff --git a/meta/recipes-core/eglibc/eglibc-initial.inc b/meta/recipes-core/eglibc/eglibc-initial.inc index cb50e8922..ce85d9909 100644 --- a/meta/recipes-core/eglibc/eglibc-initial.inc +++ b/meta/recipes-core/eglibc/eglibc-initial.inc @@ -45,8 +45,15 @@ do_install () { install -m 644 csu/crt[1in].o ${D}${libdir} ${CC} -nostdlib -nostartfiles -shared -x c /dev/null \ -o ${D}${libdir}/libc.so + + # add links to linux-libc-headers: gcc-{cross,crossdk}-intermediate need this. + for t in linux asm asm-generic; do + ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/ + done } do_siteconfig () { : } + +do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}" diff --git a/meta/recipes-core/eglibc/eglibc.inc b/meta/recipes-core/eglibc/eglibc.inc index 63c313ca4..8314cb154 100644 --- a/meta/recipes-core/eglibc/eglibc.inc +++ b/meta/recipes-core/eglibc/eglibc.inc @@ -4,6 +4,21 @@ STAGINGCC = "gcc-cross-intermediate" STAGINGCC_virtclass-nativesdk = "gcc-crosssdk-intermediate" PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:" +TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}" + +# siteconfig.bbclass runs configure which needs a working compiler +# For the compiler to work we need a working libc yet libc isn't +# in the sysroots directory at this point. This means the libc.so +# linker script won't work as the --sysroot setting isn't correct. +# Here we create a hacked up libc linker script and pass in the right +# flags to let configure work. Ugly. +EXTRASITECONFIG = "CFLAGS='${CFLAGS} -Wl,-L${WORKDIR}/site_config_libc -L${WORKDIR}/site_config_libc -L${SYSROOT_DESTDIR}${libdir} -L${SYSROOT_DESTDIR}${base_libdir} -Wl,-L${SYSROOT_DESTDIR}${libdir} -Wl,-L${SYSROOT_DESTDIR}${base_libdir}'" +siteconfig_do_siteconfig_gencache_prepend = " \ + mkdir -p ${WORKDIR}/site_config_libc; \ + cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \ + sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \ +" + # nptl needs unwind support in gcc, which can't be built without glibc. DEPENDS = "virtual/${TARGET_PREFIX}gcc-intermediate linux-libc-headers" #this leads to circular deps, so lets not add it yet diff --git a/meta/recipes-core/glibc/glibc-initial.inc b/meta/recipes-core/glibc/glibc-initial.inc index 99aa05fab..3745955f6 100644 --- a/meta/recipes-core/glibc/glibc-initial.inc +++ b/meta/recipes-core/glibc/glibc-initial.inc @@ -53,8 +53,15 @@ do_install () { install -m 644 csu/crt[1in].o ${D}${libdir} ${CC} -nostdlib -nostartfiles -shared -x c /dev/null \ -o ${D}${libdir}/libc.so + + # add links to linux-libc-headers: gcc-{cross,crossdk}-intermediate need this. + for t in linux asm asm-generic; do + ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/ + done } do_siteconfig () { : } + +do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}" diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc index cdfa06de9..127ae231d 100644 --- a/meta/recipes-core/glibc/glibc.inc +++ b/meta/recipes-core/glibc/glibc.inc @@ -21,6 +21,21 @@ STAGINGCC = "gcc-cross-intermediate" STAGINGCC_virtclass-nativesdk = "gcc-crosssdk-intermediate" PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:" +TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}" + +# siteconfig.bbclass runs configure which needs a working compiler +# For the compiler to work we need a working libc yet libc isn't +# in the sysroots directory at this point. This means the libc.so +# linker script won't work as the --sysroot setting isn't correct. +# Here we create a hacked up libc linker script and pass in the right +# flags to let configure work. Ugly. +EXTRASITECONFIG = "CFLAGS='${CFLAGS} -Wl,-L${WORKDIR}/site_config_libc -L${WORKDIR}/site_config_libc -L${SYSROOT_DESTDIR}${libdir} -L${SYSROOT_DESTDIR}${base_libdir} -Wl,-L${SYSROOT_DESTDIR}${libdir} -Wl,-L${SYSROOT_DESTDIR}${base_libdir}'" +siteconfig_do_siteconfig_gencache_prepend = " \ + mkdir -p ${WORKDIR}/site_config_libc; \ + cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \ + sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \ +" + inherit autotools GLIBC_EXTRA_OECONF ?= "" |