]> code.ossystems Code Review - openembedded-core.git/commitdiff
gcc: Stash the gcc-cross builddir to reuse in libgcc and gcc-runtime
authorKhem Raj <raj.khem@gmail.com>
Fri, 24 Feb 2012 03:07:46 +0000 (19:07 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 26 Apr 2012 13:48:48 +0000 (14:48 +0100)
Currently we stash the libgcc install tree and then reuse that
to populate libgcc recipe later. This mechanism does not work
for gcc 4.7/trunk since now libstdc++ needs access to build tree
of libgcc. This patch stashes the gcc-cross build tree
and then reuses this in libgcc as well as in gcc-runtime
recipe builds.

Now we build libgcc in the libgcc recipe instead of just
using the prebuilt install tree

core-image-minimal build/run tested on all qemu machines

Signed-off-by: Khem Raj <raj.khem@gmail.com>
meta/recipes-devtools/gcc/gcc-configure-runtime.inc
meta/recipes-devtools/gcc/gcc-cross-initial.inc
meta/recipes-devtools/gcc/gcc-package-cross.inc
meta/recipes-devtools/gcc/libgcc_4.6.bb

index 34bfaeb9604c174cae6749f00986aa330e315eee..d2e4ab334b488c70ed120e908e8fa1f3d42f529a 100644 (file)
@@ -16,26 +16,32 @@ RUNTIMETARGET = "libssp libstdc++-v3"
 
 do_configure () {
        export CXX="${CXX} -nostdinc++ -nostdlib++"
-       for d in ${RUNTIMETARGET}; do
+       mtarget=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-nativesdk##`
+       target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+       cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget/* ${B}
+       for d in libgcc ${RUNTIMETARGET}; do
                echo "Configuring $d"
-               mkdir -p ${B}/$d/
-               cd ${B}/$d/
+               rm -rf ${B}/$target/$d/
+               mkdir -p ${B}/$target/$d/
+               cd ${B}/$target/$d/
                chmod a+x ${S}/$d/configure
                ${S}/$d/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
        done
 }
 
 do_compile () {
-       for d in ${RUNTIMETARGET}; do
-               cd ${B}/$d/
-               oe_runmake
+       target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+       for d in libgcc ${RUNTIMETARGET}; do
+               cd ${B}/$target/$d/
+               oe_runmake MULTIBUILDTOP=${B}/$target/$d/
        done
 }
 
 do_install () {
+       target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
        for d in ${RUNTIMETARGET}; do
-               cd ${B}/$d/
-               oe_runmake 'DESTDIR=${D}' install
+               cd ${B}/$target/$d/
+               oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/$d/ install
        done
        chown -R root:root ${D}
 }
@@ -45,4 +51,3 @@ DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc"
 PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
 
 BBCLASSEXTEND = "nativesdk"
-
index f0e7810273ef4a850e549e68b05f853b31071c38..66c47e027c433a516fb142474710f098a99d9486 100644 (file)
@@ -25,5 +25,5 @@ EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \
                ${@get_gcc_fpu_setting(bb, d)}"
 
 do_compile () {
-    oe_runmake
+    oe_runmake all-gcc all-target-libgcc
 }
index e32412c1279f8ce4ee3de0d79f5fec441d163dbf..9718101a3d3a785b31c1701adcfc2e8ec98224e0 100644 (file)
@@ -36,19 +36,7 @@ do_install () {
        case ${PN} in
                *gcc-cross|*gcc-crosssdk)
                        dest=${D}/${includedir}/gcc-build-internal-${MULTIMACH_TARGET_SYS}
-                       oe_runmake "DESTDIR=$dest" libdir=${target_libdir} base_libdir=${target_base_libdir} prefix=${target_prefix} exec_prefix=${target_exec_prefix} install-target-libgcc
-
-                       # Ideally here we'd override the libgcc Makefile's idea of slibdir but
-                       # for now, we just move the files to the correct location
-
-                       install -d $dest${target_base_libdir}
-                       mv $dest${target_exec_prefix}/${TARGET_SYS}/lib*/* $dest${target_base_libdir}
-                       rm -rf $dest${target_exec_prefix}/${TARGET_SYS}
-
-                       # Also need to move gcc from /usr/lib/gcc/* to /usr/lib/ else the search paths won't find the crt*.o files
-
-                       mv $dest${target_libdir}/gcc/* $dest${target_libdir}/
-                       rmdir $dest${target_libdir}/gcc
+                       cp -fpPR . $dest
                ;;
        esac
 }
index 9a8b20d87c5636b179cc08482288dbd906c9d199..9db7243531c6909cc8db7c8351d733b808445d48 100644 (file)
@@ -1,6 +1,7 @@
 require gcc-${PV}.inc
 
 INHIBIT_DEFAULT_DEPS = "1"
+
 DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
 
 PKGSUFFIX = ""
@@ -23,15 +24,26 @@ FILES_libgcov${PKGSUFFIX}-dev = " \
 
 FILES_${PN}-dbg += "${base_libdir}/.debug/"
 
-do_configure[noexec] = "1"
-do_compile[noexec] = "1"
-
-do_install () {
+do_configure () {
        target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-nativesdk##`
-
-       # Install libgcc from our gcc-cross saved data
        install -d ${D}${base_libdir} ${D}${libdir}
-       cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${D}
+       cp -fpPR ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$target/* ${B}
+       mkdir -p ${B}/${PN}
+       cd ${B}/${PN}
+       chmod a+x ${S}/${PN}/configure
+       ${S}/${PN}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+}
+
+do_compile () {
+       target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+       cd ${B}/${PN}
+       oe_runmake MULTIBUILDTOP=${B}/$target/${PN}/
+}
+
+do_install () {
+       target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
+       cd ${B}/${PN}
+       oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${PN}/ install
 
        # Move libgcc_s into /lib
        mkdir -p ${D}${base_libdir}
@@ -41,8 +53,11 @@ do_install () {
                mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true
        fi
 
-       chown -R root:root ${D}
-       chmod +x ${D}${base_libdir}/libgcc_s.so.*
+       # install the runtime in /usr/lib/ not in /usr/lib/gcc on target
+       # so that cross-gcc can find it in the sysroot
+
+       mv ${D}${libdir}/gcc/* ${D}${libdir}
+       rm -rf ${D}${libdir}/gcc/
 }
 
 do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_package"