<div dir="auto">Glad to help. CCing ML for the record. <br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On Aug 26, 2017 12:24 PM, "ROHIT KUMAR" <<a href="mailto:rohitpoddar92@gmail.com">rohitpoddar92@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">It is as you mentioned. The missing return statement in a function very much similar to your example. Adding it fixed the issue<div><br></div><div>So, it seems Clang is a little too strict as compared to GCC. I faced many issues earlier and all of them ended up being related to flags, I didn't expect the issue to be this simple. </div><div><br></div><div>Thanks for your help</div><div><div><br></div><div><br><div><br></div><div><br></div></div></div></div><div class="elided-text"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 26, 2017 at 3:14 PM, Raphael Isemann <span dir="ltr"><<a href="mailto:teemperor@gmail.com" target="_blank">teemperor@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On a side note that is probably too simple for the ML: Did you check<br>
for missing return statements in the called/callee function? For a<br>
missing return clang generates SIGILL while GCC is returning something<br>
ABI-dependent IIRC.<br>
<br>
E.g. this causes SIGILL on clang and runs just fine on GCC:<br>
```<br>
int foo(int i) {<br>
 if(i) {<br>
   return 1;<br>
 }<br>
}<br>
<br>
int main() {<br>
 foo(0);<br>
}<br>
```<br>
<br>
- Raphael<br>
<div><div class="m_-508662087859759616h5"><br>
2017-08-26 10:34 GMT+02:00 ROHIT KUMAR via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>>:<br>
> Hey folks,<br>
><br>
> I am migrating our huge Android code base from GCC(Eclipse IDE) to<br>
> clang(Android Studio).<br>
><br>
> Error: SIGILL (signal SIGILL: illegal instruction)<br>
><br>
> At a weird line in the code, I am getting this error. which points to a<br>
> closing curly bracket of an if condition. After googling, I am assuming it<br>
> is some kind of architecture flag issue. I am using same flags which were<br>
> used for GCC.<br>
><br>
> Note: I am currently working on Arm build.<br>
><br>
> Here are the architecture flags for ARM7:<br>
><br>
> -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mtune=cortex-a8 -mthumb<br>
> -DTARGET_THUMB2<br>
><br>
> Can anyone help me debug this issue? Is there any issue with the flags with<br>
> clang?<br>
><br>
> Thanks,<br>
> Rohit Kumar<br>
><br>
><br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
><br>
</blockquote></div><br></div>
</div></blockquote></div><br></div></div>