All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <rpurdie@linux.intel.com>
To: Lianhao Lu <lianhao.lu@intel.com>
Cc: yocto@yoctoproject.org
Subject: Re: [PATCH 0/1] Bug #528 fixing
Date: Fri, 10 Dec 2010 16:25:21 +0000	[thread overview]
Message-ID: <1291998321.14420.59.camel@rex> (raw)
In-Reply-To: <cover.1291174318.git.lianhao.lu@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1498 bytes --]

Hi Lianhao,

On Wed, 2010-12-01 at 11:31 +0800, Lianhao Lu wrote:
> Since this my very first time trying to contribute to distro, so let me 
> put some fixing details here and warmly welcome the reivew/comment.
> 
> The purpose of this fixing is to add target name in the package name of
> gcc(gdb/binutils)-cross-canadian so multiple cross-canadian toolchains 
> can be installed into the same SDK sysroot.
> 
> We choose the PN instead of the PACKAGE(or PKG_pn) to change the package 
> name because the -locale package is named by the PN. By changing PN, we 
> have different -locale and -doc packages for different target.
> 
> Pull URL: git://git.pokylinux.org/poky-contrib.git
>   Branch: llu/fix
>   Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/fix

These patches are just what we need, thanks. 

We do however need to go one step further and complete the change which
is to remove the idea of "cross-canadian" packages from the packaging
backend and make all these "nativesdk", now there is no naming conflict.

