| Submitter | Khem Raj |
|---|---|
| Date | May 18, 2011, 7:49 a.m. |
| Message ID | <20110518074909.GA31650@sakrah.homelinux.org> |
| Download | mbox | patch |
| Permalink | /patch/4289/ |
| State | New, archived |
| Headers | show |
Comments
On Wed, 2011-05-18 at 00:49 -0700, Khem Raj wrote: > I think we need to globalize libc variable like MACHINE or MULTIMACHINE > and we could check if PREFERRED_PROVIDER_virtual/libc == TCLIBC or not > in base.bbclass for sanity. Something like attached patch might be > able to do it Having assessed how many places in the system we'd need to make this kind of change I'm now of the opinion its too great. I think manipulating TMPDIR is a better cleaner solution and we should inject this there... Cheers, Richard
On (18/05/11 08:57), Richard Purdie wrote: > On Wed, 2011-05-18 at 00:49 -0700, Khem Raj wrote: > > I think we need to globalize libc variable like MACHINE or MULTIMACHINE > > and we could check if PREFERRED_PROVIDER_virtual/libc == TCLIBC or not > > in base.bbclass for sanity. Something like attached patch might be > > able to do it > > Having assessed how many places in the system we'd need to make this > kind of change I'm now of the opinion its too great. I think > manipulating TMPDIR is a better cleaner solution and we should inject > this there... hmmm ok. So we delete these definitions from tclibc-uclibc.inc DEPLOY_DIR_IMAGE = "${TMPDIR}/deploy/images" DEPLOY_DIR_append = "-uclibc" STAGING_DIR_TARGET_append = "-uclibc" STAGING_DIR_HOST_append = "-uclibc" SSTATE_MANIFESTS_append = "-uclibc" and append define TMPDIR ?= "${TOPDIR}/tmp-${TCLIBC}" should be enough > > Cheers, > > Richard >
Op 18 mei 2011, om 10:12 heeft Khem Raj het volgende geschreven: > On (18/05/11 08:57), Richard Purdie wrote: >> On Wed, 2011-05-18 at 00:49 -0700, Khem Raj wrote: >>> I think we need to globalize libc variable like MACHINE or MULTIMACHINE >>> and we could check if PREFERRED_PROVIDER_virtual/libc == TCLIBC or not >>> in base.bbclass for sanity. Something like attached patch might be >>> able to do it >> >> Having assessed how many places in the system we'd need to make this >> kind of change I'm now of the opinion its too great. I think >> manipulating TMPDIR is a better cleaner solution and we should inject >> this there... > > hmmm ok. So we delete these definitions from tclibc-uclibc.inc > > DEPLOY_DIR_IMAGE = "${TMPDIR}/deploy/images" > DEPLOY_DIR_append = "-uclibc" > STAGING_DIR_TARGET_append = "-uclibc" > STAGING_DIR_HOST_append = "-uclibc" > SSTATE_MANIFESTS_append = "-uclibc" > > and append define > TMPDIR ?= "${TOPDIR}/tmp-${TCLIBC}" > > should be enough Like this: http://patches.openembedded.org/patch/4229/ ?
2011/5/18 Richard Purdie <richard.purdie@linuxfoundation.org> > On Wed, 2011-05-18 at 00:49 -0700, Khem Raj wrote: > > I think we need to globalize libc variable like MACHINE or MULTIMACHINE > > and we could check if PREFERRED_PROVIDER_virtual/libc == TCLIBC or not > > in base.bbclass for sanity. Something like attached patch might be > > able to do it > > Having assessed how many places in the system we'd need to make this > kind of change I'm now of the opinion its too great. I think > manipulating TMPDIR is a better cleaner solution and we should inject > this there... > > > Note that this introduces additional build time and space to rebuild native recipes for the different TMPDIR variants. Something which is not needed with the solution from Khem, if I properly understand things. From a conceptual point of view it seems better to mangle the target subdir name in work (e.g. ppce300c3-oe-linux-uclibc) or introduce a subdir in TMPDIR for (e.g. ppce300c3-oe-linux/uclibc ) (actually I seem to recall that we have or had something in OE as well, something like deploy/glibc) Frans
On Wed, May 18, 2011 at 1:47 AM, Koen Kooi <koen@dominion.thruhere.net> wrote: > > Op 18 mei 2011, om 10:12 heeft Khem Raj het volgende geschreven: > >> On (18/05/11 08:57), Richard Purdie wrote: >>> On Wed, 2011-05-18 at 00:49 -0700, Khem Raj wrote: >>>> I think we need to globalize libc variable like MACHINE or MULTIMACHINE >>>> and we could check if PREFERRED_PROVIDER_virtual/libc == TCLIBC or not >>>> in base.bbclass for sanity. Something like attached patch might be >>>> able to do it >>> >>> Having assessed how many places in the system we'd need to make this >>> kind of change I'm now of the opinion its too great. I think >>> manipulating TMPDIR is a better cleaner solution and we should inject >>> this there... >> >> hmmm ok. So we delete these definitions from tclibc-uclibc.inc >> >> DEPLOY_DIR_IMAGE = "${TMPDIR}/deploy/images" >> DEPLOY_DIR_append = "-uclibc" >> STAGING_DIR_TARGET_append = "-uclibc" >> STAGING_DIR_HOST_append = "-uclibc" >> SSTATE_MANIFESTS_append = "-uclibc" >> >> and append define >> TMPDIR ?= "${TOPDIR}/tmp-${TCLIBC}" >> >> should be enough > > Like this: http://patches.openembedded.org/patch/4229/ ? yes exactly looks good to me. > > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core >
On Wed, 2011-05-18 at 10:48 +0200, Frans Meulenbroeks wrote: > 2011/5/18 Richard Purdie <richard.purdie@linuxfoundation.org> > > > On Wed, 2011-05-18 at 00:49 -0700, Khem Raj wrote: > > > I think we need to globalize libc variable like MACHINE or MULTIMACHINE > > > and we could check if PREFERRED_PROVIDER_virtual/libc == TCLIBC or not > > > in base.bbclass for sanity. Something like attached patch might be > > > able to do it > > > > Having assessed how many places in the system we'd need to make this > > kind of change I'm now of the opinion its too great. I think > > manipulating TMPDIR is a better cleaner solution and we should inject > > this there... > > > > > > Note that this introduces additional build time and space to rebuild > native recipes for the different TMPDIR variants. Something which is not > needed with the solution from Khem, if I properly understand things. I mentioned this elsewhere in the thread but the sstate cache directory is in TOPDIR, not TMPDIR so its shared between the builds. This means the -native recipes should not need any additional build time. There is some disk space usage but this should be minimal and disk space is comparatively cheap anyway. > From a conceptual point of view it seems better to mangle the target subdir > name in work (e.g. ppce300c3-oe-linux-uclibc) or introduce a subdir in > TMPDIR for (e.g. ppce300c3-oe-linux/uclibc ) This turns out to be quite nasty mangling as the deploy directories don't include this and would need mangling in a certain style, the sysroots need a different mangling and so does workdir, the cache directories and so on. What these all have in common is they're in TMPDIR and the native directories are pretty much the only thing we don't mangle. The exceptions to the mangling seem to work out quite ugly as in the cross case we have to "half-mangle" directories too. > (actually I seem to recall that we have or had something in OE as > well, something like deploy/glibc) Some of it worked ok in OE, some of it didn't and the move to a sysroot directory per machine was the straw that broke the camel's back so to speak. We need to take a step back and consider what we're trying to achieve from an overall architecture perspective and which solution makes sense. Cheers, Richard
Patch
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 23095ec..76642be 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -179,7 +179,11 @@ python base_eventhandler() { pesteruser.append(v) if pesteruser: bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser)) - + if name == "ParseCompleted": + libc = bb.data.getVar('TCLIBC', e.data, True) + virtual_libc = bb.data.getVar('PREFERRED_PROVIDER_virtual/libc', e.data, True) + if not libc or libc != virtual_libc: + bb.fatal('PREFERRED_PROVIDER_virtual/libc = %s and TCLIBC = %s, they should be same.' % (virtual_libc, libc)) if name == "ConfigParsed": generate_git_config(e) diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index 553c6a2..dbd046a 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -23,7 +23,7 @@ python () { bb.data.setVar('SSTATE_PKGARCH', bb.data.getVar('BUILD_ARCH', d), d) elif bb.data.inherits_class('cross', d): bb.data.setVar('SSTATE_PKGARCH', bb.data.expand("${BUILD_ARCH}_${BASE_PACKAGE_ARCH}", d), d) - bb.data.setVar('SSTATE_MANMACH', bb.data.expand("${BUILD_ARCH}_${MACHINE}", d), d) + bb.data.setVar('SSTATE_MANMACH', bb.data.expand("${BUILD_ARCH}_${MACHINE}_${TCLIBC}", d), d) elif bb.data.inherits_class('crosssdk', d): bb.data.setVar('SSTATE_PKGARCH', bb.data.expand("${BUILD_ARCH}_${BASE_PACKAGE_ARCH}", d), d) elif bb.data.inherits_class('nativesdk', d): @@ -31,7 +31,7 @@ python () { elif bb.data.inherits_class('cross-canadian', d): bb.data.setVar('SSTATE_PKGARCH', bb.data.expand("${SDK_ARCH}_${BASE_PACKAGE_ARCH}", d), d) else: - bb.data.setVar('SSTATE_MANMACH', bb.data.expand("${MACHINE}", d), d) + bb.data.setVar('SSTATE_MANMACH', bb.data.expand("${MACHINE}_${TCLIBC}", d), d) # These classes encode staging paths into their scripts data so can only be # reused if we manipulate the paths diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass index fef6457..856efd8 100644 --- a/meta/classes/staging.bbclass +++ b/meta/classes/staging.bbclass @@ -92,6 +92,7 @@ do_populate_sysroot[sstate-name] = "populate-sysroot" do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}" do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_HOST}/" do_populate_sysroot[stamp-extra-info] = "${MACHINE}" +do_populate_sysroot[stamp-extra-info] = "${TCLIBC}" python do_populate_sysroot_setscene () { sstate_setscene(d) diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index c292759..6f2d64a 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -300,7 +300,7 @@ STAGING_DATADIR_NATIVE = "${STAGING_DIR_NATIVE}${datadir_native}" # This should really be MULTIMACH_HOST_SYS but that breaks "all" and machine # specific packages - hack around it for now. -STAGING_DIR_HOST = "${STAGING_DIR}/${MACHINE}" +STAGING_DIR_HOST = "${STAGING_DIR}/${MACHINE}-${TCLIBC}" STAGING_BINDIR = "${STAGING_DIR_HOST}${bindir}" STAGING_LIBDIR = "${STAGING_DIR_HOST}${libdir}" STAGING_INCDIR = "${STAGING_DIR_HOST}${includedir}" @@ -312,7 +312,7 @@ STAGING_PYDIR = "${STAGING_DIR}/lib/python2.4" # This should really be MULTIMACH_TARGET_SYS but that breaks "all" and machine # specific packages - hack around it for now. -STAGING_DIR_TARGET = "${STAGING_DIR}/${MACHINE}" +STAGING_DIR_TARGET = "${STAGING_DIR}/${MACHINE}-${TCLIBC}" STAGING_DIR_TCBOOTSTRAP = "${STAGING_DIR_TARGET}-tcbootstrap" # Setting DEPLOY_DIR outside of TMPDIR is helpful, when you are using @@ -344,8 +344,8 @@ STAGING_KERNEL_DIR = "${STAGING_DIR_HOST}/kernel" IMAGE_ROOTFS = "${WORKDIR}/rootfs" IMAGE_BASENAME = "${PN}" -IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}" -IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}" +IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${TCLIBC}-${DATETIME}" +IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}-${TCLIBC}" # This option allows for a precentage overage of the actaul image size rather than a # fixed extra space