[compiler-rt] [NFCI] clarify that asan-*linux.cpp files affect *nix OS'es (PR #195565)

David Justo via llvm-commits llvm-commits at lists.llvm.org
Sun May 3 18:06:43 PDT 2026


https://github.com/davidmrdavid created https://github.com/llvm/llvm-project/pull/195565

**Prior Work:** Aims to supersede (#132263), which seems abandoned, specifically by applying my own comment: https://github.com/llvm/llvm-project/pull/132263#issuecomment-3051238734

**Context:** It aims to minimally document that the `asan_(malloc_)?linux.cpp` files may impact non-linux OS'es (despite the name) such as Solaris, BSD, and other *nix OS'es.  This is worth documenting as otherwise we risk breakage due to confusion, as occurred [here](https://github.com/llvm/llvm-project/pull/131975#issuecomment-2741097471).

This is done simply by minimally augmenting the file header comment saying precisely this.
Unlike the prior PR, this does not rename any files, which should reduce the 'git noise' impact of this change.

_Thanks!_

>From 0148b005288acfd9af988d59a53469663e959c85 Mon Sep 17 00:00:00 2001
From: David Justo <david.justo.1996 at gmail.com>
Date: Sun, 3 May 2026 17:59:43 -0700
Subject: [PATCH] [NFCI] clarify that asan-*linux.cpp files affect *nix OS'es

---
 compiler-rt/lib/asan/asan_linux.cpp        | 2 +-
 compiler-rt/lib/asan/asan_malloc_linux.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler-rt/lib/asan/asan_linux.cpp b/compiler-rt/lib/asan/asan_linux.cpp
index d2c2a394b06c2..5eedebf0b58cc 100644
--- a/compiler-rt/lib/asan/asan_linux.cpp
+++ b/compiler-rt/lib/asan/asan_linux.cpp
@@ -8,7 +8,7 @@
 //
 // This file is a part of AddressSanitizer, an address sanity checker.
 //
-// Linux-specific details.
+// Linux-specific (and Unix/Unix-like) details.
 //===----------------------------------------------------------------------===//
 
 #include "sanitizer_common/sanitizer_platform.h"
diff --git a/compiler-rt/lib/asan/asan_malloc_linux.cpp b/compiler-rt/lib/asan/asan_malloc_linux.cpp
index 35bf55da1c66b..f48d3cbe07b15 100644
--- a/compiler-rt/lib/asan/asan_malloc_linux.cpp
+++ b/compiler-rt/lib/asan/asan_malloc_linux.cpp
@@ -8,7 +8,7 @@
 //
 // This file is a part of AddressSanitizer, an address sanity checker.
 //
-// Linux-specific malloc interception.
+// Linux-speficic (and Unix/Unix-like) malloc interception.
 // We simply define functions like malloc, free, realloc, etc.
 // They will replace the corresponding libc functions automagically.
 //===----------------------------------------------------------------------===//



More information about the llvm-commits mailing list