[llvm-branch-commits] [compiler-rt] release/21.x: [compiler-rt] Avoid depending on the libnvmm header for NetBSD (#153534) (PR #155717)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Aug 27 16:26:00 PDT 2025


https://github.com/llvmbot created https://github.com/llvm/llvm-project/pull/155717

Backport 9ec771bd4a16198cec04b4b9c30c22ee89140a2d

Requested by: @alexrp

>From 14450f5634944e1933c2ff8269bf6cb652d5209e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= <alex at alexrp.com>
Date: Sun, 24 Aug 2025 20:39:34 +0200
Subject: [PATCH] [compiler-rt] Avoid depending on the libnvmm header for
 NetBSD (#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 9ec771bd4a16198cec04b4b9c30c22ee89140a2d)
---
 .../lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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
 



More information about the llvm-branch-commits mailing list