Bug #528 fixing
cover Bug #528 fixing
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
Thanks,
Lianhao Lu <[email protected]>
---
Lianhao Lu (1):
cross-canadian: pkg name includes target arch
meta/recipes-core/meta/meta-toolchain.bb | 2 +- meta/recipes-core/tasks/task-cross-canadian.bb | 15 +++++++++++++++ meta/recipes-core/tasks/task-sdk-host.bb | 5 +---- .../binutils/binutils-cross-canadian.inc | 6 ++++++ .../binutils/binutils-cross-canadian_2.20.1.bb | 2 +- meta/recipes-devtools/gcc/gcc-cross-canadian.inc | 4 ++++ .../gcc/gcc-cross-canadian_4.3.3.bb | 2 +- .../gcc/gcc-cross-canadian_4.5.1.bb | 2 +- meta/recipes-devtools/gdb/gdb-cross-canadian.inc | 7 +++++++ .../recipes-devtools/gdb/gdb-cross-canadian_7.2.bb | 7 ++----- 10 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 meta/recipes-core/tasks/task-cross-canadian.bb create mode 100644 meta/recipes-devtools/gdb/gdb-cross-canadian.inc
PATCH 1/1 cross-canadian: pkg name includes target arch
This commit fixes Bug #528.
1. Added the target arch name to the pkg name of gcc-cross-canadian, gdb-cross-candian and bintuils-cross-candian.
2. Move the cross-canadian pkgs out of task-sdk-host into a new task task-cross-canadian.
3. Added the RDEPENDS of task-cross-canadian into meta-toolchain.
--- meta/recipes-core/meta/meta-toolchain.bb | 2 +- meta/recipes-core/tasks/task-cross-canadian.bb | 15 +++++++++++++++ meta/recipes-core/tasks/task-sdk-host.bb | 5 +---- .../binutils/binutils-cross-canadian.inc | 6 ++++++ .../binutils/binutils-cross-canadian_2.20.1.bb | 2 +- meta/recipes-devtools/gcc/gcc-cross-canadian.inc | 4 ++++ .../gcc/gcc-cross-canadian_4.3.3.bb | 2 +- .../gcc/gcc-cross-canadian_4.5.1.bb | 2 +- meta/recipes-devtools/gdb/gdb-cross-canadian.inc | 7 +++++++ .../recipes-devtools/gdb/gdb-cross-canadian_7.2.bb | 7 ++----- 10 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 meta/recipes-core/tasks/task-cross-canadian.bb create mode 100644 meta/recipes-devtools/gdb/gdb-cross-canadian.inc
meta/recipes-core/meta/meta-toolchain.bb +1 -1
@@ -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" +TOOLCHAIN_HOST_TASK ?= "task-sdk-host task-cross-canadian" TOOLCHAIN_TARGET_TASK ?= "task-poky-standalone-sdk-target task-poky-standalone-sdk-target-dbg" TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${DISTRO_VERSION}"
meta/recipes-core/tasks/task-cross-canadian.bb new file +15 -0
@@ -0,0 +1,15 @@ +DESCRIPTION = "Host SDK package for cross canadian toolchain" +PR = "r0" +LICENSE = "MIT" +ALLOW_EMPTY = "1" + +inherit cross-canadian + +PACKAGES = "${PN}" + +RDEPENDS_${PN} = "\ + binutils-cross-canadian-${TARGET_ARCH} \ + gdb-cross-canadian-${TARGET_ARCH} \ + gcc-cross-canadian-${TARGET_ARCH} \ + " +
meta/recipes-core/tasks/task-sdk-host.bb +1 -4
@@ -3,7 +3,7 @@ # DESCRIPTION = "Host packages for the standalone SDK or external toolchain" -PR = "r8" +PR = "r9" LICENSE = "MIT" ALLOW_EMPTY = "1"
@@ -12,9 +12,6 @@ inherit nativesdk PACKAGES = "${PN}" RDEPENDS_${PN} = "\ - binutils-cross-canadian \ - gdb-cross-canadian \ - gcc-cross-canadian \ pkgconfig-nativesdk \ qemu-nativesdk \ qemu-helper-nativesdk \
meta/recipes-devtools/binutils/binutils-cross-canadian.inc +6 -0
@@ -1,4 +1,10 @@ inherit cross-canadian + + +DESCRIPTION = "A GNU collection of cross-canadian binary utilities for ${TARGET_ARCH} target" +PN = "binutils-cross-canadian-${TARGET_ARCH}" +BPN = "binutils" + DEPENDS = "flex-native bison-native virtual/${HOST_PREFIX}gcc-crosssdk virtual/libc-nativesdk zlib-nativesdk gettext-nativesdk" EXTRA_OECONF = "--with-sysroot=${SDKPATH}/sysroots/${TARGET_SYS} \ --program-prefix=${TARGET_PREFIX}"
meta/recipes-devtools/binutils/binutils-cross-canadian_2.20.1.bb +1 -1
@@ -1,3 +1,3 @@ require binutils_${PV}.bb require binutils-cross-canadian.inc -PR = "r5" +PR = "r6"
meta/recipes-devtools/gcc/gcc-cross-canadian.inc +4 -0
@@ -1,4 +1,8 @@ inherit cross-canadian +DESCRIPTION = "The cross-canadian GNU cc and gcc C compilers for ${TARGET_ARCH} target." +PN = "gcc-cross-canadian-${TARGET_ARCH}" +BPN = "gcc" + DEPENDS = "virtual/${HOST_PREFIX}binutils-crosssdk virtual/${TARGET_PREFIX}libc-for-gcc gettext-nativesdk"
meta/recipes-devtools/gcc/gcc-cross-canadian_4.3.3.bb +1 -1
@@ -5,7 +5,7 @@ require gcc-cross-canadian.inc require gcc-configure-sdk.inc require gcc-package-sdk.inc -PR = "r19" +PR = "r20" DEPENDS += "gmp-nativesdk mpfr-nativesdk" RDEPENDS_${PN} += "mpfr-nativesdk"
meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.1.bb +1 -1
@@ -5,7 +5,7 @@ require gcc-cross-canadian.inc require gcc-configure-sdk.inc require gcc-package-sdk.inc -PR = "r0" +PR = "r1" DEPENDS += "gmp-nativesdk mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk" RDEPENDS_${PN} += "mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk"
meta/recipes-devtools/gdb/gdb-cross-canadian.inc new file +7 -0
@@ -0,0 +1,7 @@ +inherit cross-canadian + +DESCRIPTION = "cross-canadian gdb for ${TARGET_ARCH} target - GNU debugger" +PN = "gdb-cross-canadian-${TARGET_ARCH}" +BPN = "gdb" + +DEPENDS = "ncurses-nativesdk expat-nativesdk gettext-nativesdk"
meta/recipes-devtools/gdb/gdb-cross-canadian_7.2.bb +2 -5
@@ -1,10 +1,7 @@ require gdb-common.inc +require gdb-cross-canadian.inc -DEPENDS = "ncurses-nativesdk expat-nativesdk gettext-nativesdk" - -inherit cross-canadian - -PR = "r0" +PR = "r1" GDBPROPREFIX = "--program-prefix='${TARGET_PREFIX}'" EXPAT = "--with-expat"
Signature · 1 line
1.7.0.4
Hi Lianhao,
Quoted 7 lines · Lianhao Lu
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.
Quoted 7 lines
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)
meta/classes/cross-canadian.bbclass +20 -10
@@ -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}
meta/classes/package_ipk.bbclass +0 -6
@@ -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 () {
meta/conf/bitbake.conf +2 -0
@@ -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}
meta/recipes-core/meta/meta-toolchain.bb +1 -1
@@ -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}"
meta/recipes-core/tasks/task-cross-canadian.bb +1 -0
@@ -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"