From patchwork Tue Dec 2 00:34:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 416646 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 47B3A14017B for ; Tue, 2 Dec 2014 11:38:14 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7D1B84B84F; Tue, 2 Dec 2014 01:37:24 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WnZoczchHWF0; Tue, 2 Dec 2014 01:37:24 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C2B834B7D6; Tue, 2 Dec 2014 01:37:03 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2E0704B682 for ; Tue, 2 Dec 2014 01:36:25 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lpiodvKej8lS for ; Tue, 2 Dec 2014 01:36:25 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-oi0-f73.google.com (mail-oi0-f73.google.com [209.85.218.73]) by theia.denx.de (Postfix) with ESMTPS id 96EA94B691 for ; Tue, 2 Dec 2014 01:36:20 +0100 (CET) Received: by mail-oi0-f73.google.com with SMTP id a141so1242667oig.0 for ; Mon, 01 Dec 2014 16:36:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gHTMMfuGerYTza4UafHEw9DNfUUl7/w9SQZEO4HV9ck=; b=coOg/7UEM4tBRdmLhMWk3eunbUuX3fpcRn5oXJgZT4PzKPPN3yYBFGROtLeOuqSnDZ jKOzyoxB+aDIFgciXS1KAzG85rVl3hYgvWlUttl2wYXGHM3XT7+aotgu1wZdwqvapMBz f3Pc4WWW0+dzOPjJyKLhWoYM+L5lajXxopmfZGUqlqCgl0asISOeWgL0YNYyotbQBEaz QmdjjTH4cvj6aglqF0QivwSDNccmgY08tHTbLzAHQuLWyNIpb0dP0eC4eT5Jn+q+OtYF uv1IpkfDCBHuz30bPWgsxL1shZl/waNeGGAcS5a6r3BpDJSkkTzyjhHk/qorRb1QbZVZ cjBg== X-Gm-Message-State: ALoCoQnX/VMqpsSc9AX6/6L0SyeM/VCTCRBl/tr9feDcp1Io14Ng61v8CPjB9yUNXeIHatD6+miL X-Received: by 10.43.78.198 with SMTP id zn6mr638822icb.12.1417480579009; Mon, 01 Dec 2014 16:36:19 -0800 (PST) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id n63si771730yho.5.2014.12.01.16.36.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Dec 2014 16:36:18 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id 7cs9V1g9.2; Mon, 01 Dec 2014 16:36:18 -0800 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 3E7E7220FEB; Mon, 1 Dec 2014 17:36:17 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Mon, 1 Dec 2014 17:34:05 -0700 Message-Id: <1417480447-5763-16-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1417480447-5763-1-git-send-email-sjg@chromium.org> References: <1417480447-5763-1-git-send-email-sjg@chromium.org> Cc: Steve Rae , =?UTF-8?q?Marek=20Va=C5=A1ut?= , Jeroen Hofstee , Tom Rini Subject: [U-Boot] [PATCH 15/17] buildman: Allow architecture to alias to multiple toolchains X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Some archs have need than one alias, so support a list of alises in the ..buildman file. Signed-off-by: Simon Glass --- tools/buildman/README | 5 +++-- tools/buildman/test.py | 15 +++++++++++++++ tools/buildman/toolchain.py | 8 +++++--- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/tools/buildman/README b/tools/buildman/README index affcb6c..093c177 100644 --- a/tools/buildman/README +++ b/tools/buildman/README @@ -701,8 +701,9 @@ a set of (tag, value) pairs. This converts toolchain architecture names to U-Boot names. For example, if an x86 toolchains is called i386-linux-gcc it will not normally be - used for architecture 'x86'. Adding 'x86: i386' to this section will - tell buildman that the i386 toolchain can be used for x86. + used for architecture 'x86'. Adding 'x86: i386 x86_64' to this section + will tell buildman that the i386 and x86_64 toolchains can be used for + the x86 architecture. '[make-flags]' section diff --git a/tools/buildman/test.py b/tools/buildman/test.py index d19f6ea..25be43f 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -394,5 +394,20 @@ class TestBuild(unittest.TestCase): build.commit_count = 0 self.CheckDirs(build, '') + def testToolchainAliases(self): + self.assertTrue(self.toolchains.Select('arm') != None) + with self.assertRaises(ValueError): + self.toolchains.Select('no-arch') + with self.assertRaises(ValueError): + self.toolchains.Select('x86') + + self.toolchains = toolchain.Toolchains() + self.toolchains.Add('x86_64-linux-gcc', test=False) + self.assertTrue(self.toolchains.Select('x86') != None) + + self.toolchains = toolchain.Toolchains() + self.toolchains.Add('i386-linux-gcc', test=False) + self.assertTrue(self.toolchains.Select('x86') != None) + if __name__ == "__main__": unittest.main() diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py index cb693f4..ad4df8c 100644 --- a/tools/buildman/toolchain.py +++ b/tools/buildman/toolchain.py @@ -185,9 +185,11 @@ class Toolchains: returns: toolchain object, or None if none found """ - for name, value in bsettings.GetItems('toolchain-alias'): - if arch == name: - arch = value + for tag, value in bsettings.GetItems('toolchain-alias'): + if arch == tag: + for alias in value.split(): + if alias in self.toolchains: + return self.toolchains[alias] if not arch in self.toolchains: raise ValueError, ("No tool chain found for arch '%s'" % arch)