Add FORCE_LLD_DIAGNOSTICS_CRASH inspired by the existing FORCE_CLANG_DIAGNOSTICS_CRASH.
This is particularly useful for people customizing LLD as they may want to modify the crash reporting behavior.
Differential D128195
[LLD][ELF] Add FORCE_LLD_DIAGNOSTICS_CRASH to force LLD to crash bd1976llvm on Jun 20 2022, 5:58 AM. Authored by
Details Add FORCE_LLD_DIAGNOSTICS_CRASH inspired by the existing FORCE_CLANG_DIAGNOSTICS_CRASH. This is particularly useful for people customizing LLD as they may want to modify the crash reporting behavior.
Diff Detail
Event TimelineComment Actions IIUC this is primarily so that a test can be written for a crash message? Possibly worth adding an additional message "Crashing due to enviroment variable FORCE_LLD_DIAGNOSTICS_CRASH" as I can imagine someone setting the environment variable then forgetting and wondering why LLD keeps crashing. Alternatively would a --crash option be easier to manage? I don't think we can replicate the reproducer that the clang driver uses with this option. Comment Actions I'm not opposed. I have a slight preference for an env variable as it allows you to simulate crashes on systems where it is difficult to control command line switches. Comment Actions I'll add a ReleaseNote but I don't think we want to document this otherwise as it is really a developer tool not a feature we want anyone to rely on. Thanks.
Comment Actions LGTM from me. Thanks for the update. Will be worth giving MaskRay some time to comment as well. Comment Actions If this is intended for all ports, you may use lld/tools/lld/lld.cpp
Comment Actions Ensure added lit test passes for LLVM_ENABLE_BACKTRACES=off builds.
Comment Actions
|
Since you have the differential link, add it.