[cfe-dev] catch handlers not working on linux

James Gregurich bayoubengal at mac.com
Thu Dec 12 15:39:06 PST 2013


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. 

-James


On Dec 12, 2013, at 2:19 PM, James Gregurich <bayoubengal at mac.com> wrote:

> 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.
> 
> 
> compiler invocation:
> 
> ecc-g++ -target ppc-ellcc-linux   test.cpp -o test.exe -lc++ -lUnwind -m32
> ecc-g++ -target i386-ellcc-linux   test.cpp -o test.exe -lc++ -lUnwind
> 
> clang version:
> 
> ecc-g++ --version
> clang version 3.5 (trunk)
> Target: ecc
> Thread model: posix
> 
> 
> 
> sample that fails:
> 
> #include<exception>
> 
> int main(int, char**)
> {
> 
>    try
>    {
>       throw std::exception();
>    }
>    catch(std::exception& e)
>    {
>       return -1;
>    }
> 
> 
>    return 0;
> }
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131212/4f154532/attachment.html>


More information about the cfe-dev mailing list