summaryrefslogtreecommitdiff
path: root/tools/buildman/builderthread.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-01-11 13:55:03 -0500
committerTom Rini <trini@konsulko.com>2021-01-11 13:55:03 -0500
commitd71be1990218957b9f05dbf13a72859a2abe06d7 (patch)
tree99858dc9988f7f7b4c0ab1d8d45738e3abdf38c8 /tools/buildman/builderthread.py
parentc4fddedc48f336eabc4ce3f74940e6aa372de18c (diff)
parentbc0b99bd8b19599f670f42401de655fa9b44cd94 (diff)
Merge branch 'next'
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'tools/buildman/builderthread.py')
-rw-r--r--tools/buildman/builderthread.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py
index 48fcd6cf7e2..d6648685823 100644
--- a/tools/buildman/builderthread.py
+++ b/tools/buildman/builderthread.py
@@ -13,6 +13,7 @@ from patman import command
from patman import gitutil
RETURN_CODE_RETRY = -1
+BASE_ELF_FILENAMES = ['u-boot', 'spl/u-boot-spl', 'tpl/u-boot-tpl']
def Mkdir(dirname, parents = False):
"""Make a directory if it doesn't already exist.
@@ -240,6 +241,17 @@ class BuilderThread(threading.Thread):
args.extend(self.builder.toolchains.GetMakeArguments(brd))
args.extend(self.toolchain.MakeArgs())
+ # Remove any output targets. Since we use a build directory that
+ # was previously used by another board, it may have produced an
+ # SPL image. If we don't remove it (i.e. see do_config and
+ # self.mrproper below) then it will appear to be the output of
+ # this build, even if it does not produce SPL images.
+ build_dir = self.builder.GetBuildDir(commit_upto, brd.target)
+ for elf in BASE_ELF_FILENAMES:
+ fname = os.path.join(out_dir, elf)
+ if os.path.exists(fname):
+ os.remove(fname)
+
# If we need to reconfigure, do that now
if do_config:
config_out = ''
@@ -335,7 +347,7 @@ class BuilderThread(threading.Thread):
for var in sorted(env.keys()):
print('%s="%s"' % (var, env[var]), file=fd)
lines = []
- for fname in ['u-boot', 'spl/u-boot-spl']:
+ for fname in BASE_ELF_FILENAMES:
cmd = ['%snm' % self.toolchain.cross, '--size-sort', fname]
nm_result = command.RunPipe([cmd], capture=True,
capture_stderr=True, cwd=result.out_dir,