__Unwind_Resume on Mac C++ Compiler

__Unwind_Resume on Mac C++ Compiler

I am currently evaluating the Mac C++ compiler for porting reasons. One of our libraries is not linking because it cannot find the symbol __Unwind_Resume. I've seen elsewhere on the net that you get this result when using gcc in places where g++ is required. I am using the (I assume) analagous icc for all C code and icpc for all C++ code. I'm using the standard library via -lstdc++. Is there some nuance to using this compiler that I'm missing?

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

With recent versions of g++ (all those which I have in my icpc 9.1 installations),this functionwas supplied in libgcc_eh.a . If this library is present in your g++ installation, it should be linked when -lgcc_eh follows after the library which requires it on the link line.

In principle, if you use icpc to drive the link, it should happen automatically. If you use gcc or ifort (or ld) as the link command, and so require an explicit -lstdc++, you would also require -lgcc_eh if your libraryuses exception handling.

Was this library built by a compiler other than icpc, or the g++ on which your icpc installation is based? Thisfunction used to be most commonly supplied by libunwind, whichwould not bepresent inrecent icpc or g++ versions.

I added -lgcc_s.1 (I don't have gcc_eh on my machine) to my linker command and it worked. The part that confused me about this route is that __Unwind_Resume exists in other librariesin my /usr/lib path and adding them to my linker command did not resolve the issue. For example, nm reports that libSystem.dylib has this symbol defined and I added it to the command and it didn't resolve the issue.

To answer your question, every .c file was built using icc and every .cpp file was built with icpc.

As a side note, I do remember using libunwind in the Linux port.

Thanks for your help.

Leave a Comment

Please sign in to add a comment. Not a member? Join today