From 04461e52055ff755920a64c2cde36bf662a1dd57 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Mon, 29 Oct 2012 17:44:22 -0700 Subject: [PATCH 1/5] tcmode: don't ship a toolchain in the sdk for now Long term, may want to add the ability to ship the cross-canadian content from the external toolchain. Signed-off-by: Christopher Larson --- conf/distro/include/tcmode-external-sourcery.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/conf/distro/include/tcmode-external-sourcery.inc b/conf/distro/include/tcmode-external-sourcery.inc index 43e4bc5..12215bf 100644 --- a/conf/distro/include/tcmode-external-sourcery.inc +++ b/conf/distro/include/tcmode-external-sourcery.inc @@ -12,6 +12,9 @@ python () { d.setVar('TOOLCHAIN_PATH_ADD', '') } +# Don't ship any toolchain binaries in the sdk for the time being +TOOLCHAIN_HOST_TASK ?= "nativesdk-packagegroup-sdk-host meta-environment-${TRANSLATED_TARGET_ARCH}" + localedir = "${exec_prefix}/lib/locale" CSL_TARGET_SYS_powerpc ?= "powerpc-linux-gnu powerpc-mentor-linux-gnu" From f367734c1c07db36d0a17a4d0bc7093b7ed7ee66 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Tue, 30 Oct 2012 07:48:35 -0700 Subject: [PATCH 2/5] tcmode: use the class override for PATH add This ensures that we aren't modifying the PATH for nativesdk/cross/crosssdk. Signed-off-by: Christopher Larson --- conf/distro/include/tcmode-external-sourcery.inc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/conf/distro/include/tcmode-external-sourcery.inc b/conf/distro/include/tcmode-external-sourcery.inc index 12215bf..c3fb3c7 100644 --- a/conf/distro/include/tcmode-external-sourcery.inc +++ b/conf/distro/include/tcmode-external-sourcery.inc @@ -4,14 +4,10 @@ EXTERNAL_TOOLCHAIN ?= "UNDEFINED" -TOOLCHAIN_PATH_ADD = "${EXTERNAL_TOOLCHAIN}/bin:" +TOOLCHAIN_PATH_ADD = "" +TOOLCHAIN_PATH_ADD_class-target = "${EXTERNAL_TOOLCHAIN}/bin:" PATH =. "${TOOLCHAIN_PATH_ADD}" -python () { - if oe.utils.inherits(d, 'native'): - d.setVar('TOOLCHAIN_PATH_ADD', '') -} - # Don't ship any toolchain binaries in the sdk for the time being TOOLCHAIN_HOST_TASK ?= "nativesdk-packagegroup-sdk-host meta-environment-${TRANSLATED_TARGET_ARCH}" @@ -118,7 +114,7 @@ python toolchain_metadata_setup () { bb.fatal("Error: EXTERNAL_TOOLCHAIN path '%s' does not exist" % external_toolchain) if os.path.exists(bb.data.expand('${EXTERNAL_TOOLCHAIN}/bin/gcc', l)): - d.setVar('TOOLCHAIN_PATH_ADD', '') + d.setVar('TOOLCHAIN_PATH_ADD_class-target', '') populate_toolchain_links(l) # The external toolchain may not have been built with the yocto preferred From 1e24d0e84ab695e496b95c09dbfde7f095046acc Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Tue, 30 Oct 2012 13:51:44 -0700 Subject: [PATCH 3/5] toolchain-scripts: add TOOLCHAIN_PATH_ADD to PATH Signed-off-by: Christopher Larson --- classes/toolchain-scripts-external.bbclass | 15 +++++++++++++++ conf/distro/include/tcmode-external-sourcery.inc | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 classes/toolchain-scripts-external.bbclass diff --git a/classes/toolchain-scripts-external.bbclass b/classes/toolchain-scripts-external.bbclass new file mode 100644 index 0000000..408ef23 --- /dev/null +++ b/classes/toolchain-scripts-external.bbclass @@ -0,0 +1,15 @@ +toolchain_create_sdk_env_script_append () { + if [ -n "${TOOLCHAIN_PATH_ADD}" ]; then + echo 'PATH="${TOOLCHAIN_PATH_ADD}$PATH"' >>$script + fi +} +toolchain_create_tree_env_script_append () { + if [ -n "${TOOLCHAIN_PATH_ADD}" ]; then + echo 'PATH="${TOOLCHAIN_PATH_ADD}$PATH"' >>$script + fi +} +toolchain_create_sdk_env_script_for_installer_append () { + if [ -n "${TOOLCHAIN_PATH_ADD}" ]; then + echo 'PATH="${TOOLCHAIN_PATH_ADD}$PATH"' >>$script + fi +} diff --git a/conf/distro/include/tcmode-external-sourcery.inc b/conf/distro/include/tcmode-external-sourcery.inc index c3fb3c7..3514e9a 100644 --- a/conf/distro/include/tcmode-external-sourcery.inc +++ b/conf/distro/include/tcmode-external-sourcery.inc @@ -11,6 +11,9 @@ PATH =. "${TOOLCHAIN_PATH_ADD}" # Don't ship any toolchain binaries in the sdk for the time being TOOLCHAIN_HOST_TASK ?= "nativesdk-packagegroup-sdk-host meta-environment-${TRANSLATED_TARGET_ARCH}" +# Add the external toolchain to the sdk setup script PATH +INHERIT += "toolchain-scripts-external" + localedir = "${exec_prefix}/lib/locale" CSL_TARGET_SYS_powerpc ?= "powerpc-linux-gnu powerpc-mentor-linux-gnu" From c5d06ee1f9326b0fa6d8e09e70589f4e0a592b6f Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Tue, 30 Oct 2012 15:05:49 -0700 Subject: [PATCH 4/5] external-sourcery-toolchain: put linux headers in eglibc packages When building glibc, this is what usually happens -- the headers are sanitized, then they're included in the libc development package(s), so mirror that here. Include the headers with eglibc-dev rather than splitting out separate linux-libc-headers packages. Signed-off-by: Christopher Larson --- recipes/meta/external-sourcery-toolchain.bb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/recipes/meta/external-sourcery-toolchain.bb b/recipes/meta/external-sourcery-toolchain.bb index 5b4647b..ca21321 100644 --- a/recipes/meta/external-sourcery-toolchain.bb +++ b/recipes/meta/external-sourcery-toolchain.bb @@ -22,7 +22,7 @@ PROVIDES = "\ libgcc \ " PV = "${CSL_VER_MAIN}" -PR = "r15" +PR = "r16" #SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/${CSL_TARGET_SYS}/arm-${PV}-${TARGET_PREFIX}i686-pc-linux-gnu.tar.bz2" @@ -93,7 +93,6 @@ TC_PACKAGES =+ "libgcc libgcc-dev" TC_PACKAGES =+ "libgomp libgomp-dev libgomp-staticdev" TC_PACKAGES =+ "libstdc++ libstdc++-dev libstdc++-staticdev" TC_PACKAGES =+ "gdbserver gdbserver-dbg" -TC_PACKAGES =+ "${@base_conditional('PREFERRED_PROVIDER_linux-libc-headers', PN, 'linux-libc-headers linux-libc-headers-dev', '', d)}" TC_PACKAGES =+ "oprofile" PACKAGES =+ "${TC_PACKAGES}" @@ -119,8 +118,6 @@ PKGV_libgomp-staticdev = "${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}" PKGV_gdbserver-dbg = "${CSL_VER_GDB}" PKGV_oprofile = "${CSL_VER_GCC}" @@ -136,14 +133,6 @@ FILES_libstdc++-dev = "${includedir}/c++/${PV} \ ${libdir}/libstdc++.la \ ${libdir}/libsupc++.la" FILES_libstdc++-staticdev = "${libdir}/libstdc++.a ${libdir}/libsupc++.a" -FILES_linux-libc-headers = "${includedir}/asm* \ - ${includedir}/linux \ - ${includedir}/mtd \ - ${includedir}/rdma \ - ${includedir}/scsi \ - ${includedir}/sound \ - ${includedir}/video \ -" FILES_gdbserver = "${bindir}/gdbserver ${libdir}/bin/sysroot-gdbserver" FILES_gdbserver-dbg = "${bindir}/.debug/gdbserver" FILES_oprofile = "${datadir}/oprofile/* ${libdir}/oprofile/* ${datadir}/stl.pat" From 3c3abdc9599b16e808f7f67bf8d783ce9fd3f7a5 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Tue, 30 Oct 2012 13:40:25 -0700 Subject: [PATCH 5/5] external-sourcery-toolchain: ship the multilib link in the -dev package Signed-off-by: Christopher Larson --- recipes/meta/external-sourcery-toolchain.bb | 26 ++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/recipes/meta/external-sourcery-toolchain.bb b/recipes/meta/external-sourcery-toolchain.bb index ca21321..c014ca3 100644 --- a/recipes/meta/external-sourcery-toolchain.bb +++ b/recipes/meta/external-sourcery-toolchain.bb @@ -22,7 +22,7 @@ PROVIDES = "\ libgcc \ " PV = "${CSL_VER_MAIN}" -PR = "r16" +PR = "r17" #SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/${CSL_TARGET_SYS}/arm-${PV}-${TARGET_PREFIX}i686-pc-linux-gnu.tar.bz2" @@ -74,15 +74,29 @@ do_install() { 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 sed -i -e 's/__packed/__attribute__ ((packed))/' ${D}${includedir}/mtd/ubi-user.h + + create_multilib_link ${D} +} + +def sysroot_multilib_suffix(d): + PATH = d.getVar('PATH', True) + cmd = '${CC} -print-sysroot | sed -e "s,^${STAGING_DIR_HOST},,; s,^/,,"' + return oe.path.check_output(bb.data.expand(cmd, d), shell=True, env={'PATH': PATH}) + +FILES_${PN}-dev += "/${@sysroot_multilib_suffix(d)}" + +create_multilib_link () { + dest="$1" + sysroot_multilib_suffix="${@sysroot_multilib_suffix(d)}" + if [ -n "$sysroot_multilib_suffix" ]; then + rm -f $dest/$sysroot_multilib_suffix + ln -s . $dest/$sysroot_multilib_suffix + fi } SYSROOT_PREPROCESS_FUNCS += "external_toolchain_sysroot_adjust" external_toolchain_sysroot_adjust() { - dest_sysroot="$(${CC} -print-sysroot | sed -e's,^${STAGING_DIR_HOST},,; s,/$,,')" - if [ -n "$dest_sysroot" ]; then - rm -f ${SYSROOT_DESTDIR}/$dest_sysroot - ln -s . ${SYSROOT_DESTDIR}/$dest_sysroot - fi + create_multilib_link ${SYSROOT_DESTDIR} # If the usr/lib directory doesn't exist, the toolchain fails to even # try to find crti.o in a completely different directory (usr/lib64)