[all-commits] [llvm/llvm-project] ca747e: [sanitizer] Restrict clock_gettime workaround to g...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sat Mar 6 10:32:42 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ca747e48afa091afd8568df8973dfcbd43b8e334
      https://github.com/llvm/llvm-project/commit/ca747e48afa091afd8568df8973dfcbd43b8e334
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
    M compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_linux.h
    M compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp

  Log Message:
  -----------
  [sanitizer] Restrict clock_gettime workaround to glibc

The hackery is due to glibc clock_gettime crashing from preinit_array (D40679).
32-bit musl architectures do not define `__NR_clock_gettime` so the code causes a compile error.

Tested on Alpine Linux x86-64 (musl) and FreeBSD x86-64.

Reviewed By: vitalybuka

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




More information about the All-commits mailing list