diff mbox series

[v2,4/4] binman: Document how CROSS_COMPILE, CC, HOSTCC etc. are used in README

Message ID 20200906114607.30081-5-alpernebiyasak@gmail.com
State Accepted
Commit 4ec40a7208db0e3294e266aacd23eddbae13c879
Delegated to: Simon Glass
Headers show
Series binman: Make tests work on non-x86 architectures via cross-compilation | expand

Commit Message

Alper Nebi Yasak Sept. 6, 2020, 11:46 a.m. UTC
Explain that binman interprets these environment variables in the
"External tools" section to run target/host specific versions of the
tools, and add a new section on how to use CROSS_COMPILE to run the
tests on non-x86 machines.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
---

Changes in v2:
- Added this new patch

 tools/binman/README | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

Comments

Simon Glass Sept. 6, 2020, 1:58 p.m. UTC | #1
On Sun, 6 Sep 2020 at 05:46, Alper Nebi Yasak <alpernebiyasak@gmail.com> wrote:
>
> Explain that binman interprets these environment variables in the
> "External tools" section to run target/host specific versions of the
> tools, and add a new section on how to use CROSS_COMPILE to run the
> tests on non-x86 machines.
>
> Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
> ---
>
> Changes in v2:
> - Added this new patch
>
>  tools/binman/README | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
Simon Glass Sept. 27, 2020, 1:59 a.m. UTC | #2
On Sun, 6 Sep 2020 at 05:46, Alper Nebi Yasak <alpernebiyasak@gmail.com> wrote:
>
> Explain that binman interprets these environment variables in the
> "External tools" section to run target/host specific versions of the
> tools, and add a new section on how to use CROSS_COMPILE to run the
> tests on non-x86 machines.
>
> Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
> ---
>
> Changes in v2:
> - Added this new patch
>
>  tools/binman/README | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm/next, thanks!
diff mbox series

Patch

diff --git a/tools/binman/README b/tools/binman/README
index 37ee3fc2d3..dfa0ed6a09 100644
--- a/tools/binman/README
+++ b/tools/binman/README
@@ -884,6 +884,12 @@  the 'tools' module's Run() method. The tools generally must exist on the PATH,
 but the --toolpath option can be used to specify additional search paths to
 use. This option can be specified multiple times to add more than one path.
 
+For some compile tools binman will use the versions specified by commonly-used
+environment variables like CC and HOSTCC for the C compiler, based on whether
+the tool's output will be used for the target or for the host machine. If those
+aren't given, it will also try to derive target-specific versions from the
+CROSS_COMPILE environment variable during a cross-compilation.
+
 
 Code coverage
 -------------
@@ -918,6 +924,24 @@  directories so they can be examined later. Use -X or --test-preserve-dirs for
 this.
 
 
+Running tests on non-x86 architectures
+--------------------------------------
+
+Binman's tests have been written under the assumption that they'll be run on a
+x86-like host and there hasn't been an attempt to make them portable yet.
+However, it's possible to run the tests by cross-compiling to x86.
+
+To install an x86 cross-compiler on Debian-type distributions (e.g. Ubuntu):
+
+  $ sudo apt-get install gcc-x86-64-linux-gnu
+
+Then, you can run the tests under cross-compilation:
+
+  $ CROSS_COMPILE=x86_64-linux-gnu- binman test -T
+
+You can also use gcc-i686-linux-gnu similar to the above.
+
+
 Advanced Features / Technical docs
 ----------------------------------