gcc/gcc-cross/gcc-cross-intermediate: Generate libgcc_s.so as a linker script stub
authorKhem Raj <raj.khem@gmail.com>
Fri, 10 Dec 2010 00:58:50 +0000 (16:58 -0800)
committerKhem Raj <raj.khem@gmail.com>
Fri, 10 Dec 2010 01:02:42 +0000 (17:02 -0800)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Eric Bénard <eric@eukrea.com>
recipes/gcc/gcc-4.3.3.inc
recipes/gcc/gcc-4.5.inc
recipes/gcc/gcc-configure-sdk.inc
recipes/gcc/gcc-cross-intermediate.inc
recipes/gcc/gcc-package-cross.inc
recipes/gcc/gcc-package-sdk.inc
recipes/gcc/gcc-package-target.inc

index f0e4945..8f81834 100644 (file)
@@ -8,7 +8,7 @@ LICENSE = "GPLv3"
 DEPENDS = "mpfr gmp"
 NATIVEDEPS = "mpfr-native gmp-native"
 
-INC_PR = "r21"
+INC_PR = "r22"
 
 SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2;name=archive \
        file://fedora/gcc43-c++-builtin-redecl.patch;striplevel=0 \
index 9842946..512bc17 100644 (file)
@@ -8,7 +8,7 @@ DEPENDS = "mpfr gmp libmpc libelf"
 NATIVEDEPS = "mpfr-native gmp-native libmpc-native"
 
 
-INC_PR = "r23"
+INC_PR = "r24"
 
 SRCREV = "167449"
 PV = "4.5"
index 6be5d72..d4d61aa 100644 (file)
@@ -28,6 +28,16 @@ export WINDRES_FOR_TARGET = "${TOOLCHAIN_PATH}/${TARGET_SYS}/bin/windres"
 #
 export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET}"
 
