_Unwind_Exception use by libcxxabi on linux

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?

Jeffrey

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

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 think it is to define it on our unwind.h. The rationale for that
header is that unwind.h is an system header on OS X, but a gcc header on
linux.

We aim to provide a drop in replacement for gcc, so we should provide a
unwind.h too on systems where it is provided by gcc.

Jeffrey

Cheers,
Rafael