mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 17:22:22 +02:00
buildman: Allow architecture to alias to multiple toolchains
Some archs have need than one alias, so support a list of alises in the ..buildman file. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -701,8 +701,9 @@ a set of (tag, value) pairs.
|
|||||||
|
|
||||||
This converts toolchain architecture names to U-Boot names. For example,
|
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
|
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
|
used for architecture 'x86'. Adding 'x86: i386 x86_64' to this section
|
||||||
tell buildman that the i386 toolchain can be used for x86.
|
will tell buildman that the i386 and x86_64 toolchains can be used for
|
||||||
|
the x86 architecture.
|
||||||
|
|
||||||
'[make-flags]' section
|
'[make-flags]' section
|
||||||
|
|
||||||
|
@@ -394,5 +394,20 @@ class TestBuild(unittest.TestCase):
|
|||||||
build.commit_count = 0
|
build.commit_count = 0
|
||||||
self.CheckDirs(build, '')
|
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__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@@ -185,9 +185,11 @@ class Toolchains:
|
|||||||
returns:
|
returns:
|
||||||
toolchain object, or None if none found
|
toolchain object, or None if none found
|
||||||
"""
|
"""
|
||||||
for name, value in bsettings.GetItems('toolchain-alias'):
|
for tag, value in bsettings.GetItems('toolchain-alias'):
|
||||||
if arch == name:
|
if arch == tag:
|
||||||
arch = value
|
for alias in value.split():
|
||||||
|
if alias in self.toolchains:
|
||||||
|
return self.toolchains[alias]
|
||||||
|
|
||||||
if not arch in self.toolchains:
|
if not arch in self.toolchains:
|
||||||
raise ValueError, ("No tool chain found for arch '%s'" % arch)
|
raise ValueError, ("No tool chain found for arch '%s'" % arch)
|
||||||
|
Reference in New Issue
Block a user