tools build issue with lnt in cross platform testing

I want to get lnt to use qemu for the execution.

In that case, RHOST= is not set.

But I change the Arch because I am going to run in cross mode.

Then I'm setting RUNUNDER to be a script which runs qemu.

In this case it builds timeit-target as a Mips which fails because this is running on x86.

~/mysandbox/bin/lnt runtest nt --sandbox ~/mysandbox --cc /local/llvmpb_a/install/bin/clang --cflag "-target mipsel-linux-gnu -EL -mips16 -gcc-toolchain /mips/arch/overflow/codesourcery/mips-linux-gnu/pro/release/2011.09-90/Linux -fPIC" --test-suite ~/workspace/test-suite -j 1 --only-test SingleSource/UnitTests/Mips --make-param=MIPSARCH=mips16 --llvm-arch=Mips --make-param=RUNUNDER=/home/rkotler/test-suite/qemusample/

Seems like this is just a bug in the rules for building the tools but maybe there is a way around this?

One other thing is that I'm using a script for RUNUNDER but would like to just invoke qemu and pass the parameters through lnt. Is there a way to do this?

The issues seems to be this line in the tools Makefile

timeit-target: timeit.c

It should not add target flags if we are simulating the target on the host.

By running the make for the tools and removing the target flags from
that and then run the make for the test, everything worked.

I'm not sure the cleanest way to fix the Makefile in the tools directory so that it does not add target flags when you want to use this with a simulator.

make "tools" "TARGET_LLVMGCC=/local/llvmpb_a/install/bin/clang"

"make" "-k" "TARGET_LLVMGCC=/local/llvmpb_a/install/bin/clang"
mipsel-linux-gnu -EL -mips16 -gcc-toolchain

"SingleSource/UnitTests/Mips" "-j" "1" "report" "report.simple.csv"