From 4ec40a7208db0e3294e266aacd23eddbae13c879 Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Sun, 6 Sep 2020 14:46:07 +0300 Subject: [PATCH] binman: Document how CROSS_COMPILE, CC, HOSTCC etc. are used in README 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 Reviewed-by: Simon Glass --- tools/binman/README | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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 ---------------------------------- -- 2.39.5