This revision creates abort and _Exit implementations
Details
Diff Detail
Event Timeline
libc/spec/stdc.td | ||
---|---|---|
175–176 | 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? |
libc/src/stdlib/abort.cpp | ||
---|---|---|
20 | 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? | |
libc/src/stdlib/linux/_Exit.cpp | ||
20 | It is since 2.5.35. I guess that is old enough to remove the check, so I have removed it. |
libc/spec/stdc.td | ||
---|---|---|
175–176 | Will this help: https://reviews.llvm.org/D75393 | |
libc/src/stdlib/abort.cpp | ||
20 | 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. |
- Added more descriptive TODO to abort
- Added forgotten entry points in lib/CMakeLists.txt
- Added changes from D75393
- Rebased against d1536673c68d
Just a few comments on comments. But, overall LGTM.
libc/src/stdlib/abort.cpp | ||
---|---|---|
19 | Do you need sigaction also? | |
20 | I think you mean SIG_DFL? | |
22 | 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. |
libc/src/stdlib/abort.cpp | ||
---|---|---|
19 | Yes to remove the user installed SIGABRT handler. | |
20 | Indeed, good catch | |
20 |
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 :) |
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?