Skip to content

[sanitizer_common] Make sanitizer_linux.cpp kernel_stat* handling Lin… #104916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

rorth
Copy link
Collaborator

@rorth rorth commented Aug 20, 2024

…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)

…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)
@llvmbot
Copy link
Member

llvmbot commented Aug 20, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Rainer Orth (rorth)

Changes

…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 &lt;asm/unistd.h&gt;
      |              ^~~~~~~~~~~~~~

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:

  • (modified) compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp (+1-1)
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

@rorth
Copy link
Collaborator Author

rorth commented Aug 20, 2024

This was originally part of the merge PR #101236, but was missed when merging the original PR #101012 instead.
Missing in 19.1.0-rc3 caused the Solaris/sparcv9 build to break, so this should be in -final.

test-release.sh build with this patch applied locally currently running for final verification.

@rorth
Copy link
Collaborator Author

rorth commented Aug 20, 2024

The Solaris/sparcv9 build just completed successfully: no regressions relative to rc2.

@tru tru merged commit 9301cd5 into llvm:release/19.x Aug 26, 2024
10 checks passed
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

3 participants