New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add __cxa_init_primary_exception #23
add __cxa_init_primary_exception #23
Conversation
That looks plausible. Can you add a few tests? I’d like to see, at least, that this exception can be thrown and caught and that the destructor runs in the right place. |
}; | ||
|
||
template <typename Ex> | ||
ExceptionPtr MakeExceptionPtr(Ex e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
basically what gcc does: https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/libsupc%2B%2B/exception_ptr.h#L253, with std::decay
omitted for brevity
@davidchisnall added a edit: a guidance on where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you.
@emaste , do you think we could sneak this into FreeBSD 14.0? We can do the libc++ updates a bit later, but it would be nice to have the new APIs in so that external things can depend on them, even if the base system libc++ doesn’t yet.
I’m not sure of the best place to define LIBCXXRT_HAS_INIT_PRIMARY_EXCEPTION. Unfortunately, because the public API is standardised, a lot of consumers provide their own prototypes and don’t actually include any of our headers. It’s probably better for them to use a does-it-link test than rely on our headers. |
I think there's still time, we can sync this repo into FreeBSD main and MFC from there. |
faffb66
to
83d38c5
Compare
[ Rebased to pick up the fix to make FreeBSD CI work ] |
Hi! Is there anything holding this PR back from being merged? I would like to try to make use of these changes in llvm/llvm-project#65534, and it would be a bit more convenient to do so with master branch of libcxxrt rather than with a fork |
@davidchisnall do you want to merge this into this libcxxrt repo? I can do a vendor import into FreeBSD from there |
Sorry, I thought I set it to merge when the CI finished. |
Aims to resolve #22
Somewhat related libc++ patch: https://reviews.llvm.org/D158620