Skip to contentSkip to conversation

gcc-4.5: Match with OE-Core on building procedure for libgcc and gcc-runtime

PATCH In review Khem Raj 2 participants 6 messages Apr 30, 2012 – May 2, 2012

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/3 gcc-4.5: Match with OE-Core on building procedure for libgcc and gcc-runtime

---
 toolchain-layer/recipes-devtools/gcc/libgcc_4.5.bb |   47 +++++++++++++++-----
 1 files changed, 36 insertions(+), 11 deletions(-)
toolchain-layer/recipes-devtools/gcc/libgcc_4.5.bb +36 -11
index 1579c8b..ecef5e7 100644
@@ -1,33 +1,46 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
 
-
 INHIBIT_DEFAULT_DEPS = "1"
+
 DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
 
 PACKAGES = "\
   ${PN} \
   ${PN}-dev \
+  ${PN}-dbg \
+  libgcov-dev \
   "
 
 FILES_${PN} = "${base_libdir}/libgcc*.so.*"
 FILES_${PN}-dev = " \
   ${base_libdir}/libgcc*.so \
   ${libdir}/${TARGET_SYS}/${BINV}/crt* \
-  ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a \
   ${libdir}/${TARGET_SYS}/${BINV}/libgcc*"
+FILES_libgcov-dev = " \
+  ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a"
 
-do_fetch[noexec] = "1"
-do_unpack[noexec] = "1"
-do_patch[noexec] = "1"
-do_configure[noexec] = "1"
-do_compile[noexec] = "1"
+FILES_${PN}-dbg += "${base_libdir}/.debug/"
 
