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

Backport 0cc7159125eacd3abdff94eb7e634c1a8f889d1e

Requested by: @rorth

>From 323be317fd2cc153160f22622993cf8dfab7b3ad Mon Sep 17 00:00:00 2001
From: Rainer Orth <[email protected]>
Date: Mon, 27 Jul 2026 09:54:12 +0200
Subject: [PATCH] =?UTF-8?q?[sanitizer=5Fcommon][tests]=20Skip=20MemoryMapp?=
 =?UTF-8?q?ing::ParseUnixMemoryProfile=20=E2=80=A6=20(#212114)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

…etc. on NetBSD

The `Sanitizer-x86_64-Test` test doesn't link on NetBSD/amd64 10.1:

```
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
SANITIZER_TEST_OBJECTS.sanitizer_procmaps_test.cpp.x86_64.o: in function 
`__sanitizer::MemoryMapping_ParseUnixMemoryProfile_Test::TestBody()':
sanitizer_procmaps_test.cpp:(.text._ZN11__sanitizer41MemoryMapping_ParseUnixMemoryProfile_Test8TestBodyEv+0x52):
 undefined reference to `__sanitizer::ParseUnixMemoryProfile(void (*)(unsigned 
long, unsigned long, bool, unsigned long*), unsigned long*, char*, unsigned 
long)'
/usr/bin/ld: SANITIZER_TEST_OBJECTS.sanitizer_procmaps_test.cpp.x86_64.o: in 
function 
`__sanitizer::MemoryMapping_ParseUnixMemoryProfileTruncated_Test::TestBody()':
sanitizer_procmaps_test.cpp:(.text._ZN11__sanitizer50MemoryMapping_ParseUnixMemoryProfileTruncated_Test8TestBodyEv+0x17a):
 undefined reference to `__sanitizer::ParseUnixMemoryProfile(void (*)(unsigned 
long, unsigned long, bool, unsigned long*), unsigned long*, char*, unsigned 
long)'

```

Fixed by skipping the affected subtest.

Tested on `amd64-pc-netbsd10.1` and `x86_64-pc-linux-gnu`.

(cherry picked from commit 0cc7159125eacd3abdff94eb7e634c1a8f889d1e)
---
 .../lib/sanitizer_common/tests/sanitizer_procmaps_test.cpp     | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_procmaps_test.cpp 
b/compiler-rt/lib/sanitizer_common/tests/sanitizer_procmaps_test.cpp
index c18e5bd9f3194..5af58365992c5 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_procmaps_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_procmaps_test.cpp
@@ -90,6 +90,8 @@ Size:                 12 kB
 Rss:                  12 kB
 )";
 
+#    if !SANITIZER_NETBSD
+// Test fails to link with NetBSD 10.1 /usr/bin/ld.
 TEST(MemoryMapping, ParseUnixMemoryProfile) {
   struct entry {
     uptr p;
@@ -133,6 +135,7 @@ TEST(MemoryMapping, ParseUnixMemoryProfileTruncated) {
   UnmapOrDie(mem, 2 * page);
 }
 #  endif
+#  endif
 
 }  // namespace __sanitizer
 #endif  // !defined(_WIN32)

_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to