<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">After a few hours of digging and tracing through the assembly code, the problem appears to be in the libunwind implementation used by ellcc and has nothing to do with the code generated by llvm. The getcontext function does not appear to be behaving correctly. <div><br></div><div>-James</div><div><br></div><div><div><br><div><div>On Dec 12, 2013, at 2:19 PM, James Gregurich <<a href="mailto:bayoubengal@mac.com">bayoubengal@mac.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>I discovered that fundamental exception handling is not functioning for me when building code for i386 linux and ppc linux. The programs terminate with unhanded exception errors when there are clearly catch handlers provided. I’m stepping through the assembly to see what might be going wrong, but I don’t yet have a clue yet why it is failing to find the catch handlers. Anyone have any useful insight into what might be happening? This is pretty fundamental functionality to be failing. I have a sneaky suspicion the problem lies in the interaction between clang and the binutils since it works fine if I target darwin with Apple’s clang.</div><div><br></div><div><br></div><div>compiler invocation:</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">ecc-g++ -target ppc-ellcc-linux   test.cpp -o test.exe -lc++ -lUnwind -m32</div></div><div><span style="font-family: Menlo; font-size: 11px;">ecc-g++ -target i386-ellcc-linux   test.cpp -o test.exe -lc++ -lUnwind</span></div><div><br></div><div>clang version:</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">ecc-g++ --version</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">clang version 3.5 (trunk)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">Target: ecc</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">Thread model: posix</div></div><div><br></div><div><br></div><div><br></div><div>sample that fails:</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span style="color: #78492a">#include</span><exception></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><span style="color: #bb2ca2">int</span> main(<span style="color: #bb2ca2">int</span>, <span style="color: #bb2ca2">char</span>**)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">{</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   <span style="color: #bb2ca2">try</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">      <span style="color: #bb2ca2">throw</span> std::exception();</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   <span style="color: #bb2ca2">catch</span>(std::exception& e)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">      <span style="color: #bb2ca2">return</span> -<span style="color: #272ad8">1</span>;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">   }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(187, 44, 162);"><span style="">   </span>return<span style=""> </span><span style="color: #272ad8">0</span><span style="">;</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">}</div></div></div>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></div></div></body></html>