Skip to content
Snippets Groups Projects
Commit b5324123 authored by Simon Glass's avatar Simon Glass
Browse files

buildman: Try to avoid hard-coded string parsing


The assumption that the compiler name will always end in gcc is incorrect
for clang and apparently on BSD.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
parent 5abab20d
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,14 @@ class Toolchain:
"""
self.gcc = fname
self.path = os.path.dirname(fname)
self.cross = os.path.basename(fname)[:-3]
# Find the CROSS_COMPILE prefix to use for U-Boot. For example,
# 'arm-linux-gnueabihf-gcc' turns into 'arm-linux-gnueabihf-'.
basename = os.path.basename(fname)
pos = basename.rfind('-')
self.cross = basename[:pos + 1] if pos != -1 else ''
# The architecture is the first part of the name
pos = self.cross.find('-')
self.arch = self.cross[:pos] if pos != -1 else 'sandbox'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment