[oe-commits] Khem Raj : gcc/gcc-cross/gcc-cross-intermediate: Generate libgcc_s. so as a linker script stub

git version control git at git.openembedded.org
Fri Dec 10 01:03:52 UTC 2010


Module: openembedded.git
Branch: master
Commit: a91b9a2922d5eb61ad89524b5dab7da524ce00bf
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=a91b9a2922d5eb61ad89524b5dab7da524ce00bf

Author: Khem Raj <raj.khem at gmail.com>
Date:   Thu Dec  9 16:58:50 2010 -0800

gcc/gcc-cross/gcc-cross-intermediate: Generate libgcc_s.so as a linker script stub

Signed-off-by: Khem Raj <raj.khem at gmail.com>
Acked-by: Eric Bénard <eric at eukrea.com>

---

 recipes/gcc/gcc-4.3.3.inc              |    2 +-
 recipes/gcc/gcc-4.5.inc                |    2 +-
 recipes/gcc/gcc-configure-sdk.inc      |   10 ++++++++++
 recipes/gcc/gcc-cross-intermediate.inc |    6 ++++++
 recipes/gcc/gcc-package-cross.inc      |   11 +++++++++--
 recipes/gcc/gcc-package-sdk.inc        |    4 ++--
 recipes/gcc/gcc-package-target.inc     |   11 ++++++-----
 7 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/recipes/gcc/gcc-4.3.3.inc b/recipes/gcc/gcc-4.3.3.inc
index f0e4945..8f81834 100644
--- a/recipes/gcc/gcc-4.3.3.inc
+++ b/recipes/gcc/gcc-4.3.3.inc
@@ -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 \
diff --git a/recipes/gcc/gcc-4.5.inc b/recipes/gcc/gcc-4.5.inc
index 9842946..512bc17 100644
--- a/recipes/gcc/gcc-4.5.inc
+++ b/recipes/gcc/gcc-4.5.inc
@@ -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"
diff --git a/recipes/gcc/gcc-configure-sdk.inc b/recipes/gcc/gcc-configure-sdk.inc
index 6be5d72..d4d61aa 100644
--- a/recipes/gcc/gcc-configure-sdk.inc
+++ b/recipes/gcc/gcc-configure-sdk.inc
@@ -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}"
diff --git a/recipes/gcc/gcc-cross-intermediate.inc b/recipes/gcc/gcc-cross-intermediate.inc
index 2b6b24f..c2ec66d 100644
--- a/recipes/gcc/gcc-cross-intermediate.inc
+++ b/recipes/gcc/gcc-cross-intermediate.inc
@@ -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
diff --git a/recipes/gcc/gcc-package-cross.inc b/recipes/gcc/gcc-package-cross.inc
index 85139a2..f9a7eeb 100644
--- a/recipes/gcc/gcc-package-cross.inc
+++ b/recipes/gcc/gcc-package-cross.inc
@@ -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
diff --git a/recipes/gcc/gcc-package-sdk.inc b/recipes/gcc/gcc-package-sdk.inc
index 014897a..1b6529f 100644
--- a/recipes/gcc/gcc-package-sdk.inc
+++ b/recipes/gcc/gcc-package-sdk.inc
@@ -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}
diff --git a/recipes/gcc/gcc-package-target.inc b/recipes/gcc/gcc-package-target.inc
index d2c9a80..438c314 100644
--- a/recipes/gcc/gcc-package-target.inc
+++ b/recipes/gcc/gcc-package-target.inc
@@ -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





More information about the Openembedded-commits mailing list