[PATCH] D29030: [LNT] Add cross-compilation support to 'lnt runtest test-suite'

Kristof Beyls via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 23 07:40:59 PST 2017


kristof.beyls created this revision.
Herald added a subscriber: aemerson.

This adds cross-compilation support for the cmake+lit-based way to build and run the test-suite, by letting users specify a cmake toolchain file if they want to cross-compile.

The advantage of doing so over other ways to enable cross-compiling is:

- It is in line with the recommended cmake way to cross-compile a project: using a toolchain file.
- Fewer command line options need to be given to lnt runtest test-suite.

Regression tests and documentation still needs to be written for this, but I first wanted to get feedback on this approach before spending more time on it.

FWIW, an actual lnt runtest test-suite invoke command that I use to cross-compile and cross-test the test-suite on for an aarch64-target is:

  lnt runtest test-suite \
    --test-suite ~/dev/llvm.org/test-suite -j40 \
    --cppflags="-O3" \
    --run-under=$HOME/dev/aarch64-emu/aarch64-qemu.sh \
    --use-lit ~/dev/llvm.org/build/bin/llvm-lit \
    --cross-compiling-toolchain-file=$HOME/dev/llvm.org/clang_aarch64_linux.cmake

With the content of clang_aarch64_linux.cmake being:

  set(CMAKE_SYSTEM_NAME Linux )
  set(triple aarch64-linux-gnu )
  set(CMAKE_C_COMPILER /home/kribey01/dev/llvm.org/build/bin/clang )
  set(CMAKE_C_COMPILER_TARGET ${triple} )
  set(CMAKE_CXX_COMPILER /home/kribey01/dev/llvm.org/build/bin/clang++ )
  set(CMAKE_CXX_COMPILER_TARGET ${triple} )
  set(CMAKE_SYSROOT /home/kribey01/dev/aarch64-emu/sysroot-glibc-linaro-2.23-2016.11-aarch64-linux-gnu )
  set(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN /home/kribey01/dev/aarch64-emu/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu)
  set(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN /home/kribey01/dev/aarch64-emu/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu)

I intend to put the above details in the documentation, if we decide this is the right approach to take.

What do you think?


https://reviews.llvm.org/D29030

Files:
  lnt/tests/test_suite.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29030.85387.patch
Type: text/x-patch
Size: 5148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170123/c7eb2b8e/attachment.bin>


More information about the llvm-commits mailing list