[Openmp-commits] [compiler-rt] [openmp] [ubsan][test] Skip Misc/Posix/static-link.cpp on Solaris (PR #175462)
Rainer Orth via Openmp-commits
openmp-commits at lists.llvm.org
Sun Jan 11 13:29:41 PST 2026
https://github.com/rorth updated https://github.com/llvm/llvm-project/pull/175462
>From b27b312893394f3cbbcbee027861e97e9803967b Mon Sep 17 00:00:00 2001
From: Rainer Orth <ro at gcc.gnu.org>
Date: Sun, 11 Jan 2026 22:21:23 +0100
Subject: [PATCH 1/2] [ubsan][test] Skip Misc/Posix/static-link.cpp on Solaris
The `UBSan-Standalone-x86_64 :: TestCases/Misc/Posix/static-link.cpp` test
currently `FAIL`s on Solaris/x86_64 with
```
ld: fatal: option '-z record' is incompatible with building a static executable
```
One cannot create static executables on Solaris since no `libc.a` is
delivered, so this patch skips the test.
Tested on `x86_64-pc-solaris2.11`.
---
compiler-rt/test/ubsan/TestCases/Misc/Posix/static-link.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compiler-rt/test/ubsan/TestCases/Misc/Posix/static-link.cpp b/compiler-rt/test/ubsan/TestCases/Misc/Posix/static-link.cpp
index 081eec049e3fc..daa76b7322669 100644
--- a/compiler-rt/test/ubsan/TestCases/Misc/Posix/static-link.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Misc/Posix/static-link.cpp
@@ -6,7 +6,7 @@
// UNSUPPORTED: i386-target-arch, internal_symbolizer
// Does not link.
-// UNSUPPORTED: darwin
+// UNSUPPORTED: darwin,target={{.*solaris.*}}
#include <signal.h>
#include <stdio.h>
>From 040b07e7ba8579c8d44e8bef9847efe1c499ebb7 Mon Sep 17 00:00:00 2001
From: Rainer Orth <ro at gcc.gnu.org>
Date: Sun, 11 Jan 2026 22:28:40 +0100
Subject: [PATCH 2/2] [OpenMP] Allow libomp.so to link in Debug build with GCC
15 libstdc++
As detailed in Issue #153569, a `Debug` build with the `GCC 15` `libstdc++`
`FAIL`s when linking `libomp.so`.
To avoid this, one needs to define `_GLIBCXX_NO_ASSERTIONS`.
Tested on `x86_64-pc-solaris2.11`.
---
openmp/runtime/src/kmp.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h
index 36c40abaf1ef4..db6b4238d4906 100644
--- a/openmp/runtime/src/kmp.h
+++ b/openmp/runtime/src/kmp.h
@@ -48,6 +48,12 @@
#define KMP_CANCEL_THREADS
#define KMP_THREAD_ATTR
+// GCC 15 libstdc++ enables debug assertions in unoptimized builds.
+// Disable them to allow libomp.so to link without libstdc++.so.
+#if !__OPTIMIZE__
+#define GLIBCXX_NO_ASSERTIONS
+#endif
+
// Android does not have pthread_cancel. Undefine KMP_CANCEL_THREADS if being
// built on Android
#if defined(__ANDROID__)
More information about the Openmp-commits
mailing list