[PATCH v2 2/4] binman: Use target-specific tools when cross-compiling

Simon Glass sjg at chromium.org
Sun Sep 27 03:59:45 CEST 2020


Currently, binman always runs the compile tools like cc, objcopy, strip,
etc. using their literal name. Instead, this patch makes it use the
target-specific versions by default, derived from the tool-specific
environment variables (CC, OBJCOPY, STRIP, etc.) or from the
CROSS_COMPILE environment variable.

For example, the u-boot-elf etype directly uses 'strip'. Trying to run
the tests with 'CROSS_COMPILE=i686-linux-gnu- binman test' on an arm64
host results in the '097_elf_strip.dts' test to fail as the arm64
version of 'strip' can't understand the format of the x86 ELF file.

This also adjusts some command.Output() calls that caused test errors or
failures to use the target versions of the tools they call. After this,
patch, an arm64 host can run all tests with no errors or failures using
a correct CROSS_COMPILE value.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak at gmail.com>
Reviewed-by: Simon Glass <sjg at chromium.org>
---

Changes in v2:
- Fix typo in an "e.g." (had used commas instead of dots)
- Add a table of target-specific versions in the docstring
- Add tag: "Reviewed-by: Simon Glass <sjg at chromium.org>"

 tools/binman/elf.py      |  6 ++--
 tools/binman/elf_test.py |  4 ++-
 tools/dtoc/fdt_util.py   |  9 ++---
 tools/patman/tools.py    | 77 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 89 insertions(+), 7 deletions(-)

Applied to u-boot-dm/next, thanks!


More information about the U-Boot mailing list