This series enables ASan on alpha*-*-linux*. It depends on a libsanitizer
sync from llvm-project that picks up Alpha support. I requested that sync
in August:

  
https://inbox.sourceware.org/gcc/caedq38hqixuk65nd6r0ob_yavgwn_nkic58xa5w0hkv5ecy...@mail.gmail.com/

and Jakub's merge now appears to be in progress:

  https://inbox.sourceware.org/gcc-patches/avRO5kYgF9dcYS7x@tucnak/

The upstream commits needed are:

  992ee5934c11 Add support for Alpha to libsanitizer
  b9d0703f7d6b [sanitizer_common] Disable the fast unwinder on Alpha Linux
  0ccb181514cd [compiler-rt] Use asm .set only for Hexagon

plus Alpha fixes that are not upstream yet (the 1T shadow offset, syscall
constraints and sign extension, rt_sigaction, and the TCB size). The
series is based on a local stand-in commit for the sync, so the
base-commit below is not in the GCC tree.

Patch 1 fixes generic code: without -fexceptions,
copy_reg_eh_region_note_forward and copy_reg_eh_region_note_backward
drop nothrow REG_EH_REGION notes when a call is replaced (here by an
Alpha peephole2), which causes an ICE in functions with nonlocal labels.

Tested with a cross build to alpha-unknown-linux-gnu, running asan.exp
under qemu-alpha: gcc 2261 PASS, g++ 2198 PASS. The 9 FAILs in each are
clone-test-1 and rlimit-mmap-test-1, which fail under qemu-user.

Signed-off-by: Matt Turner <[email protected]>
---
Changes in v2:
- Patch 1: replace the peep2_attempt-only fix with a generic one in
  except.cc that copies nothrow REG_EH_REGION notes to every call, so
  try_split is covered too (suggested by Andrea Pinski). Also skip
  insns that already have a note in copy_reg_eh_region_note_backward,
  as the forward variant does.
- Link to v1: 
https://inbox.sourceware.org/[email protected]

---
Matt Turner (4):
      except: Copy nothrow REG_EH_REGION notes to all calls
      alpha: Keep the ASan $LASANPC label out of small data
      alpha: Support AddressSanitizer on Linux
      libsanitizer: Enable on alpha*-*-linux*

 gcc/config/alpha/alpha.cc  | 16 ++++++++++++++++
 gcc/config/alpha/alpha.h   |  8 +++++---
 gcc/config/alpha/linux.h   |  9 +++++++++
 gcc/except.cc              | 21 ++++++++++++++++++---
 libsanitizer/configure.tgt |  2 ++
 5 files changed, 50 insertions(+), 6 deletions(-)
---
base-commit: 92644cbe7791850106ba0818a6d68bab0e1cccf5
change-id: 20261113-alpha-sanitizer-support-2746aa6abb7e

Best regards,
--  
Matt Turner <[email protected]>

Reply via email to