Skip to contentSkip to conversation

External csl toolchain improvements

PATCH In review Christopher Larson 1 participant 9 messages Apr 16, 2012

lore
Share & tools
lore
#0 lore raw

cover External csl toolchain improvements

This cleans up the recipe and simplifies it, fixes up locale handling, silences QA packaging warnings, and includes toolchain version in the metadata checksums for target recipes. Obviously this is intended for after the final release.

The following changes since commit 4e1a8ed1ab7e7bd950e511c79ddfe072cb280a6e:

bitbake.conf: Include abi_version.conf in a early stage (2012-04-16 12:51:50 +0100)

are available in the git repository at:
git://github.com/kergoth/oe-core external-csl-improvements

Christopher Larson (7):
external-csl-toolchain: split out a libstdc++-staticdev package
libc-package: fix handling for 'precompiled' locales csl-versions.inc: capture version in signatures
tcmode-external-csl: use the existing precompiled locale files
external-csl-toolchain: silence .a/.debug QA warnings
external-csl-toolchain: cleanup, simplify, use base_libdir
external-csl-toolchain: update for locale bits

 meta/classes/libc-package.bbclass                |   12 ++--
 meta/conf/distro/include/csl-versions.inc        |    4 +
 meta/conf/distro/include/tcmode-external-csl.inc |    4 +
 meta/recipes-core/meta/external-csl-toolchain.bb |   70 ++++++++++-----------
 4 files changed, 48 insertions(+), 42 deletions(-)
Signature · 1 line
1.7.7
#1 lore raw

PATCH 1/7 external-csl-toolchain: split out a libstdc++-staticdev package

This silences one of the QA warnings.

---
 meta/recipes-core/meta/external-csl-toolchain.bb |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
meta/recipes-core/meta/external-csl-toolchain.bb +4 -4
index 3e820ff..bafa331 100644
@@ -88,7 +88,7 @@ external_toolchain_sysroot_adjust() {
        fi
 }
 
-PACKAGES =+ "libgcc libgcc-dev libstdc++ libstdc++-dev linux-libc-headers linux-libc-headers-dev gdbserver gdbserver-dbg"
+PACKAGES =+ "libgcc libgcc-dev libstdc++ libstdc++-dev libstdc++-staticdev linux-libc-headers linux-libc-headers-dev gdbserver gdbserver-dbg"
 
 INSANE_SKIP_libgcc = "1"
 INSANE_SKIP_libstdc++ = "1"
@@ -111,6 +111,7 @@ PKGV_libgcc = "${CSL_VER_GCC}"
 PKGV_libgcc-dev = "${CSL_VER_GCC}"
 PKGV_libstdc++ = "${CSL_VER_GCC}"
 PKGV_libstdc++-dev = "${CSL_VER_GCC}"
+PKGV_libstdc++-staticdev = "${CSL_VER_GCC}"
 PKGV_linux-libc-headers = "${CSL_VER_KERNEL}"
 PKGV_linux-libc-headers-dev = "${CSL_VER_KERNEL}"
 PKGV_gdbserver = "${CSL_VER_GDB}"
@@ -122,9 +123,8 @@ FILES_libstdc++ = "${libdir}/libstdc++.so.*"
 FILES_libstdc++-dev = "${includedir}/c++/${PV} \
 	${libdir}/libstdc++.so \
 	${libdir}/libstdc++.la \
-	${libdir}/libstdc++.a \
-	${libdir}/libsupc++.la \
-	${libdir}/libsupc++.a"
+	${libdir}/libsupc++.la"
+FILES_libstdc++-staticdev = "${libdir}/libstdc++.a ${libdir}/libsupc++.a"
 FILES_linux-libc-headers = "${includedir}/asm* \
 	${includedir}/linux \
 	${includedir}/mtd \
Signature · 1 line
1.7.7
#2 lore raw

PATCH 2/7 libc-package: fix handling for 'precompiled' locales

Due to how the 'supported' locales were being generated (added ' ' twice for locales with '.' in them), one could end up with the locale-base packages in your PACKAGES twice, causing packaging problems with eglibc-locale.

---
 meta/classes/libc-package.bbclass |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
