[PATCH v4 01/15] buildman/toolchain.py: do not set CROSS_COMPILE for sandbox

Simon Glass sjg at chromium.org
Thu Sep 12 03:01:01 CEST 2024


Hi Jerome,

On Wed, 11 Sept 2024 at 03:58, Jerome Forissier
<jerome.forissier at linaro.org> wrote:
>
> When building for sandbox, self.cross is empty.
>
> In MakeEnvironment(), CROSS_COMPILE is defined to be self.cross (with
> or without a full path), optionally prefixed by the toolchain wrapper
> defined in ~/.buildman. This is fine when self.cross is not empty, but
> it doesn't make sense when it is:
> - Either there is no wrapper and we end up with an empty CROSS_COMPILE
> which is the same as not defining it (the host compiler will be used),
> - Or there is a wrapper and CROSS_COMPILE will contain only the wrapper
> which obviously is not a valid compiler, hence an error.
>
> Test case:
>
>  $ sudo apt install ccache
>  $ grep -q toolchain-wrapper ~/.buildman || \
>      printf "[toolchain-wrapper]\nwrapper = ccache\n" >>~/.buildman
>  $ make mrproper
>  $ ./tools/buildman/buildman sandbox_noinst
>  $ ./tools/buildman/buildman sandbox_noinst
>  Building current source for 1 boards (1 thread, 24 jobs per thread)
>     sandbox:  +   sandbox_noinst
>  +arch/sandbox/lib/reloc_sandbox_efi.c:10:15: error: operator '==' has no left operand
>  +   10 | #if HOST_ARCH == HOST_ARCH_X86_64
>  +      |               ^~
> [...]
>
> The GetEnvArgs function is modified too, since the VAR_CROSS_COMPILE
> case has the same issue.
>
> In tools/buildman/test.py, testGetEnvArgs is extended and
> testMakeEnvironment is added. They check the 'arm' and 'sandbox'
> toolchains, with and without a wrapper.
>
> Signed-off-by: Jerome Forissier <jerome.forissier at linaro.org>
> ---
>  tools/buildman/test.py      | 46 +++++++++++++++++++++++++++++++++++++
>  tools/buildman/toolchain.py |  6 +++--
>  2 files changed, 50 insertions(+), 2 deletions(-)

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

I did not expect to still get that same error now, but OK.


More information about the U-Boot mailing list