[all-commits] [llvm/llvm-project] c8bb66: [tsan] Fix buildgo.sh on FreeBSD/NetBSD (#213047)

Rainer Orth via All-commits all-commits at lists.llvm.org
Thu Jul 30 23:59:03 PDT 2026


  Branch: refs/heads/release/23.x
  Home:   https://github.com/llvm/llvm-project
  Commit: c8bb66dd4f48747f67a5e25df946ef5db30b185e
      https://github.com/llvm/llvm-project/commit/c8bb66dd4f48747f67a5e25df946ef5db30b185e
  Author: Rainer Orth <ro at gcc.gnu.org>
  Date:   2026-07-31 (Fri, 31 Jul 2026)

  Changed paths:
    M compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
    M compiler-rt/lib/tsan/go/buildgo.sh
    M compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp

  Log Message:
  -----------
  [tsan] Fix buildgo.sh on FreeBSD/NetBSD (#213047)

This patch fixes the remaining compile errors when running `ninja
check-all` on FreeBSD and NetBSD:

- `sanitizer_linux.cpp` doesn't compile on NetBSD, so this patch adds a
cast:
  ```
sanitizer_common/sanitizer_linux.cpp:2492:10: error: format specifies
type 'unsigned long long' but the argument has type '__greg_t' (aka
'unsigned long') [-Werror,-Wformat]
   ```

- `tsan_interface_atomic.cpp` doesn't compile on both FreeBSD and
NetBSD, so this patch disables the warning:
  ```
tsan_interface_atomic.cpp:353:12: error: unused function template
'NoTsanAtomic' [-Werror,-Wunused-template]
tsan_interface_atomic.cpp:358:12: error: unused function template
'Atomic' [-Werror,-Wunused-template]
tsan_interface_atomic.cpp:389:12: error: unused function template
'NoTsanAtomic' [-Werror,-Wunused-template]
tsan_interface_atomic.cpp:394:12: error: unused function template
'Atomic' [-Werror,-Wunused-template]
tsan_interface_atomic.cpp:401:12: error: unused function template
'NoTsanAtomic' [-Werror,-Wunused-template]
tsan_interface_atomic.cpp:406:12: error: unused function template
'Atomic' [-Werror,-Wunused-template]
  ```

- `sanitizer_linux_libcdep.cpp` doesn't compile on NetBSD:
  ```
sanitizer_linux_libcdep.cpp:527:27: error: use of undeclared identifier
'__lwp_getprivate_fast'; did you mean '_lwp_getprivate'?
  ```
This is the same issue already handled in `tsan_platform_linux.cpp`: to
expose the `__lwp_getprivate_fast` definition in `<machine/mcontext.h>`,
`_RTLD_SOURCE` needs to be defined before `<machine/mcontext.h>` is
included (indirectly from `<signal.h>` in this case). It also needs to
include `<sys/types.h>` to get a definition of the `__aligned` macro.

Tested on `amd64-pc-freebsd15.1` and `amd64-pc-netbsd10.1`.

(cherry picked from commit 6e92d6d0577cbe102bd48f396301ea5cd0ebf247)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list