I've attached a patch which starts to do this, I'm running some builds
to test this out a bit but the builds are not completing at the
moment :(. 

Also note that I had to make the task-cross-canadian contain the
TARGET_ARCH in the PN which meant moving the TRANSLATED_TARGET_ARCH into
the more global namespace which I'm not too keen on.

Cheers,

Richard

(For reference, patches to Poky should go to the Poky list)


[-- Attachment #2: canadianupdate.patch --]
[-- Type: text/x-patch, Size: 4809 bytes --]

diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass
index 7971147..7360e1c 100644
--- a/meta/classes/cross-canadian.bbclass
+++ b/meta/classes/cross-canadian.bbclass
@@ -1,18 +1,30 @@
+#
+# NOTE - When using this class the user is repsonsible for ensuring that
+# TRANSLATED_TARGET_ARCH is added into PN. This ensures that if the TARGET_ARCH
+# is changed, another nativesdk xxx-canadian-cross can be installed
+#
+
+
 # SDK packages are built either explicitly by the user,
 # or indirectly via dependency.  No need to be in 'world'.
 EXCLUDE_FROM_WORLD = "1"
 
 STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}:${STAGING_DIR_NATIVE}${bindir_native}/${BASE_PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
 
-# Save MULTIMACH_ARCH
+#
+# Update BASE_PACKAGE_ARCH and PACKAGE_ARCHS
+#
 OLD_MULTIMACH_ARCH := "${MULTIMACH_ARCH}"
-# Save PACKAGE_ARCH
-OLD_PACKAGE_ARCH := ${PACKAGE_ARCH}
-PACKAGE_ARCH = "${SDK_ARCH}-${TARGET_ARCH}-canadian"
-PACKAGE_ARCHS = "${PACKAGE_ARCH}"
-# Also save BASE_PACKAGE_ARCH since HOST_ARCH can influence it
-OLD_BASE_PACKAGE_ARCH := "${BASE_PACKAGE_ARCH}"
-BASE_PACKAGE_ARCH = "${OLD_BASE_PACKAGE_ARCH}"
+OLD_PACKAGE_ARCH := ${BASE_PACKAGE_ARCH}
+BASE_PACKAGE_ARCH = "${SDK_ARCH}-nativesdk"
+python () {
+    archs = bb.data.getVar('PACKAGE_ARCHS', d, True).split()
+    sdkarchs = []
+    for arch in archs:
+        sdkarchs.append(arch + '-nativesdk')
+    bb.data.setVar('PACKAGE_ARCHS', " ".join(sdkarchs), d)
+}
+MULTIMACH_TARGET_SYS = "${MULTIMACH_ARCH}${HOST_VENDOR}-${HOST_OS}"
 
 INHIBIT_DEFAULT_DEPS = "1"
 
@@ -69,5 +81,3 @@ export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
 # Cross-canadian packages need to pull in nativesdk dynamic libs
 SHLIBSDIR = "${STAGING_DIR}/${SDK_ARCH}-nativesdk${SDK_VENDOR}-${BUILD_OS}/shlibs"
 
-# handle x86_64 TARGET_ARCH name
-TRANSLATED_TARGET_ARCH ?= ${TARGET_ARCH}
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index c1393fa..5ddd6c6 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -79,8 +79,6 @@ package_update_index_ipk () {
 		packagedirs="$packagedirs ${DEPLOY_DIR_IPK}/$arch ${DEPLOY_DIR_IPK}/$sdkarch-nativesdk"
 	done
 
-	packagedirs="$packagedirs ${DEPLOY_DIR_IPK}/${SDK_ARCH}-${TARGET_ARCH}-canadian"
-
 	for pkgdir in $packagedirs; do
 		if [ -e $pkgdir/ ]; then
 			touch $pkgdir/Packages
@@ -112,9 +110,6 @@ package_generate_ipkg_conf () {
 		        echo "src oe-$sdkarch$extension file:${DEPLOY_DIR_IPK}/$sdkarch$extension" >> ${IPKGCONF_SDK}
 		fi
 	done
-	if [ -e ${DEPLOY_DIR_IPK}/${SDK_ARCH}-${TARGET_ARCH}-canadian/Packages ] ; then
-	        echo "src oe-${SDK_ARCH}-${TARGET_ARCH}-canadian file:${DEPLOY_DIR_IPK}/${SDK_ARCH}-${TARGET_ARCH}-canadian" >> ${IPKGCONF_SDK}
-	fi
 }
 
 package_generate_archlist () {
@@ -130,7 +125,6 @@ package_generate_archlist () {
 		echo "arch $sdkarch$extension $priority" >> ${IPKGCONF_SDK}
 		priority=$(expr $priority + 5)
 	done
-	echo "arch ${SDK_ARCH}-${TARGET_ARCH}-canadian $priority" >> ${IPKGCONF_SDK}
 }
 
 python do_package_ipk () {
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index abd2bb5..d3fd26d 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -726,3 +726,5 @@ TARGET_ARCH[unexport] = "1"
 # (breaks sysvinit at least)
 DISTRO[unexport] = "1"
 
+# Used by canadian-cross to handle string conversions on TARGET_ARCH where needed
+TRANSLATED_TARGET_ARCH ??= ${TARGET_ARCH}
diff --git a/meta/recipes-core/meta/meta-toolchain.bb b/meta/recipes-core/meta/meta-toolchain.bb
index 8b62fab..40f8d7e 100644
--- a/meta/recipes-core/meta/meta-toolchain.bb
+++ b/meta/recipes-core/meta/meta-toolchain.bb
@@ -13,7 +13,7 @@ SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${TARGET_SYS}"
 IPKG_HOST = "opkg-cl -f ${IPKGCONF_SDK} -o ${SDK_OUTPUT}"
 IPKG_TARGET = "opkg-cl -f ${IPKGCONF_TARGET} -o ${SDK_OUTPUT}/${SDKTARGETSYSROOT}"
 
-TOOLCHAIN_HOST_TASK ?= "task-sdk-host task-cross-canadian"
+TOOLCHAIN_HOST_TASK ?= "task-sdk-host task-cross-canadian-${TRANSLATED_TARGET_ARCH}"
 TOOLCHAIN_TARGET_TASK ?= "task-poky-standalone-sdk-target task-poky-standalone-sdk-target-dbg"
 TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${DISTRO_VERSION}"
 
diff --git a/meta/recipes-core/tasks/task-cross-canadian.bb b/meta/recipes-core/tasks/task-cross-canadian.bb
index c32afdc..7170faa 100644
--- a/meta/recipes-core/tasks/task-cross-canadian.bb
+++ b/meta/recipes-core/tasks/task-cross-canadian.bb
@@ -1,4 +1,5 @@
 DESCRIPTION = "Host SDK package for cross canadian toolchain" 
+PN = "task-cross-canadian-${TRANSLATED_TARGET_ARCH}"
 PR = "r0"
 LICENSE = "MIT"
 ALLOW_EMPTY = "1"

      parent reply	other threads:[~2010-12-10 16:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-01  3:31 [PATCH 0/1] Bug #528 fixing Lianhao Lu
2010-12-01  2:13 ` [PATCH 1/1] cross-canadian: pkg name includes target arch Lianhao Lu
2010-12-10 16:25 ` Richard Purdie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1291998321.14420.59.camel@rex \
    --to=rpurdie@linux.intel.com \
    --cc=lianhao.lu@intel.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.