[cfe-dev] _Unwind_Exception use by libcxxabi on linux
Howard Hinnant
hhinnant at apple.com
Sat Feb 18 12:01:02 PST 2012
On Feb 18, 2012, at 2:42 PM, Jeffrey Yasskin wrote:
> Trying to compile libcxxabi on Linux, I get:
>
> In file included from ../src/cxa_exception.cpp:21:
> ../src/cxa_exception.hpp:63:9: error: unknown type name '_Unwind_Exception'
>
> It looks like on Darwin, clang's unwind.h forwards to
> /usr/include/unwind.h, which defines _Unwind_Exception. However, on
> linux (ubuntu 11.10), unwind.h does not forward to
> /usr/lib/gcc/x86_64-linux-gnu/4.6/include/unwind.h where
> _Unwind_Exception is defined.
> /usr/lib/gcc/x86_64-linux-gnu/4.6/include/ is also not on clang's
> default search path on linux, probably to avoid including files like
> *intrin.h that live there.
>
> Is the right fix to copy _Unwind_Exception from darwin's unwind.h into
> clang's unwind.h? Provide it from libcxxabi? Something else?
I would prefer to not provide it from libcxxabi as the definition of _Unwind_Exception seems to me to belong in the unwind library. So my vote would be to put it in clang's unwind.h (in the non-__APPLE__ part of course).
I'm guessing you're next going to hit a similar problem from the lack of prototypes such as:
extern _Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception* exception_object);
Howard
More information about the cfe-dev
mailing list