[sanitizer_common] Make sanitizer_linux.cpp kernel_stat* handling Lin…#104916
Conversation
…ux-specific fcd6bd5 broke the Solaris/sparcv9 buildbot: ``` compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:39:14: fatal error: 'asm/unistd.h' file not found 39 | # include <asm/unistd.h> | ^~~~~~~~~~~~~~ ``` That section should have been Linux-specific in the first place, which is what this patch does. Tested on sparcv9-sun-solaris2.11. (cherry picked from commit 16e9bb9)
|
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Rainer Orth (rorth) Changes…ux-specific fcd6bd5 broke the Solaris/sparcv9 buildbot: That section should have been Linux-specific in the first place, which is what this patch does. Tested on sparcv9-sun-solaris2.11. (cherry picked from commit 16e9bb9) Full diff: https://github.com/llvm/llvm-project/pull/104916.diff 1 Files Affected:
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
index 8d375ffcd079c9..648df0c4e5a760 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
@@ -35,7 +35,7 @@
// access stat from asm/stat.h, without conflicting with definition in
// sys/stat.h, we use this trick. sparc64 is similar, using
// syscall(__NR_stat64) and struct kernel_stat64.
-# if SANITIZER_MIPS64 || SANITIZER_SPARC64
+# if SANITIZER_LINUX && (SANITIZER_MIPS64 || SANITIZER_SPARC64)
# include <asm/unistd.h>
# include <sys/types.h>
# define stat kernel_stat
|
|
This was originally part of the merge PR #101236, but was missed when merging the original PR #101012 instead.
|
|
The Solaris/sparcv9 build just completed successfully: no regressions relative to rc2. |
|
@rorth (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. |
…ux-specific
fcd6bd5 broke the Solaris/sparcv9 buildbot:
That section should have been Linux-specific in the first place, which is what this patch does.
Tested on sparcv9-sun-solaris2.11.
(cherry picked from commit 16e9bb9)