[clang] [compiler-rt] [Sanitizers] the access size (8 bytes) exceeds the max lock-free size (4 bytes) for 32-bit (PR #125388)
Hubert Tong via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 6 14:48:40 PST 2025
================
@@ -338,6 +338,13 @@ void aix::Linker::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-lpthread");
}
const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
+
+// Required for 64-bit atomic operations used in sanitizer runtimes
+// (e.g., sanitizer_common's atomic utilities). On 32-bit AIX, these
+// are not natively supported, necessitating linkage with -latomic.
+ if (Sanitize.hasAnySanitizer() && IsArch32Bit) {
+ CmdArgs.push_back("-latomic");
----------------
hubert-reinterpretcast wrote:
> This minimizes the risk of inadvertently impacting sanitizer handling on non-AIX targets.
Generally, placing the code in a more widely used path will lead to more likely detection of problems. In other words, minimizing the risk of inadvertently impacting sanitizer handling on AIX targets _increases the risk_ of having broken sanitizer handling on AIX. Considering that the risk of breaking non-AIX should be low (especially in an undetected manner) and that the risk of incorrect sanitizer handling on AIX is high during active development, I think deliberate attempts to isolate the AIX code (as opposed to using common code paths) is a mistake.
https://github.com/llvm/llvm-project/pull/125388
More information about the llvm-commits
mailing list