[LLVMdev] Running cross compiled binaries for ARM on gem5

Silky Arora silkyar at umich.edu
Sat Mar 9 16:26:14 PST 2013


I am trying to optimize some benchmarks using LLVM and run them on gem5 simulator (build for ARM). I am using Sourcery Codebench cross-compiler for ARM on my x-86 machine.
My steps up till now have been using the following commands.

1. clang -static -emit-llvm -march=armv7-a -mfloat-abi=soft -target arm-elf a.cpp -c  -integrated-as  \ 
 --sysroot=/home/silky/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/arm-none-linux-gnueabi/libc \
 -I/home/silky/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/arm-none-linux-gnueabi/include/c++/4.7.2/  \
-I/home/silky/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/arm-none-linux-gnueabi/include/c++/4.7.2/arm-none-linux-gnueabi/armv4t/ -o a.bc

2. llc -O3 -o a.s -march=arm a.bc

3. arm-none-linux-gnueabi-g++ -static a.s -o a_st

To run the final executable on gem5, I use

4. /gem5$   build/ARM/gem5.debug configs/example/se.py -c /home/silky/mbench/vect/a_st

This results in a page fault -

Global frequency set at 1000000000000 ticks per second
0: system.remote_gdb.listener: listening for remote gdb #0 on port 7000
info: Entering event queue @ 0.  Starting simulation...
panic: Page table fault when accessing virtual address 0xfffffff4
 @ cycle 2509500
[invoke:build/ARM/sim/faults.cc, line 70]

Trace :
9405000: system.cpu T0 : 0x8118    :   bl                       : IntAlu :  D=0x000000000000811c
gem5.debug: build/ARM/mem/request.hh:514: Addr Request::getPC() const: Assertion `privateFlags.isSet(VALID_PC)' failed.

Most of the search results talk about the executable not being statically compiled. Could anyone please tell me if any of the compilation commands is incorrect.
Is there any other way I can check the executable generated is not buggy?

Thanks and Regards,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130309/8a722bf1/attachment.html>

More information about the llvm-dev mailing list