summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-01-25 00:34:09 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-01-25 12:25:45 +0000
commitc0e1272d1526484f1921f3dd14ca042798d530d9 (patch)
treee29de33c2cb3edf5c1c43bd772a4c98a77ec36a4 /meta/recipes-core
parent23cb814b2761cbe42f1f76e66abb61d8d4584c54 (diff)
downloadpoky-c0e1272d1526484f1921f3dd14ca042798d530d9.tar.gz
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.inc7
-rw-r--r--meta/recipes-core/eglibc/eglibc.inc15
-rw-r--r--meta/recipes-core/glibc/glibc-initial.inc7
-rw-r--r--meta/recipes-core/glibc/glibc.inc15
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 cb50e89226..ce85d99096 100644
--- a/meta/recipes-core/eglibc/eglibc-initial.inc
+++ b/meta/recipes-core/eglibc/eglibc-initial.inc
@@ -45,8 +45,15 @@ do_install () {
45 install -m 644 csu/crt[1in].o ${D}${libdir} 45 install -m 644 csu/crt[1in].o ${D}${libdir}
46 ${CC} -nostdlib -nostartfiles -shared -x c /dev/null \ 46 ${CC} -nostdlib -nostartfiles -shared -x c /dev/null \
47 -o ${D}${libdir}/libc.so 47 -o ${D}${libdir}/libc.so
48
49 # add links to linux-libc-headers: gcc-{cross,crossdk}-intermediate need this.
50 for t in linux asm asm-generic; do
51 ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
52 done
48} 53}
49 54
50do_siteconfig () { 55do_siteconfig () {
51 : 56 :
52} 57}
58
59do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}"
diff --git a/meta/recipes-core/eglibc/eglibc.inc b/meta/recipes-core/eglibc/eglibc.inc
index 63c313ca48..8314cb1548 100644
--- a/meta/recipes-core/eglibc/eglibc.inc
+++ b/meta/recipes-core/eglibc/eglibc.inc
@@ -4,6 +4,21 @@ STAGINGCC = "gcc-cross-intermediate"
4STAGINGCC_virtclass-nativesdk = "gcc-crosssdk-intermediate" 4STAGINGCC_virtclass-nativesdk = "gcc-crosssdk-intermediate"
5PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:" 5PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
6 6
7TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
8
9# siteconfig.bbclass runs configure which needs a working compiler
10# For the compiler to work we need a working libc yet libc isn't
11# in the sysroots directory at this point. This means the libc.so
12# linker script won't work as the --sysroot setting isn't correct.
13# Here we create a hacked up libc linker script and pass in the right
14# flags to let configure work. Ugly.
15EXTRASITECONFIG = "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}'"
16siteconfig_do_siteconfig_gencache_prepend = " \
17 mkdir -p ${WORKDIR}/site_config_libc; \
18 cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
19 sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
20"
21
7# nptl needs unwind support in gcc, which can't be built without glibc. 22# nptl needs unwind support in gcc, which can't be built without glibc.
8DEPENDS = "virtual/${TARGET_PREFIX}gcc-intermediate linux-libc-headers" 23DEPENDS = "virtual/${TARGET_PREFIX}gcc-intermediate linux-libc-headers"
9#this leads to circular deps, so lets not add it yet 24#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 99aa05fab7..3745955f60 100644
--- a/meta/recipes-core/glibc/glibc-initial.inc
+++ b/meta/recipes-core/glibc/glibc-initial.inc
@@ -53,8 +53,15 @@ do_install () {
53 install -m 644 csu/crt[1in].o ${D}${libdir} 53 install -m 644 csu/crt[1in].o ${D}${libdir}
54 ${CC} -nostdlib -nostartfiles -shared -x c /dev/null \ 54 ${CC} -nostdlib -nostartfiles -shared -x c /dev/null \
55 -o ${D}${libdir}/libc.so 55 -o ${D}${libdir}/libc.so
56
57 # add links to linux-libc-headers: gcc-{cross,crossdk}-intermediate need this.
58 for t in linux asm asm-generic; do
59 ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
60 done
56} 61}
57 62
58do_siteconfig () { 63do_siteconfig () {
59 : 64 :
60} 65}
66
67do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}"
diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
index cdfa06de90..127ae231d7 100644
--- a/meta/recipes-core/glibc/glibc.inc
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -21,6 +21,21 @@ STAGINGCC = "gcc-cross-intermediate"
21STAGINGCC_virtclass-nativesdk = "gcc-crosssdk-intermediate" 21STAGINGCC_virtclass-nativesdk = "gcc-crosssdk-intermediate"
22PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:" 22PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
23 23
24TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
25
26# siteconfig.bbclass runs configure which needs a working compiler
27# For the compiler to work we need a working libc yet libc isn't
28# in the sysroots directory at this point. This means the libc.so
29# linker script won't work as the --sysroot setting isn't correct.
30# Here we create a hacked up libc linker script and pass in the right
31# flags to let configure work. Ugly.
32EXTRASITECONFIG = "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}'"
33siteconfig_do_siteconfig_gencache_prepend = " \
34 mkdir -p ${WORKDIR}/site_config_libc; \
35 cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
36 sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
37"
38
24inherit autotools 39inherit autotools
25 40
26GLIBC_EXTRA_OECONF ?= "" 41GLIBC_EXTRA_OECONF ?= ""