[clang] [clang-tools-extra] [llvm] [LLVM][CLANG] Update signal-handling behavior to comply with POSIX (PR #169340)

Xing Xue via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 9 08:26:48 PST 2026


================
@@ -411,14 +422,12 @@ static void SignalHandler(int Sig, siginfo_t *Info, void *) {
   // Otherwise if it is a fault (like SEGV) run any handler.
   llvm::sys::RunSignalHandlers();
 
-#ifdef __s390__
-  // On S/390, certain signals are delivered with PSW Address pointing to
-  // *after* the faulting instruction.  Simply returning from the signal
-  // handler would continue execution after that point, instead of
-  // re-raising the signal.  Raise the signal manually in those cases.
-  if (Sig == SIGILL || Sig == SIGFPE || Sig == SIGTRAP)
-    raise(Sig);
-#endif
+  // Resignal if it is a kill signal so that the exit code contains the
+  // terminating signal number.
+  if (llvm::is_contained(KillSigs, Sig)) {
----------------
xingxue-ibm wrote:

Changed to guard the new behavior with `NeedsPOSIXUtilitySignalHandling`. Thanks!

https://github.com/llvm/llvm-project/pull/169340


More information about the llvm-commits mailing list