This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Introduce a compile-time mechanism to override __libcpp_verbose_abort
ClosedPublic

Authored by ldionne on Jan 9 2023, 2:22 PM.

Details

Summary

This changes the mechanism for verbose termination (again!) to make it
support compile-time customization in addition to link-time customization,
which is important for users who need fine-grained control over what code
gets generated around sites that call the verbose termination handler.

This concern had been raised to me both privately by prospecting users
and in https://llvm.org/D140944, so I think it is clearly worth fixing.

We still support _LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED for
a limited time since the same functionality can be achieved by overriding
the _LIBCPP_VERBOSE_ABORT macro.

Diff Detail

Event Timeline

ldionne created this revision.Jan 9 2023, 2:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 9 2023, 2:22 PM
ldionne requested review of this revision.Jan 9 2023, 2:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 9 2023, 2:22 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne added a subscriber: Restricted Project.Jan 9 2023, 2:25 PM

Adding vendors since this is a pretty fundamental piece of the library and I'd like to know if other folks have points that have not been considered yet in this design (and re-design) of the mechanism.

The macro use of _LIBCPP_VERBOSE_ABORT looks great. It supports both the compile-time and link-time needs (users who want __builtin_abort (they can use a SIGABRT handler to give users a backtrace) and users who what to customize the message).

Mordante added inline comments.
libcxx/docs/ReleaseNotes.rst
117

Since we add this so closely to the LLVM 16 release, would it be better to remove in LLVM 18?

vitalybuka added a comment.EditedJan 17 2023, 2:38 PM

@ldionne Any guess when this can be landed?

ldionne updated this revision to Diff 491571.Jan 23 2023, 5:20 PM
ldionne marked an inline comment as done.

Rebase and deprecate in LLVM 18. Sorry folks, I've been hella busy but I'm trying to put this in LLVM 16.

vitalybuka accepted this revision.Jan 23 2023, 5:42 PM
hans added a subscriber: ayzhao.Jan 24 2023, 7:52 AM
hans added inline comments.
libcxx/include/__verbose_abort
41

@ayzhao we should look into switching to _LIBCPP_VERBOSE_ABORT when this lands.

ldionne updated this revision to Diff 491818.Jan 24 2023, 8:28 AM

Fix test in backdeployment

ldionne updated this revision to Diff 491884.Jan 24 2023, 1:03 PM

Try to fix GCC build

This revision was not accepted when it landed; it landed in state Needs Review.Jan 24 2023, 6:39 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.