Re: [PATCH 1/3] binman: Support cross-compiling test files to x86
Hi Alper, On Sat, 5 Sep 2020 at 16:51, Alper Nebi Yasak wrote: > > On 05/09/2020 19:36, Simon Glass wrote: > > For me this fails on x86_64, complaining for example: > > > > Exception: Error 2 running 'make -C /tmp/binmant.d17vfu3j/elftest -f > > /scratch/sglass/cosarm/src/third_party/u-boot/files/tools/binman/test/Makefile > > SRC=/scratch/sglass/cosarm/src/third_party/u-boot/files/tools/binman/test/': > > /scratch/sglass/cosarm/src/third_party/u-boot/files/tools/binman/test/Makefile:14: > > *** Binman tests need to compile to x86, but the CPU arch of your > > machine is x86_64. Set CROSS_COMPILE to a suitable cross compiler. > > Stop. > > > > Can you make it work on both i386 and x86_64 without complaining? It > > looks like that is the intent. > > I messed up the variable names: defined HOST_ARCH, but used HOSTARCH in > the check. Fixing that makes it work like it should. (I'll go with > HOSTARCH since that's where I took the "uname -m | sed" call from). > > > Also I'm not sure we need to define vars for all the tools, so you > > could perhaps drop those that are not needed. > > Looks like we don't need anything except CC and OBJCOPY, I'll drop the > rest. OK great. Regards, Simon
Re: [PATCH 1/3] binman: Support cross-compiling test files to x86
On 05/09/2020 19:36, Simon Glass wrote: > For me this fails on x86_64, complaining for example: > > Exception: Error 2 running 'make -C /tmp/binmant.d17vfu3j/elftest -f > /scratch/sglass/cosarm/src/third_party/u-boot/files/tools/binman/test/Makefile > SRC=/scratch/sglass/cosarm/src/third_party/u-boot/files/tools/binman/test/': > /scratch/sglass/cosarm/src/third_party/u-boot/files/tools/binman/test/Makefile:14: > *** Binman tests need to compile to x86, but the CPU arch of your > machine is x86_64. Set CROSS_COMPILE to a suitable cross compiler. > Stop. > > Can you make it work on both i386 and x86_64 without complaining? It > looks like that is the intent. I messed up the variable names: defined HOST_ARCH, but used HOSTARCH in the check. Fixing that makes it work like it should. (I'll go with HOSTARCH since that's where I took the "uname -m | sed" call from). > Also I'm not sure we need to define vars for all the tools, so you > could perhaps drop those that are not needed. Looks like we don't need anything except CC and OBJCOPY, I'll drop the rest.
Re: [PATCH 1/3] binman: Support cross-compiling test files to x86
Hi Alper, On Sat, 5 Sep 2020 at 08:44, Alper Nebi Yasak wrote: > > These test files are currently "intended for use on x86 hosts", but most > of the tests using them can still pass when cross-compiled to x86 on an > arm64 host. > > This patch enables non-x86 hosts to run the tests by specifying a > cross-compiler via CROSS_COMPILE. The list of variables it sets is taken > from the top-level Makefile. It would be possible to automatically set > an x86 cross-compiler with a few blocks like: > > ifneq ($(shell i386-linux-gnu-gcc --version 2> /dev/null),) > CROSS_COMPILE = i386-linux-gnu- > endif > > But it wouldn't propagate to the binman process calling this Makefile, > so it's better just raise an error and expect 'binman test' to be run > with a correct CROSS_COMPILE. > > Signed-off-by: Alper Nebi Yasak > --- > > tools/binman/test/Makefile | 28 +++- > 1 file changed, 27 insertions(+), 1 deletion(-) For me this fails on x86_64, complaining for example: Exception: Error 2 running 'make -C /tmp/binmant.d17vfu3j/elftest -f /scratch/sglass/cosarm/src/third_party/u-boot/files/tools/binman/test/Makefile SRC=/scratch/sglass/cosarm/src/third_party/u-boot/files/tools/binman/test/': /scratch/sglass/cosarm/src/third_party/u-boot/files/tools/binman/test/Makefile:14: *** Binman tests need to compile to x86, but the CPU arch of your machine is x86_64. Set CROSS_COMPILE to a suitable cross compiler. Stop. Can you make it work on both i386 and x86_64 without complaining? It looks like that is the intent. Also I'm not sure we need to define vars for all the tools, so you could perhaps drop those that are not needed. Regards, Simon