<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi, <div class=""><br class=""></div><div class="">I want to explorer affection of compiler on low power. </div><div class="">For the project background, I tend to process this work via LLVM, rather than GCC. And the Target is ARM.</div><div class=""><br class=""></div><div class="">For this purpose, clang(3.2) + arm-gcc + simplescalar-arm(and panalyzer) seems to be a good choice. But I encounter several problems in the processing of setup the environment.</div><div class=""><br class=""></div><div class="">----------------------------------</div><div class="">1. Firstly, arm toolchain is built via ‘buildroot-2012.08’: arm-linux-gcc, I compile MiBench step by step or on one step as follows:</div><div class="">clang -emit-llvm —target=arm -O3 -c susan.c -o susan.bc</div><div class="">llc -march=arm -filetype=asm susan.bc -o susan.s</div><div class="">arm-linux-gcc -static -L/arm-toolchain/lib/path susan.s -lm -o susan.out</div><div class="">or:</div><div class="">clang -static -gcc-toolchain /arm-toolchain/path -target arm-linux -sysroot=/arm-toolchain/sysroot/path susan.c -o susan.out -lm</div><div class=""><br class=""></div><div class="">but I encounter the problem about ‘uclibc’. There is no ‘_IO_getc’ in libc.a of uclibc, but clang&llc compile ‘getc’ in C source to ‘_IO_getc’ in assembler.</div><div class="">I tried to use newer version of buildroot which support ‘glibc’ (like 'buildroot-2014.11'), but the newer version doesn’t support to set the ’Target ABI’ to ‘OABI’, someone says OABI rather EABI is necessary if want the executable run on simplescalar. So I don’t know how to solve this issue.</div><div class=""><br class=""></div><div class="">----------------------------------</div><div class="">2. Then, I change the toolchain from ‘buildroot’ to ’Sourcery CodeBench’: arm-none-linux-gnueabi-gcc, I compile ’susan’ in MiBench as the above commands.</div><div class="">I get the executable application (susan.out) successfully. That is to say, I can cross compile arm application via clang/llc/arm-none-linux-gnueabi-gcc!!!</div><div class="">However, I get a fatal error when I run susan.out on simplescalar-arm:</div><div class="">fatal: non-specultative fault (2) detected @ XXXXXXX</div><div class=""><br class=""></div><div class="">I searched the reason via google, someone says that the toolchain is too new for simplescalar-arm. </div><div class="">It seems this method is failure, as well.</div><div class=""><br class=""></div><div class="">----------------------------------</div><div class="">3. I tried several other arm-toolchains, such as arm-linux-gcc-4.4.3 from FriendlyARM, arm-gcc-2.95.3 recommended by simplescalar-arm official, but I encountered the similar problems as the above.</div><div class=""><br class=""></div><div class="">----------------------------------</div><div class="">4. I find a same issue in llvmdev maillist: <a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-September/053740.html" class="">http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-September/053740.html</a> (And also some other similar topics via Google)</div><div class="">The topic is “clang cross compilation and SimpleScalar simulation”.</div><div class="">But there is no solution in the issue.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">My Question is:</div><div class="">1. If I do compiler related low power experiment via llvm(3.2) + arm-gcc + simplescalar-arm(and panalyzer), how could I setup the environment?? Does anyone has the experience and can give some instructions?</div><div class="">2. If I process the job via LLVM + ARM, but not simplescalar-arm, is there any other simulator to run arm application?? The simulator should has a mature power model.</div><div class=""><br class=""></div><div class="">Thanks</div><div class="">-Shiqiang</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>