public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Mips: Enable asynchronous unwind tables with both ASAN and LSAN
@ 2022-05-26 14:18 Dimitrije Milosevic
       [not found] ` <e598dc5e6fb56c31e8ce8ff4569bb3bc64b49dfa.camel@xry111.site>
  0 siblings, 1 reply; 12+ messages in thread
From: Dimitrije Milosevic @ 2022-05-26 14:18 UTC (permalink / raw)
  To: gcc-patches; +Cc: Djordje Todorovic

Enable asynchronous unwind tables with both ASAN and TSAN for correct back-trace.
LLVM currently enables asynchronous unwind tables for: ASAN, HWSAN, TSAN, MSAN, and DFSAN.
HWSAN is currently available only on AArch64, while MSAN and DFSAN are not available at all.
Also, LLVM checks is '-ffreestanding' is not passed in. '-ffreestanding' is only available in C-family frontends, hence why no such check is included.
TODO: Not sure if any tests should be added.

gcc/ChangeLog:

        * config/mips/mips.cc (mips_option_override): Enable
        asyncronous unwind tables with both ASAN and TSAN.

---
 gcc/config/mips/mips.cc | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc
index e64928f4113..ea2a038216c 100644
--- a/gcc/config/mips/mips.cc
+++ b/gcc/config/mips/mips.cc
@@ -20115,10 +20115,15 @@ mips_option_override (void)
  target_flags |= MASK_64BIT;
     }

-  /* -fsanitize=address needs to turn on -fasynchronous-unwind-tables in
-     order for tracebacks to be complete but not if any
-     -fasynchronous-unwind-table were already specified.  */
-  if (flag_sanitize & SANITIZE_USER_ADDRESS
+  /* -fsanitize=address, and -fsanitize=thread need to turn
+     on -fasynchronous-unwind-tables in order for tracebacks
+     to be complete but not if any -fasynchronous-unwind-table
+     were already specified.  */
+  /* FIXME: HWSAN is currently only available on AArch64,
+      but could also utilize -fasynchronous-unwind-tables.
+     FIXME: We would also like to check if -ffreestanding is passed in.
+      However, it is only available in C-ish frontends.  */
+  if (flag_sanitize & (SANITIZE_USER_ADDRESS | SANITIZE_THREAD)
       && !global_options_set.x_flag_asynchronous_unwind_tables)
     flag_asynchronous_unwind_tables = 1;

---

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-07-05  9:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-26 14:18 [PATCH] Mips: Enable asynchronous unwind tables with both ASAN and LSAN Dimitrije Milosevic
     [not found] ` <e598dc5e6fb56c31e8ce8ff4569bb3bc64b49dfa.camel@xry111.site>
2022-05-30  7:10   ` [PATCH] Mips: Enable asynchronous unwind tables with both ASAN and TSAN Dimitrije Milosevic
2022-06-07  8:20     ` Xi Ruoyao
2022-06-07 10:13       ` Dimitrije Milosevic
2022-06-11 12:03         ` Xi Ruoyao
2022-07-04 14:28           ` Dimitrije Milosevic
2022-07-05  1:54             ` Xi Ruoyao
2022-07-05  4:21               ` Fangrui Song
2022-07-05  4:51                 ` Xi Ruoyao
2022-07-05  8:47                   ` Xi Ruoyao
2022-07-05  9:13                 ` Xi Ruoyao
2022-07-05  6:30               ` Dimitrije Milosevic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).