From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from 93-97-173-237.zone5.bethere.co.uk ([93.97.173.237] helo=tim.rpsys.net) by linuxtogo.org with esmtp (Exim 4.72) (envelope-from ) id 1QlnGL-0004Xr-KT for openembedded-core@lists.openembedded.org; Tue, 26 Jul 2011 21:25:53 +0200 Received: from localhost (localhost [127.0.0.1]) by tim.rpsys.net (8.13.6/8.13.8) with ESMTP id p6QJLfM0024215 for ; Tue, 26 Jul 2011 20:21:41 +0100 Received: from tim.rpsys.net ([127.0.0.1]) by localhost (tim.rpsys.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 23667-03 for ; Tue, 26 Jul 2011 20:21:37 +0100 (BST) Received: from [192.168.3.10] ([192.168.3.10]) (authenticated bits=0) by tim.rpsys.net (8.13.6/8.13.8) with ESMTP id p6QJLanA024209 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 26 Jul 2011 20:21:36 +0100 From: Richard Purdie To: Patches and discussions about the oe-core layer In-Reply-To: <4E2EF641.5050204@windriver.com> References: <992efbf4ec3d7c55346953dbe82f9745590e64bf.1311683981.git.richard.purdie@linuxfoundation.org> <4E2ED5F2.3090306@windriver.com> <1311698198.2344.279.camel@rex> <4E2EF10A.2030705@windriver.com> <1311699937.2344.289.camel@rex> <4E2EF641.5050204@windriver.com> Date: Tue, 26 Jul 2011 20:21:27 +0100 Message-ID: <1311708087.2344.305.camel@rex> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 X-Virus-Scanned: amavisd-new at rpsys.net Subject: Re: [PATCH 3/3] Add basic PowerPC core tune config X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: Patches and discussions about the oe-core layer List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 19:25:53 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit On Tue, 2011-07-26 at 12:15 -0500, Mark Hatle wrote: > On 7/26/11 12:05 PM, Richard Purdie wrote: > > On Tue, 2011-07-26 at 11:53 -0500, Mark Hatle wrote: > >> On 7/26/11 11:36 AM, Richard Purdie wrote: > >>> On Tue, 2011-07-26 at 09:57 -0500, Mark Hatle wrote: > >>>> On 7/26/11 7:44 AM, Richard Purdie wrote: > >>>>> Signed-off-by: Richard Purdie > >>>>> --- > >>>>> meta/conf/machine/include/powerpc/arch-powerpc.inc | 45 +++++++++++++++++++- > >>>>> meta/conf/machine/include/tune-ppc603e.inc | 12 ++++- > >>>>> meta/conf/machine/include/tune-ppce300c2.inc | 12 ++++- > >>>>> meta/conf/machine/include/tune-ppce500.inc | 13 ++++-- > >>>>> meta/conf/machine/include/tune-ppce500mc.inc | 12 ++++- > >>>>> meta/conf/machine/include/tune-ppce500v2.inc | 12 ++++- > >>>>> 6 files changed, 88 insertions(+), 18 deletions(-) > >>>>> > >>>>> diff --git a/meta/conf/machine/include/powerpc/arch-powerpc.inc b/meta/conf/machine/include/powerpc/arch-powerpc.inc > >>>>> index 17ace32..3f7befb 100644 > >>>>> --- a/meta/conf/machine/include/powerpc/arch-powerpc.inc > >>>>> +++ b/meta/conf/machine/include/powerpc/arch-powerpc.inc > >>>>> @@ -1,3 +1,44 @@ > >>>>> -TUNE_ARCH = "powerpc" > >>>>> +# Power Architecture definition > >>>>> +# Four defined ABIs, all combinations of: > >>>>> +# *) Hard/Soft Floating Point > >>>>> +# *) 32-bit/64-bit > >>>>> + > >>>>> +DEFAULTTUNE ?= "powerpc" > >>>>> + > >>>>> +TUNEVALID[m32] = "Power ELF32 standard ABI" > >>>>> +TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "m32", "-m32", "", d)}" > >>>>> + > >>>>> +TUNEVALID[m32-arch] = "Enable powerpc package architecture" > >>>>> +TUNE_ARCH .= "${@bb.utils.contains("TUNE_FEATURES", [ "m32-arch" ], "powerpc", "", d)}" > >>>>> + > >>>>> +TUNEVALID[m64] = "Power ELF64 standard ABI" > >>>>> +TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "n64", "-m64", "", d)}" > >>>>> + > >>>>> +TUNEVALID[m64-arch] = "Enable powerpc64 package architecture" > >>>>> +TUNE_ARCH .= "${@bb.utils.contains("TUNE_FEATURES", [ "m64-arch" ], "powerpc64", "", d)}" > >>>> > >>>> Why m32-arch and m64-arch? If m32 or m64 is selected then it should mean > >>>> powerpc or powerpc64. > >>> > >>> I've gotten confused here and mixed up TUNE_ARCH and TUNE_PKGARCH but > >>> there was a reason. > >>> > >>> The missing piece is > >>> > >>> TUNE_PKGARCH ?= "${TUNE_ARCH}" > >>> > >>> and the trouble comes when a tune file wants to change this only when > >>> its tune config is in action. > >>> > >>> I'm thinking ahead to trying a mixed ppc 32 and 64 bit build where > >>> TUNE_PKGARCH needs to take on the values for both configs. > >> > >> As far as I can tell, in all cases m32 = powerpc and m64 = powerpc64.. There is > >> no way to mix a build of ppc32 and ppc64 w/o using the multilib code. > >> > >> The m32/m64 is the ABI, so only one can be present in the TUNE_FEATURES.. and > >> passed via gcc through the TUNE_CCARGS. > > > > Ok, say I use tune-ppcXXX and it sets TUNE_PKGARCH: > > > > TUNE_PKGARCH .= "${@bb.utils.contains("TUNE_FEATURES", "ppc603e", "ppc603e", "", d)}" > > > > and I want a multilib config using this as the m32 ABI and also have > > powerpc64 as my other multilib. I can't select that as it will get > > TUNE_PKGARCH wrong in the 64 bit case since: > > > > TUNE_PKGARCH ?= "${TUNE_ARCH}" > > > > is overwritten. I guess we could do: > > > > TUNE_PKGARCH = "${@bb.utils.contains("TUNE_FEATURES", "ppc603e", "ppc603e", "${TUNE_ARCH}", d)}" > > ppc603e is the new option.. (lets say for argument it can run in 64-bit mode, in > reality it can't and is an invalid config....) > > TUNEVALID[ppc603e] = "PowerPC 603e Optimization" > > # Note the TUNE_NAME is used differently from the TUNE_FEATURES > TUNE_NAME ?= "ppc603e" > > TUNE_FEATURES_ppc603e = "m32 ppc603e" > TUNE_FEATURES_ppc603e-64 = "m64 ppc603e" > > The if you include the tune-ppc603e.inc the default is the 32-bit version (what > I'd consider the reasonable default...) If you wanted the 64-bit version > instead you'd simply change set the TUNE_NAME to "ppc603e-64" and the properly > tuned set of features is set for you. > > TUNE_PKGARCH_ppc603e = "ppc603e" > TUNE_PKGARCH_ppc603e-64 = "ppc603e-64" The thing is we don't' support the above syntax for TUNE_PKGARCH... > etc... > > in the default (ppc603e) case, the TUNE_ARCH should always be "powerpc", and in > the ppc603e-64 case (if manually enabled), it would be "powerpc64"... > > This is what was done in the ARM cases and I believe the core2 case in ia32. which turns out to be broken :/. http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/ml4&id=244e28 is what I'm considering to "fix" this. I guess the config could do: TUNE_PKGARCH ?= "${@bb.utils.contains("TUNE_FEATURES", "ppc603e-64", "ppc603e-64", "ppc603e", d)}" as per the x86 case but since this really limits the reuse of any of the core variables as you might as well do: AVAILTUNES = "ppc603e ppc603e-64" after doing that since TUNE_PKGARCH will be wrong in any other case. Cheers, Richard