[LLVMdev] Cross Compiling LLVM's test-suite

178 views
Skip to first unread message

Romaric Jodin

unread,
Apr 2, 2015, 10:54:55 AM4/2/15
to llv...@cs.uiuc.edu, Nicolas Brunie
Hi all,

I'm working in a company to port LLVM on their own processor.
I'm trying to run the test-suite, but it seems that it is usually run directly on the processor which is tested. In my case, I cannot run it on the processor, but I have a simulator on which I would like to run the test-suite.
Also, it seems to me that the test-suite start by compiling some tools that have to be run locally (so on x86), and then the test-suite compile all the tests, but with the same compiler as the one used to compile the tools.

My questions are :
- Is it possible to compile the tools of the test-suite and all the tests with a different compiler?
- Is it possible not to run the tests directly on the machine but on a simulator?

Best Regards,
Romaric
_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Renato Golin

unread,
Apr 2, 2015, 12:15:34 PM4/2/15
to Romaric Jodin, Nicolas Brunie, LLVM Dev
On 2 April 2015 at 15:51, Romaric Jodin <rjo...@kalray.eu> wrote:
> - Is it possible to compile the tools of the test-suite and all the tests with a different compiler?

It is. Check CC / ORIGINAL_CC / TARGET_CC in the Makefiles.

> - Is it possible not to run the tests directly on the machine but on a simulator?

Yes, see RunSafely.sh. It has options for remote testing, or QEMU user
emulation.

I have not tried that myself, but I know it has been done in the past
and it should still be possible.

cheers,
--renato

James Molloy

unread,
Apr 2, 2015, 12:24:58 PM4/2/15
to Romaric Jodin, llv...@cs.uiuc.edu, Nicolas Brunie
Hi  Romaric,

Yes, you can do this. I'm working on reworking the test-suite to make it substantially easier to do, but for the moment it does still work.

There is a "RUNUNDER" argument to the makefiles that you can use to prefix any command with your simulator. We find the easiest way to do it is to use binfmt_misc to ensure any ELF files compiled for your target get run via your simulator. Then the test-suite just works out of the box.

Hope this helps,

James

Daniel Sanders

unread,
Apr 2, 2015, 12:49:06 PM4/2/15
to Renato Golin, Romaric Jodin, Nicolas Brunie, LLVM Dev
In lnt (http://llvm.org/docs/lnt/) you can run the test-suite with 'lnt runtest nt' and appropriate options. The --qemu-user-mode=qemu-command option will use the makefiles in the right way for qemu's linux user mode. --qemu-flag can be used to pass additional options. It should be fairly easy to adapt lnt's qemu support to other simulators if you need to.

I should mention that I typically point --qemu-user-mode at a wrapper script that sets some environment variables (QEMU_LD_PREFIX and LD_LIBRARY_PATH) before calling qemu itself. Otherwise my simulated program can't find the target libraries.
Reply all
Reply to author
Forward
0 new messages