<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=""><div class="">I am sorry that I made a mistake in the last email: I choose llvm-3.4.2, not llvm-3.2.</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class="">My best guess here would be you're including headers from your host<br class="">platform (due to a misunderstood --sysroot), rather than the uclibc<br class="">ones.<br class=""></blockquote></div><div class="">You are right here, I add a ‘-I’ option in clang command, and compile the application successfully:</div><div class=""><div class=""><i class=""><span style="font-size: 12px;" class="">clang -emit-llvm <span style="background-color: rgb(255, 250, 165);-evernote-highlight:true;" class="">-I/my/toolchain/path/include</span> -std=c89 —target=arm -O3 -c susan.c -o susan.c</span></i></div><div class=""><i class=""><span style="font-size: 12px;" class="">llc -march=arm -filetype=asm susan.bc -o susan.s</span></i></div><div class=""><i class=""><span style="font-size: 12px;" class="">arm-linux-gcc -static susan.s -lm -o susan.out</span></i></div></div><div class=""><br class=""></div><div class="">Yeah, simplescalar is too old to as a simulator in low power research. However, I cannot find another efficient simulator.</div><div class="">Fortunately, I make the whole environment work well so far. (I simply tested ’susan’ and ‘qsort’ in MiBench).</div><div class=""><br class=""></div><div class="">By the way, do u have any other suggestions to explorer low power options?(via LLVM and arm-gcc, and any other simulator & power model)</div><div class="">Thanks!</div><div class=""><br class=""></div><div class="">-Shiqiang</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">在 2015年5月7日,10:46,Tim Northover <<a href="mailto:t.p.northover@gmail.com" class="">t.p.northover@gmail.com</a>> 写道:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" class="">For this purpose, clang(3.2) + arm-gcc + simplescalar-arm(and panalyzer)<br class="">seems to be a good choice.<br class=""></blockquote><br class="">3.2 is a very old release in LLVM terms. I doubt anyone here really<br class="">knows all the details about it any more. You'd be much better off<br class="">using the most recent stable release (3.6) or even trunk.<br class=""><br class=""><blockquote type="cite" 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.<br class=""></blockquote><br class="">The current source doesn't seem to randomly create calls to _IO_getc.<br class="">My best guess here would be you're including headers from your host<br class="">platform (due to a misunderstood --sysroot), rather than the uclibc<br class="">ones.<br class=""><br class=""><blockquote type="cite" class="">someone says OABI rather EABI is necessary if want the executable run on simplescalar. So I don’t know how to solve this issue.<br class=""></blockquote><br class="">This is really worrying too: no-one uses OABI any more. It's virtually<br class="">untested on linux, as far as I know (though probably kept from<br class="">complete bit-rot by the fact that iOS uses a similar ABI).<br class=""><br class=""><blockquote type="cite" class="">However, I get a fatal error when I run susan.out on simplescalar-arm:<br class="">fatal: non-specultative fault (2) detected @ XXXXXXX<br class=""></blockquote><br class="">This could well happen if your simplescalar program isn't expecting<br class="">gnueabi (or any eabi) code.<br class=""><br class=""><blockquote type="cite" class="">arm-gcc-2.95.3 recommended by simplescalar-arm official<br class=""></blockquote><br class="">That's a massive red flag. GCC 2.95 was released in 1999 (2.95.3 in<br class="">2001). Those versions are truly ancient; they were obsolete before<br class="">Clang was even a glint in Reid Spencer's eye (unfairly picking the<br class="">first clang commit -- it's all Reid's fault, QED).<br class=""><br class=""><blockquote type="cite" 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?<br class=""></blockquote><br class="">I suspect you're in for a world of pain. Both simplescalar and<br class="">LLVM-3.2 appear to be too old to be viable these days, which means<br class="">you're probably going to have to hack on one or both code-bases to<br class="">have a hope of producing anything functional.<br class=""><br class="">Tim.<br class=""></div></blockquote></div><br class=""></body></html>