Skip to content

Conversation

@alexrp
Copy link
Member

@alexrp alexrp commented Aug 14, 2025

Use the system headers instead since we don't actually need anything from libnvmm; we only care about ioctls and related structures.

This makes it possible to cross-compile TSan for NetBSD with zig cc which does not provide libnvmm when cross-compiling.

I also removed a term.h include (ncurses) which appeared to be unnecessary and likewise prevented cross-compilation with zig cc from working.

Use the system headers instead since we don't actually need anything from
libnvmm; we only care about ioctls and related structures.

This makes it possible to cross-compile TSan for NetBSD with zig cc which does
not provide libnvmm when cross-compiling.

I also removed a term.h include (ncurses) which appeared to be unnecessary and
likewise prevented cross-compilation with zig cc from working.
@llvmbot
Copy link
Member

llvmbot commented Aug 14, 2025

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

Author: Alex Rønne Petersen (alexrp)

Changes

Use the system headers instead since we don't actually need anything from libnvmm; we only care about ioctls and related structures.

This makes it possible to cross-compile TSan for NetBSD with zig cc which does not provide libnvmm when cross-compiling.

I also removed a term.h include (ncurses) which appeared to be unnecessary and likewise prevented cross-compilation with zig cc from working.


Full diff: https://github.com/llvm/llvm-project/pull/153534.diff

1 Files Affected:

  • (modified) compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp (+1-2)
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
index aacd28c55ceaa..435f3b2861dc9 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
@@ -498,7 +498,6 @@ struct urio_command {
 #include <md5.h>
 #include <rmd160.h>
 #include <soundcard.h>
-#include <term.h>
 #include <termios.h>
 #include <time.h>
 #include <ttyent.h>
@@ -515,7 +514,7 @@ struct urio_command {
 #include <stringlist.h>
 
 #if defined(__x86_64__)
-#include <nvmm.h>
+#include <dev/nvmm/nvmm_ioctl.h>
 #endif
 // clang-format on
 

@alexrp
Copy link
Member Author

alexrp commented Aug 24, 2025

ping

@thurstond thurstond requested a review from devnexen August 24, 2025 18:29
Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@alexrp alexrp merged commit 9ec771b into llvm:main Aug 24, 2025
12 checks passed
@alexrp alexrp deleted the sanitizer-netbsd-nvmm branch August 24, 2025 18:39
@alexrp alexrp added this to the LLVM 21.x Release milestone Aug 27, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in LLVM Release Status Aug 27, 2025
@alexrp
Copy link
Member Author

alexrp commented Aug 27, 2025

/cherry-pick 9ec771b

@llvmbot
Copy link
Member

llvmbot commented Aug 27, 2025

/pull-request #155717

@llvmbot llvmbot moved this from Needs Triage to Done in LLVM Release Status Aug 27, 2025
tru pushed a commit to llvmbot/llvm-project that referenced this pull request Sep 8, 2025
…153534)

Use the system headers instead since we don't actually need anything
from libnvmm; we only care about ioctls and related structures.

This makes it possible to cross-compile TSan for NetBSD with `zig cc`
which does not provide libnvmm when cross-compiling.

I also removed a `term.h` include (ncurses) which appeared to be
unnecessary and likewise prevented cross-compilation with `zig cc` from
working.

(cherry picked from commit 9ec771b)
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