This revision creates abort and _Exit implementations
These should both be _Noreturn or __attribute__((noreturn)) I'm not sure how best to express this. Should I add a noreturn macro to include/__llvm_libc_common.h? Then how would I express this in stdc.td?
I have added the above TODO. Maybe it is wrong as I think more about it though, maybe sigprocmask is a better choice to remove the signal handler.
I think there also needs to be some kind of lock once we start playing with signal handlers. WDYT?
It is since 2.5.35. I guess that is old enough to remove the check, so I have removed it.
Will this help: https://reviews.llvm.org/D75393
Yeah. Please add a big TODO comment explaining what you intend to do in follow-up patches. To get it right, I agree with you that we will need a lock (or multiple locks). So, once the mutex patch lands, we can get back to finishing this.
Just a few comments on comments. But, overall LGTM.
Do you need sigaction also?
I think you mean SIG_DFL?
I am being pedantic but I think it is important to leave a more detailed comment here: I think I understand why we need a recursive mutex, but can you also explicitly detail in the comment why a recursive mutex et al is required.
Yes to remove the user installed SIGABRT handler.
Indeed, good catch
I have added what I think I will do in the future but the more I think about this the more complicated it is. The future patches here should be interesting :)