[all-commits] [llvm/llvm-project] 042bb2: [tsan] Fix build for FreeBSD and NetBSD after 0784...

Dimitry Andric via All-commits all-commits at lists.llvm.org
Mon Jan 22 15:06:19 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 042bb2850dcdd0b8a519f51678f2e40d0a97f548
      https://github.com/llvm/llvm-project/commit/042bb2850dcdd0b8a519f51678f2e40d0a97f548
  Author: Dimitry Andric <dimitry at andric.com>
  Date:   2024-01-23 (Tue, 23 Jan 2024)

  Changed paths:
    M compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp

  Log Message:
  -----------
  [tsan] Fix build for FreeBSD and NetBSD after 0784b1eefa36 (#79019)

In 0784b1eefa36 some code for re-execution was moved to
`ReExecIfNeeded()`, but also extended with a few Linux-only features.
This leads to compile errors on FreeBSD, or other non-Linux platforms:

compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp:247:25: error: use of
undeclared identifier 'personality'
      247 |   int old_personality = personality(0xffffffff);
          |                         ^
compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp:249:54: error: use of
undeclared identifier 'ADDR_NO_RANDOMIZE'
249 | (old_personality != -1) && ((old_personality & ADDR_NO_RANDOMIZE)
== 0);
          |                                                      ^
compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp:281:46: error: use of
undeclared identifier 'ADDR_NO_RANDOMIZE'
281 | CHECK_NE(personality(old_personality | ADDR_NO_RANDOMIZE), -1);
          |                                              ^

Surround the affected part with a `#if SANITIZER_LINUX` block for now.




More information about the All-commits mailing list