<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’m using rust head version that currently use llvm 3.7 … </div><div class=""><br class=""></div><div class="">Thanks.</div><div class=""><br class=""></div><div class="">Frédéric.</div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On 11 Sep 2015, at 13:29, Bruce Hoult <<a href="mailto:bruce@hoult.org" class="">bruce@hoult.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">What LLVM version are you using?<div class=""><br class=""></div><div class="">There were some bugs around switching ARM/Thumb mode on ARMv4 fixed in 3.6.<br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Sep 11, 2015 at 1:20 PM, Frédéric Richez <span dir="ltr" class=""><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">I’m tying to run a rust application on armv4 architecture (arm720tdmi).<div class="">Rust is using llvm to generate native code.</div><div class="">Some programs are running well on the target but for more complex applications I receive a Illegal instruction :</div><div class=""><p style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:19px" class="">gdb disassembling the core dump file gives :</p><pre style="overflow:auto;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace;font-size:14px;color:rgb(34,34,34);line-height:19px" class=""> 0x401e41dc <+0>: push {r11, lr}
0x401e41e0 <+4>: mov r11, sp
0x401e41e4 <+8>: sub sp, sp, #8
0x401e41e8 <+12>: ldr r0, [r0]
0x401e41ec <+16>: str r0, [sp, #4]
0x401e41f0 <+20>: mov r0, r1
0x401e41f4 <+24>: ldr r1, [sp, #4]
=> 0x401e41f8 <+28>: blx r1
0x401e41fc <+32>: and r0, r0, #1
0x401e4200 <+36>: and r0, r0, #1
0x401e4204 <+40>: mov sp, r11
0x401e4208 <+44>: pop {r11, lr}
0x401e420c <+48>: bx lr</pre><div class=""><span style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:19px;background-color:rgb(255,255,255)" class="">blx instruction is available from ARM architecture v5 and above</span><font color="#222222" face="Helvetica, Arial, sans-serif" class=""><span style="font-size:14px;line-height:19px" class="">…</span></font></div></div><div class=""><span style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:19px;background-color:rgb(255,255,255)" class=""><br class=""></span></div><div class=""><span style="background-color:rgb(255,255,255)" class=""><font color="#222222" face="Helvetica, Arial, sans-serif" class=""><span style="font-size:14px;line-height:19px" class="">After lot of investigations I found where llvm is generating this </span></font></span><font color="#222222" face="Helvetica, Arial, sans-serif" class=""><span style="font-size:14px;line-height:19px" class="">instruction :</span></font></div><div class=""><a href="https://github.com/rust-lang/llvm/blob/168f91ce5cbf8933e47f339911f0f46a48714852/lib/Target/ARM/ARMFastISel.cpp#L2395" target="_blank" class="">https://github.com/rust-lang/llvm/blob/168f91ce5cbf8933e47f339911f0f46a48714852/lib/Target/ARM/ARMFastISel.cpp#L2395</a></div><div class=""><span style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:19px;background-color:rgb(255,255,255)" class="">UseReg variable is true causing ARMSelectCallOp function to set a BLX instruction that is not supported on armv4 :-(</span></div><div class=""><span style="color:rgb(34,34,34);font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:19px;background-color:rgb(255,255,255)" class=""><br class=""></span></div><div class=""><font color="#222222" face="Helvetica, Arial, sans-serif" class=""><span style="font-size:14px;line-height:19px;background-color:rgb(255,255,255)" class="">Could you help me to solve this ? </span></font></div><div class=""><font color="#222222" face="Helvetica, Arial, sans-serif" class=""><span style="font-size:14px;line-height:19px;background-color:rgb(255,255,255)" class=""><br class=""></span></font></div><div class=""><font color="#222222" face="Helvetica, Arial, sans-serif" class=""><span style="font-size:14px;line-height:19px;background-color:rgb(255,255,255)" class="">Many thanks</span></font></div><span class="HOEnZb"><font color="#888888" class=""><div class=""><font color="#222222" face="Helvetica, Arial, sans-serif" class=""><span style="font-size:14px;line-height:19px;background-color:rgb(255,255,255)" class=""><br class=""></span></font></div><div class=""><font color="#222222" face="Helvetica, Arial, sans-serif" class=""><span style="font-size:14px;line-height:19px;background-color:rgb(255,255,255)" class="">Frédéric.</span></font></div><div class=""><br class=""></div></font></span></div><br class="">_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
<br class=""></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>