[tsan] Fix build for FreeBSD and NetBSD after 0784b1ee (#79019)
In 0784b1ee 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.
Loading
Please sign in to comment