Skip to contentSkip to conversation

gcc-cross-intermediate.inc: Move libgcc from cross dir to target sysroot

PATCH New Khem Raj 1 participant 2 messages Oct 15, 2010

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 gcc-cross-intermediate.inc: Move libgcc from cross dir to target sysroot

shared version of libgcc is also installed by gcc-cross-intermediate which we did not move to staging as a result cross gcc found this libgcc and used it compailing about missing libc.so stuff.

---
 recipes/gcc/gcc-cross-intermediate.inc |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
recipes/gcc/gcc-cross-intermediate.inc +9 -1
index 6dbdb94..2b6b24f 100644
@@ -18,8 +18,16 @@ EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \
 		${@get_gcc_mips_plt_setting(bb, d)}"
 
 do_install () {
-	oe_runmake 'DESTDIR=${D}' install
+        oe_runmake 'DESTDIR=${D}' install
+        install -d ${D}${target_base_libdir}
+        install -d ${D}${target_libdir}
 
+        for d in ${TARGET_SYS}/lib/nof ${TARGET_SYS}/lib64 ${TARGET_SYS}/lib; do
+                if [ -d ${D}${prefix}/$d/ ]; then
+                        mv -f ${D}${prefix}/$d/libgcc* ${D}${target_base_libdir} || true
+                        mv -f ${D}${prefix}/$d/* ${D}${target_libdir} || true
+                fi
+        done
     # 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
Signature · 1 line
1.7.1
author
#1 lore raw

PATCH 2/2 gcc-package-cross.inc: Edit the libdir enties in libstdc++.la and libsupc++.la

We manually move libstdc++ to staging sysroot from default install location where gcc-cross installed it. During this process we have to make sure that .la files are edited to contain proper libdir entry pointing relative to sysroot.

---
 recipes/gcc/gcc-package-cross.inc |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
recipes/gcc/gcc-package-cross.inc +7 -0
index 59e7dde..045c790 100644
@@ -28,6 +28,13 @@ do_install () {
 			mv -f ${D}${prefix}/$d/* ${D}${target_libdir} || true
 		fi
 	done
+	# 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
+		if [ -f $la ]; then
+			sed -i -e "s:^libdir=.*:libdir='${target_libdir}':g;" $la
+		fi
+	done
 
 	# Manually run the target stripper since we won't get it run by
 	# the packaging.
Signature · 1 line
1.7.1