<p>I believe you indeed need to specify some ARM-related things when buliding LLVM and LLVM-gcc (if you are compiling it from source).  Below are the configurations I used, I believe.  I may have tweaked them a bit, but this was the general idea:</p>
<p>Configure llvm:<br />  ../llvm-2.9/configure --target=arm-none-linux-gnueabi --prefix=/home/grwright1/Research/llvm/llvm-install --with-llvmgccdir=/home/grwright1/Research/llvm/llvm-gcc --disable-multilib --disable-bootstrap --disable-optimized --enable-shared --enable-assertions --enable-languages=c,c++<br /><br />Configure llvm-gcc:<br />  ../llvm-gcc-4.2-2.9.source/configure --target=arm-none-linux-gnueabi --program-prefix=llvm-arm- --prefix=/home/grwright1/Research/llvm/llvm-gcc/install -with-sysroot=/home/grwright1/Research/llvm/arm-2010q1/arm-none-linux-gnueabi/libc --with-gnu-ld=/home/grwright1/Research/llvm/arm-2010q1/bin/arm-none-linux-gnueabi-ld --with-gnu-as=/home/grwright1/Research/llvm/arm-2010q1/bin/arm-none-linux-gnueabi-as --with-gnu-ar=/home/grwright1/Research/llvm/arm-2010q1/bin/arm-none-linux-gnueabi-ar --enable-llvm=/home/grwright1/Research/llvm/llvm-obj --disable-optimized --disable-multilib --disable-bootstrap --disable-shared --enable-checking --enable-languages=c,c++</p>
<p><br />-Griffin</p>
<p> </p>
<p>On Tue, 14 Jun 2011 13:53:13 -0400, D S Khudia <daya.khudia@gmail.com> wrote:</p>
<blockquote style="padding-left: 5px; border-left: 2px solid #1010ff; margin-left: 5px; width: 100%;"><span style="color: #000000;"><span style="font-family: verdana,sans-serif;">Thanks for your reply.<br /></span></span>
<div><span class="Apple-style-span" style="font-family: verdana,sans-serif;"><br /></span></div>
<div><span class="Apple-style-span" style="font-family: verdana,sans-serif;">I have a normal (../configure --enable-profiling --disable-optimized --enable-assertions) llvm debug+profile+assert build. <br /> </span></div>
<div>
<div class="gmail_quote">I am generating llvm-bitcode using following commands.</div>
<div class="gmail_quote"></div>
<div class="gmail_quote">llvm-gcc -DLINUX_i386 -DSPEC_CPU2000 -O3 -emit-llvm 186.crafty/src/valid.c -c -o 186.crafty/src/valid.bc </div>
<div class="gmail_quote">---</div>
<div class="gmail_quote"></div>
<div class="gmail_quote">llvm-link 186.crafty/src/*.bc -o 186.crafty/186.crafty.rel.bc</div>
<div class="gmail_quote"></div>
<div class="gmail_quote">and finally:</div>
<div class="gmail_quote"></div>
<div class="gmail_quote">llc -march=arm 186.crafty/186.crafty.rel.bc -o 186.crafty/186.crafty.m5arm.s</div>
<div class="gmail_quote"></div>
<div class="gmail_quote">And there is not inline assembly in my C code.</div>
<div class="gmail_quote"></div>
<div class="gmail_quote">Should I somehow specify arm related options to llvm while building llvm?</div>
<div class="gmail_quote"></div>
<div class="gmail_quote">Thanks</div>
<div class="gmail_quote">Daya</div>
<div class="gmail_quote"></div>
<div class="gmail_quote">On Tue, Jun 14, 2011 at 1:34 PM, Anton Korobeynikov <span><<a href="mailto:anton@korobeynikov.info">anton@korobeynikov.info</a>></span> wrote:<br />
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello<br />
<div class="im"><br /> > Command => llc -march=arm 186.crafty/186.crafty.rel.bc -o<br /> > 186.crafty/186.crafty.m5arm.s<br /> > Error =>  LLVM ERROR: Couldn't allocate output reg for constraint '{cx}'!<br /> ><br /> > Have anyone seen this before?</div>
It seems you're feeding x86-specific LLVM IR to arm backend. Please<br /> don't do that.<br /> <span style="color: #888888;"><br /> --<br /> With best regards, Anton Korobeynikov<br /> Faculty of Mathematics and Mechanics, Saint Petersburg State University<br /> </span></blockquote>
</div>
</div>
</blockquote>
<p> </p>