Marc-André Lureau <marcandre.lur...@gmail.com> writes: > Hi > > On Tue, Jul 18, 2017 at 4:16 AM, Alex Bennée <alex.ben...@linaro.org> wrote: >> >> Marc-André Lureau <marcandre.lur...@gmail.com> writes: >> >>> Hi >>> >>> On Mon, Jul 17, 2017 at 11:10 PM, Philippe Mathieu-Daudé >>> <f4...@amsat.org> wrote: >>>> Applied using the Coccinelle semantic patch >>>> scripts/coccinelle/use_osdep.cocci >>>> >>>> Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org> >>>> --- >>>> tests/tcg/alpha/test-cond.c | 2 +- >>>> tests/tcg/alpha/test-ovf.c | 2 +- >>>> 2 files changed, 2 insertions(+), 2 deletions(-) >>>> >>> >>> I think those do not include osdep.h >>> >>> (sigh, tests/tcg would need some love ;) >> >> Pranith has had a couple of revs at this: >> >> Subject: [PATCH v5 00/19] Cleanup of TCG tests >> Date: Thu, 1 Dec 2016 00:14:14 -0500 >> Message-Id: <20161201051433.17168-1-bobby.pr...@gmail.com> >> >> We have the cross-compilers available as a fallback via docker although >> not every one can seamlessly use it for building stuff. Is getting a >> working cross-compiler setup too much of a hurdle fore those that want >> to build cross-arch tests? > > Yes, I also did some experiments in cleaning up tests/tcg > (https://github.com/elmarco/qemu/tree/tcg-tests) > > The trouble is I don't see an official/automated way to run tests/tcg > tests. Which cross-compiler should I use? When I played with this, > they all had various quirks, on Fedora, Debian or crosstool-ng.
Debian at least have put a lot of work into getting cross-compilers installed as part of the native distro with good multi-arch support. We now use plain Debian 9 for most of the QEMU cross compiles - a few older architectures still need Debian 8 with the emdebian overlay. > I haven't looked at the docker tests, is this running tests/tcg test > somehow? No but as tests/tcg are all pretty simple and have less cross-compile dependencies than QEMU itself it is fairly trivial to invoke docker to do a cross-build for you in-place. e.g.: docker run --rm -t -u (id -u) -v (pwd):(pwd) -w (pwd) qemu:debian-armhf-cross arm-linux-gnueabihf-gcc tests/tcg/hello-arm.c This is perhaps a bad example as there is a bit-rot that needs fixing. The alternative is to mine the users PATH for fairly standard cross-compile prefixes which work at least on Debian systems. I recently submitted a patch to RISU that allowed you to use either in its build-all-arches script: https://git.linaro.org/people/peter.maydell/risu.git/tree/build-all-archs -- Alex Bennée