meta/classes/libc-package.bbclass +7 -5
index bb4ba68..65feae2 100644
@@ -221,11 +221,13 @@ python package_do_split_gconvs () {
 		supported = []
 		full_bin_path = d.getVar('PKGD', True) + binary_locales_dir
 		for dir in os.listdir(full_bin_path):
-			dbase = dir.split(".")
-			d2 = "  "
-			if len(dbase) > 1:
-				d2 = "." + dbase[1].upper() + "  "
-			supported.append(dbase[0] + d2)
+			elements = dir.split('.', 1)
+			locale = elements[0]
+			if len(elements) > 1:
+				charset = elements[1]
+			else:
+				charset = ''
+			supported.append('%s %s\n' % (locale, charset))
 
 	# Collate the locales by base and encoding
 	utf8_only = int(d.getVar('LOCALE_UTF8_ONLY', True) or 0)
Signature · 1 line
1.7.7
#4 lore raw

PATCH 4/7 tcmode-external-csl: use the existing precompiled locale files

In reply to Christopher Larson
---
 meta/conf/distro/include/tcmode-external-csl.inc |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
meta/conf/distro/include/tcmode-external-csl.inc +4 -0
index 1fc366c..3b54e35 100644
@@ -35,6 +35,10 @@ PREFERRED_PROVIDER_virtual/libiconv = "external-csl-toolchain"
 PREFERRED_PROVIDER_glibc-thread-db = "external-csl-toolchain"
 PREFERRED_PROVIDER_virtual/linux-libc-headers = "external-csl-toolchain"
 
+# No need to re-compile the locale files
+GLIBC_INTERNAL_USE_BINARY_LOCALE = "precompiled"
+ENABLE_BINARY_LOCALE_GENERATION = ""
+
 TARGET_CPPFLAGS_prepend = " -isystem${EXTERNAL_TOOLCHAIN}/${TARGET_SYS}/include "
 TARGET_LDFLAGS_prepend = " -L${EXTERNAL_TOOLCHAIN}/${TARGET_SYS}/lib -Wl,-rpath-link,${EXTERNAL_TOOLCHAIN}/${TARGET_SYS}/lib "
 
Signature · 1 line
1.7.7
#3 lore raw

PATCH 3/7 csl-versions.inc: capture version in signatures

In reply to Christopher Larson

We want to ensure that changing external toolchain version will change the metadata checksums of target recipes. This will do so via ensuring that any variable which references TOOLCHAIN_OPTIONS also pulls in the toolchain version variables.

---
 meta/conf/distro/include/csl-versions.inc |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
meta/conf/distro/include/csl-versions.inc +4 -0
index 6b8b2c5..ec7a6ba 100644
@@ -103,3 +103,7 @@ python csl_version_handler () {
     d.setVar('CSL_VER_GDB', csl_get_gdb_version(ld))
 }
 addhandler csl_version_handler
+
+# Ensure that any variable which includes the --sysroot (CC, CXX, etc) also
+# depends on the toolchain version
+TOOLCHAIN_OPTIONS[vardeps] += "CSL_VER_MAIN CSL_VER_GCC"
Signature · 1 line
1.7.7
#5 lore raw

PATCH 5/7 external-csl-toolchain: silence .a/.debug QA warnings

In reply to Christopher Larson
---
 meta/recipes-core/meta/external-csl-toolchain.bb |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
meta/recipes-core/meta/external-csl-toolchain.bb +2 -3
index bafa331..fb553ab 100644
@@ -90,9 +90,8 @@ external_toolchain_sysroot_adjust() {
 
 PACKAGES =+ "libgcc libgcc-dev libstdc++ libstdc++-dev libstdc++-staticdev linux-libc-headers linux-libc-headers-dev gdbserver gdbserver-dbg"
 
-INSANE_SKIP_libgcc = "1"
-INSANE_SKIP_libstdc++ = "1"
-INSANE_SKIP_gdbserver = "1"
+# This test should be fixed to ignore .a files in .debug dirs
+INSANE_SKIP_${PN}-dbg = "staticdev"
 
 PKG_${PN} = "eglibc"
 PKG_${PN}-dev = "eglibc-dev"
Signature · 1 line
1.7.7
#6 lore raw

PATCH 6/7 external-csl-toolchain: cleanup, simplify, use base_libdir

In reply to Christopher Larson
---
 meta/recipes-core/meta/external-csl-toolchain.bb |   51 +++++++++++----------
 1 files changed, 27 insertions(+), 24 deletions(-)
meta/recipes-core/meta/external-csl-toolchain.bb +27 -24
index fb553ab..8798541 100644
@@ -24,36 +24,40 @@ PROVIDES += "\
 	virtual/linux-libc-headers \
 "
 PV = "${CSL_VER_MAIN}"
-PR = "r3"
+PR = "r4"
 
 #SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/${CSL_TARGET_SYS}/arm-${PV}-${TARGET_PREFIX}i686-pc-linux-gnu.tar.bz2"
 
 SRC_URI = "file://SUPPORTED"
 
 do_install() {
-	install -d ${D}${sysconfdir} ${D}${bindir} ${D}${sbindir} ${D}${base_bindir} ${D}${libdir}
-	install -d ${D}${base_libdir} ${D}${base_sbindir} ${D}${datadir} ${D}/usr
+	# Use optimized files if available
+	sysroot="${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc"
+	if [ -d $sysroot/${CSL_TARGET_CORE} ]; then
+		sysroot="$sysroot/${CSL_TARGET_CORE}"
+	fi
+
+	cp -a $sysroot${base_libdir}/. ${D}${base_libdir}
+	cp -a $sysroot/etc/. ${D}${sysconfdir}
+	cp -a $sysroot/sbin/. ${D}${base_sbindir}
 
-	if [ -d ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE} ]; then
-		cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/lib/.  ${D}${base_libdir}
-		cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/etc/.  ${D}${sysconfdir}
-		cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/sbin/. ${D}${base_sbindir}
-		if [ ! -e ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/usr/include ]; then
-			cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/usr/include  ${D}/usr/
+	install -d ${D}/usr
+	for usr_element in bin include libexec sbin share ${base_libdir}; do
+		usr_path=$sysroot/usr/$usr_element
+		cp -a $usr_path ${D}/usr/
+	done
+	for datadir_element in man info; do
+		datadir_path=$sysroot/usr/$datadir_element
+		if [ -e $datadir_path ]; then
+			cp -a $datadir_path ${D}${datadir}/
 		fi
-		cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/${CSL_TARGET_CORE}/usr/.  ${D}/usr/
-	else
-		cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/lib/.  ${D}${base_libdir}
-		cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/etc/.  ${D}${sysconfdir}
-		cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/sbin/. ${D}${base_sbindir}
-		cp -a ${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc/usr/.  ${D}/usr/
-	fi
+	done
 
-	if [ -e ${D}${prefix}/info ]; then
-		mv ${D}${prefix}/info ${D}${infodir}
-	fi
-	if [ -e ${D}${prefix}/man ]; then
-		mv ${D}${prefix}/man ${D}${mandir}
+	# Some toolchains have headers under the core specific area
+	if [ -e $sysroot/usr/include ]; then
+		cp -a $sysroot/usr/include/. ${D}${includedir}
+	else
+		cp -a $sysroot/../usr/include/. ${D}${includedir}
 	fi
 
 	rm ${D}${sysconfdir}/rpc
@@ -61,14 +65,13 @@ do_install() {
 
 	mv ${D}${libdir}/bin/* ${D}${bindir}/
 	if [ -e ${D}${libdir}/bin/.debug ]; then
-		install -d ${D}${bindir}/.debug
 		mv ${D}${libdir}/bin/.debug/* ${D}${bindir}/.debug/
 	fi
 	ln -s ../../bin/gdbserver ${D}${libdir}/bin/sysroot-gdbserver
 
 	sed -i -e 's/__packed/__attribute__ ((packed))/' ${D}${includedir}/mtd/ubi-user.h
-	sed -i -e "s# /lib# ../../lib#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libc.so
-	sed -i -e "s# /lib# ../../lib#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libpthread.so
+        sed -i -e "s# ${base_libdir}# ../..${base_libdir}#g" -e "s# ${libdir}# .#g" ${D}${libdir}/libc.so
+        sed -i -e "s# ${base_libdir}# ../..${base_libdir}#g" -e "s# ${libdir}# .#g" ${D}${libdir}/libpthread.so
 }
 
 do_install_locale_append () {
Signature · 1 line
1.7.7
#7 lore raw

PATCH 7/7 external-csl-toolchain: update for locale bits

In reply to Christopher Larson

- drop SUPPORTED, as it's only used for locale generation, and we now use the precompiled locale files from the external toolchain
- stop rm -r'ing locale files from do_install_locale, as it's not needed

---
 meta/recipes-core/meta/external-csl-toolchain.bb |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
meta/recipes-core/meta/external-csl-toolchain.bb +1 -7
index 8798541..6ddabf7 100644
@@ -24,12 +24,10 @@ PROVIDES += "\
 	virtual/linux-libc-headers \
 "
 PV = "${CSL_VER_MAIN}"
-PR = "r4"
+PR = "r5"
 
 #SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/${CSL_TARGET_SYS}/arm-${PV}-${TARGET_PREFIX}i686-pc-linux-gnu.tar.bz2"
 
-SRC_URI = "file://SUPPORTED"
-
 do_install() {
 	# Use optimized files if available
 	sysroot="${EXTERNAL_TOOLCHAIN}/${CSL_TARGET_SYS}/libc"
@@ -74,10 +72,6 @@ do_install() {
         sed -i -e "s# ${base_libdir}# ../..${base_libdir}#g" -e "s# ${libdir}# .#g" ${D}${libdir}/libpthread.so
 }
 
-do_install_locale_append () {
-	rm -r ${D}${datadir}/locale ${D}${libdir}/locale
-}
-
 SYSROOT_PREPROCESS_FUNCS += "external_toolchain_sysroot_adjust"
 external_toolchain_sysroot_adjust() {
        if [ -n "${CSL_TARGET_CORE}" ]; then
Signature · 1 line
1.7.7
#8 lore raw
In reply to Christopher Larson
Quoted 11 lines · Christopher Larson

This cleans up the recipe and simplifies it, fixes up locale handling, silences QA packaging warnings, and includes toolchain version in the metadata checksums for target recipes. Obviously this is intended for after the final release.

The following changes since commit 4e1a8ed1ab7e7bd950e511c79ddfe072cb280a6e:

 bitbake.conf: Include abi_version.conf in a early stage (2012-04-16 12:51:50 +0100)

are available in the git repository at:
 git://github.com/kergoth/oe-core external-csl-improvements

Ignore this one, a v2 is on the way with another commit to fix the SUPPORTED handling.

Signature · 1 line
Christopher Larson