-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}
@@ -36,7 +49,19 @@ do_install () {
 	else
 		mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true
 	fi
+
+	# 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"
+do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_package"
+do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_package"
+
 BBCLASSEXTEND = "nativesdk"
 
+INSANE_SKIP_libgcc-dev = "staticdev"
+INSANE_SKIP_libgcov-dev = "staticdev"
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH 2/3 gcc-crosssdk-intermediate_4.5.bb: with-headers has been moved from common include

To accomodate gcc 4.7 which needed a different option than --with-header this option setting has been moved into version specific recipes

---
 .../gcc/gcc-crosssdk-intermediate_4.5.bb           |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
toolchain-layer/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.bb +1 -1
index 971f3ba..61a0dfb 100644
@@ -1,3 +1,3 @@
 require recipes-devtools/gcc/gcc-cross-intermediate_${PV}.bb
 require recipes-devtools/gcc/gcc-crosssdk-intermediate.inc
-
+EXTRA_OECONF += " --with-headers=${STAGING_DIR_TCBOOTSTRAP}${SYSTEMHEADERS} "
Signature · 1 line
1.7.5.4
Tested-by on v1 2/3
#2 lore raw

Re: [toolchain-layer][PATCH 2/3] gcc-crosssdk-intermediate_4.5.bb: with-headers has been moved from common include

Quoted 5 lines · Khem Raj

To accomodate gcc 4.7 which needed a different option than --with-header this option setting has been moved into version specific recipes

Quoted 21 lines
---
 .../gcc/gcc-crosssdk-intermediate_4.5.bb           |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
toolchain-layer/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.bb +1 -1
index 971f3ba..61a0dfb 100644
@@ -1,3 +1,3 @@
 require recipes-devtools/gcc/gcc-cross-intermediate_${PV}.bb
 require recipes-devtools/gcc/gcc-crosssdk-intermediate.inc
-
+EXTRA_OECONF += " --with-headers=${STAGING_DIR_TCBOOTSTRAP}${SYSTEMHEADERS} "
Signature · 7 lines
1.7.5.4


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
author
#3 lore raw

PATCH 3/3 libgcc-4.5: Fix nativesdk build problem

In reply to Khem Raj

We need to use BPN instead of PN so we
access libgcc and not libgcc-nativesdk

---
 toolchain-layer/recipes-devtools/gcc/libgcc_4.5.bb |   32 +++++++++++--------
 1 files changed, 18 insertions(+), 14 deletions(-)
toolchain-layer/recipes-devtools/gcc/libgcc_4.5.bb +18 -14
index ecef5e7..3f63931 100644
@@ -4,11 +4,14 @@ INHIBIT_DEFAULT_DEPS = "1"
 
 DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
 
+PKGSUFFIX = ""
+PKGSUFFIX_virtclass-nativesdk = "-nativesdk"
+
 PACKAGES = "\
   ${PN} \
   ${PN}-dev \
   ${PN}-dbg \
-  libgcov-dev \
+  libgcov${PKGSUFFIX}-dev \
   "
 
 FILES_${PN} = "${base_libdir}/libgcc*.so.*"
@@ -16,31 +19,31 @@ FILES_${PN}-dev = " \
   ${base_libdir}/libgcc*.so \
   ${libdir}/${TARGET_SYS}/${BINV}/crt* \
   ${libdir}/${TARGET_SYS}/${BINV}/libgcc*"
-FILES_libgcov-dev = " \
-  ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a"
-
+FILES_libgcov${PKGSUFFIX}-dev = " \
+  ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a \
+  "
 FILES_${PN}-dbg += "${base_libdir}/.debug/"
 
 do_configure () {
 	target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-nativesdk##`
 	install -d ${D}${base_libdir} ${D}${libdir}
 	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}
+	mkdir -p ${B}/${BPN}
+	cd ${B}/${BPN}
+	chmod a+x ${S}/${BPN}/configure
+	${S}/${BPN}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
 }
 
 do_compile () {
 	target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
-	cd ${B}/${PN}
-	oe_runmake MULTIBUILDTOP=${B}/$target/${PN}/
+	cd ${B}/${BPN}
+	oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/
 }
 
 do_install () {
 	target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
-	cd ${B}/${PN}
-	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${PN}/ install
+	cd ${B}/${BPN}
+	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install
 
 	# Move libgcc_s into /lib
 	mkdir -p ${D}${base_libdir}
@@ -63,5 +66,6 @@ do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_package"
 
 BBCLASSEXTEND = "nativesdk"
 
-INSANE_SKIP_libgcc-dev = "staticdev"
-INSANE_SKIP_libgcov-dev = "staticdev"
+INSANE_SKIP_${PN}-dev = "staticdev"
+INSANE_SKIP_libgcov${PKGSUFFIX}-dev = "staticdev"
+
Signature · 1 line
1.7.5.4
Tested-by on v1 3/3
#4 lore raw

Re: [toolchain-layer][PATCH 3/3] libgcc-4.5: Fix nativesdk build problem

Quoted 4 lines · Khem Raj

We need to use BPN instead of PN so we
access libgcc and not libgcc-nativesdk

Quoted 84 lines
---
 toolchain-layer/recipes-devtools/gcc/libgcc_4.5.bb |   32 +++++++++++--------
 1 files changed, 18 insertions(+), 14 deletions(-)
toolchain-layer/recipes-devtools/gcc/libgcc_4.5.bb +18 -14
index ecef5e7..3f63931 100644
@@ -4,11 +4,14 @@ INHIBIT_DEFAULT_DEPS = "1"
 
 DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
 
+PKGSUFFIX = ""
+PKGSUFFIX_virtclass-nativesdk = "-nativesdk"
+
 PACKAGES = "\
   ${PN} \
   ${PN}-dev \
   ${PN}-dbg \
-  libgcov-dev \
+  libgcov${PKGSUFFIX}-dev \
   "
 
 FILES_${PN} = "${base_libdir}/libgcc*.so.*"
@@ -16,31 +19,31 @@ FILES_${PN}-dev = " \
   ${base_libdir}/libgcc*.so \
   ${libdir}/${TARGET_SYS}/${BINV}/crt* \
   ${libdir}/${TARGET_SYS}/${BINV}/libgcc*"
-FILES_libgcov-dev = " \
-  ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a"
-
+FILES_libgcov${PKGSUFFIX}-dev = " \
+  ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a \
+  "
 FILES_${PN}-dbg += "${base_libdir}/.debug/"
 
 do_configure () {
 	target=`echo ${MULTIMACH_TARGET_SYS} | sed -e s#-nativesdk##`
 	install -d ${D}${base_libdir} ${D}${libdir}
 	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}
+	mkdir -p ${B}/${BPN}
+	cd ${B}/${BPN}
+	chmod a+x ${S}/${BPN}/configure
+	${S}/${BPN}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
 }
 
 do_compile () {
 	target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
-	cd ${B}/${PN}
-	oe_runmake MULTIBUILDTOP=${B}/$target/${PN}/
+	cd ${B}/${BPN}
+	oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/
 }
 
 do_install () {
 	target=`echo ${TARGET_SYS} | sed -e s#-nativesdk##`
-	cd ${B}/${PN}
-	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${PN}/ install
+	cd ${B}/${BPN}
+	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install
 
 	# Move libgcc_s into /lib
 	mkdir -p ${D}${base_libdir}
@@ -63,5 +66,6 @@ do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_package"
 
 BBCLASSEXTEND = "nativesdk"
 
-INSANE_SKIP_libgcc-dev = "staticdev"
-INSANE_SKIP_libgcov-dev = "staticdev"
+INSANE_SKIP_${PN}-dev = "staticdev"
+INSANE_SKIP_libgcov${PKGSUFFIX}-dev = "staticdev"
+
Signature · 7 lines
1.7.5.4


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Tested-by on v1 1/3
#5 lore raw
In reply to Khem Raj

Darn it! I wasted too much time today trying to debug this recent breakage in gcc-runtime-4.5, before seeing these patches. It was failing like this:

checking dynamic linker characteristics... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.

Now it works again!

Quoted 1 line
Quoted 94 lines
---
 toolchain-layer/recipes-devtools/gcc/libgcc_4.5.bb |   47 +++++++++++++++-----
 1 files changed, 36 insertions(+), 11 deletions(-)
toolchain-layer/recipes-devtools/gcc/libgcc_4.5.bb +36 -11
index 1579c8b..ecef5e7 100644
@@ -1,33 +1,46 @@
 require recipes-devtools/gcc/gcc-${PV}.inc
 
-
 INHIBIT_DEFAULT_DEPS = "1"
+
 DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
 
 PACKAGES = "\
   ${PN} \
   ${PN}-dev \
+  ${PN}-dbg \
+  libgcov-dev \
   "
 
 FILES_${PN} = "${base_libdir}/libgcc*.so.*"
 FILES_${PN}-dev = " \
   ${base_libdir}/libgcc*.so \
   ${libdir}/${TARGET_SYS}/${BINV}/crt* \
-  ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a \
   ${libdir}/${TARGET_SYS}/${BINV}/libgcc*"
+FILES_libgcov-dev = " \
+  ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a"
 
-do_fetch[noexec] = "1"
-do_unpack[noexec] = "1"
-do_patch[noexec] = "1"
-do_configure[noexec] = "1"
-do_compile[noexec] = "1"
+FILES_${PN}-dbg += "${base_libdir}/.debug/"
 
-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}
@@ -36,7 +49,19 @@ do_install () {
 	else
 		mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true
 	fi
+
+	# 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"
+do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_package"
+do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_package"
+
 BBCLASSEXTEND = "nativesdk"
 
+INSANE_SKIP_libgcc-dev = "staticdev"
+INSANE_SKIP_libgcov-dev = "staticdev"
Signature · 7 lines
1.7.5.4


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel