[all-commits] [llvm/llvm-project] dbec35: [sanitizer] Port sanitizer_common to LoongArch

Xi Ruoyao via All-commits all-commits at lists.llvm.org
Wed Jul 20 00:58:53 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dbec35ccf8ec8a64c35fe61e381a8b7dc092be83
      https://github.com/llvm/llvm-project/commit/dbec35ccf8ec8a64c35fe61e381a8b7dc092be83
  Author: Xi Ruoyao <xry111 at mengyan1223.wang>
  Date:   2022-07-20 (Wed, 20 Jul 2022)

  Changed paths:
    M compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
    M compiler-rt/lib/sanitizer_common/CMakeLists.txt
    M compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_platform.h
    M compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_linux.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
    A compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_loongarch64.inc

  Log Message:
  -----------
  [sanitizer] Port sanitizer_common to LoongArch

Initial libsanitizer support for LoongArch. It survived all GCC UBSan tests.

Major changes:

1. LoongArch port of Linux kernel only supports `statx` for `stat` and its families.  So we need to add `statx_to_stat` and use it for `stat`-like libcalls.  The logic is "borrowed" from Glibc.
2. `sanitizer_syscall_linux_loongarch64.inc` is mostly duplicated from RISC-V port, as the syscall interface is almost same.

Reviewed By: SixWeining, MaskRay, XiaodongLoong, vitalybuka

Differential Revision: https://reviews.llvm.org/D129371




More information about the All-commits mailing list