+do_configure_prepend (){
+        # Make sure we use GMP/MPFR statically
+        sed -i 's/^\(HOST_GMPLIBS =\) \(.*\)$/\1 -Wl,-Bstatic \2 -Wl,-Bdynamic/' ${S}/Makefile.tpl
+        sed -i 's/^\(HOST_GMPLIBS =\) \(.*\)$/\1 -Wl,-Bstatic \2 -Wl,-Bdynamic/' ${S}/Makefile.in
+        sed -i 's/^\(HOST_PPLLIBS =\) \(.*\)$/\1 -Wl,-Bstatic \2 -Wl,-Bdynamic/' ${S}/Makefile.tpl
+        sed -i 's/^\(HOST_PPLLIBS =\) \(.*\)$/\1 -Wl,-Bstatic \2 -Wl,-Bdynamic/' ${S}/Makefile.in
+        sed -i 's/^\(HOST_LIBELFLIBS =\) \(.*\)$/\1 -Wl,-Bstatic \2 -Wl,-Bdynamic/' ${S}/Makefile.tpl
+        sed -i 's/^\(HOST_LIBELFLIBS =\) \(.*\)$/\1 -Wl,-Bstatic \2 -Wl,-Bdynamic/' ${S}/Makefile.in
+}
+
 do_compile () {
        export CC="${BUILD_CC}"
        export CC_FOR_TARGET="${CCACHE} ${TARGET_SYS}-gcc ${TARGET_CC_ARCH}"
index 2b6b24f..c2ec66d 100644 (file)
@@ -28,6 +28,12 @@ do_install () {
                         mv -f ${D}${prefix}/$d/* ${D}${target_libdir} || true
                 fi
         done
+        rm -f ${D}${target_base_libdir}/libgcc_s.so
+        rm -f ${D}${target_libdir}/libgcc_s.so
+       echo "/* GNU ld script
+   Use the shared library, but some functions are only in
+   the static library.  */
+GROUP ( libgcc_s.so.1 libgcc.a )" > ${D}${target_libdir}/libgcc_s.so
     # If this is important, we should remove the staging package here
        # get rid of dummy libc.so
        #if [ -z "`file ${STAGING_DIR_TARGET}${target_libdir}/libc.so | grep "ASCII C program text"`" ]; then
index 85139a2..f9a7eeb 100644 (file)
@@ -29,6 +29,13 @@ do_install () {
                        mv -f ${D}${prefix}/$d/* ${D}${target_libdir} || true
                fi
        done
+       rm -f ${D}${target_base_libdir}/libgcc_s.so
+       rm -f ${D}${target_libdir}/libgcc_s.so
+       echo "/* GNU ld script
+   Use the shared library, but some functions are only in
+   the static library.  */
+GROUP ( libgcc_s.so.1 libgcc.a )" > ${D}${target_libdir}/libgcc_s.so
+
        # since we are moving the .la files to target sysroot we need to make sure that
        # libdir points to right place within the target sysroot
        for la in ${D}${target_libdir}/libstdc++.la ${D}${target_libdir}/libsupc++.la; do
@@ -45,14 +52,14 @@ do_install () {
                ${TARGET_PREFIX}strip ${D}${target_base_libdir}/libgcc_s.so.* || true
                ${TARGET_PREFIX}strip ${D}${target_libdir}/libgfortran*.so* || true
        fi
-     
+
        # Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77
        # gfortran is fully backwards compatible. This is a safe and practical solution.
        if [ -f ${D}${TOOLCHAIN_PATH}/bin/${TARGET_PREFIX}gfortran ]; then
                currdir="$PWD"
                cd ${D}${TOOLCHAIN_PATH}/bin/
                ln -sf ${TARGET_PREFIX}gfortran ${TARGET_PREFIX}g77 || true
-               if [ -d ${TOOLCHAIN_PATH}/${TARGET_SYS}/bin/ ] ; then 
+               if [ -d ${TOOLCHAIN_PATH}/${TARGET_SYS}/bin/ ] ; then
                        cd ${TOOLCHAIN_PATH}/${TARGET_SYS}/bin/
                        ln -sf gfortran g77 || true
                fi
index 014897a..1b6529f 100644 (file)
@@ -56,9 +56,9 @@ do_install () {
        # the packaging.
        if [ "x${OLD_PACKAGE_STRIP}" != "xno" ]; then
                for soFile in ${D}${prefix}/${TARGET_SYS}/lib/libstdc++.so.* ${D}${prefix}/${TARGET_SYS}/lib/libg2c.so.* ${D}${prefix}/${TARGET_SYS}/lib/libgcc_s.so.*; do
-                       if echo ${soFile} | grep '.py$' ; then 
+                       if echo ${soFile} | grep '.py$' ; then
                                echo "Not stripping .py file ${soFile}"
-                       elif echo ${soFile} | grep '*' ; then 
+                       elif echo ${soFile} | grep '*' ; then
                                echo "Not stripping non-existent mask ${soFile}"
                        else
                                ${TARGET_PREFIX}strip ${soFile}
index d2c9a80..438c314 100644 (file)
@@ -127,11 +127,12 @@ do_install () {
        else
                mv ${D}${libdir}/libgcc_s.so.* ${D}${base_libdir} || true
        fi
-       rm -f ${D}${libdir}/libgcc_s.so || true 
-       ln -sf `echo ${libdir}/gcc/${TARGET_SYS}/${BINV} \
-               | tr -s / \
-               | sed -e 's,^/,,' -e 's,[^/]*,..,g'`/lib/libgcc_s.so.1 \
-               ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/libgcc_s.so
+       rm -f ${D}${libdir}/libgcc_s.so || true
+       rm -f ${D}${base_libdir}/libgcc_s.so || true
+       echo "/* GNU ld script
+   Use the shared library, but some functions are only in
+   the static library.  */
+GROUP ( libgcc_s.so.1 libgcc.a )" > ${D}${libdir}/libgcc_s.so
 
        # We don't need libtool libraries
        rm -f ${D}${libdir}/libg2c.la &>/dev/null || true