-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
[compiler-rt] adding safestack support for sunos platforms. #95648
Conversation
@llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-driver Author: David CARLIER (devnexen) ChangesFull diff: https://github.com/llvm/llvm-project/pull/95648.diff 4 Files Affected:
diff --git a/clang/lib/Driver/ToolChains/Solaris.cpp b/clang/lib/Driver/ToolChains/Solaris.cpp
index 7126e018ca5b6..e82ed2ca79ffd 100644
--- a/clang/lib/Driver/ToolChains/Solaris.cpp
+++ b/clang/lib/Driver/ToolChains/Solaris.cpp
@@ -341,6 +341,7 @@ SanitizerMask Solaris::getSupportedSanitizers() const {
Res |= SanitizerKind::PointerCompare;
Res |= SanitizerKind::PointerSubtract;
}
+ Res |= SanitizerKind::SafeStack;
Res |= SanitizerKind::Vptr;
return Res;
}
diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
index bddaa37579fd7..c05bdd58519fb 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -833,7 +833,7 @@ else()
endif()
if (COMPILER_RT_HAS_SANITIZER_COMMON AND SAFESTACK_SUPPORTED_ARCH AND
- OS_NAME MATCHES "Linux|FreeBSD|NetBSD")
+ OS_NAME MATCHES "Linux|FreeBSD|NetBSD|SunOS")
set(COMPILER_RT_HAS_SAFESTACK TRUE)
else()
set(COMPILER_RT_HAS_SAFESTACK FALSE)
diff --git a/compiler-rt/lib/safestack/safestack_platform.h b/compiler-rt/lib/safestack/safestack_platform.h
index 2b1fc139baa90..df2f05b84f1aa 100644
--- a/compiler-rt/lib/safestack/safestack_platform.h
+++ b/compiler-rt/lib/safestack/safestack_platform.h
@@ -25,7 +25,7 @@
#include <sys/types.h>
#include <unistd.h>
-#if !(SANITIZER_NETBSD || SANITIZER_FREEBSD || SANITIZER_LINUX)
+#if !(SANITIZER_NETBSD || SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_SOLARIS)
#error "Support for your platform has not been implemented"
#endif
@@ -39,6 +39,10 @@ extern "C" void *__mmap(void *, size_t, int, int, int, int, off_t);
#include <sys/thr.h>
#endif
+#if SANITIZER_SOLARIS
+#include <thread.h>
+#endif
+
namespace safestack {
#if SANITIZER_NETBSD
@@ -73,6 +77,8 @@ inline ThreadId GetTid() {
long Tid;
thr_self(&Tid);
return Tid;
+#elif SANITIZER_SOLARIS
+ return thr_self();
#else
return syscall(SYS_gettid);
#endif
@@ -83,6 +89,8 @@ inline int TgKill(pid_t pid, ThreadId tid, int sig) {
DEFINE__REAL(int, _lwp_kill, int a, int b);
(void)pid;
return _REAL(_lwp_kill, tid, sig);
+#elif SANITIZER_SOLARIS
+ return syscall(SYS_lwp_kill, tid, sig);
#elif SANITIZER_FREEBSD
return syscall(SYS_thr_kill2, pid, tid, sig);
#else
diff --git a/compiler-rt/test/safestack/lit.cfg.py b/compiler-rt/test/safestack/lit.cfg.py
index aadb8bf0d5c77..17dfae46a412b 100644
--- a/compiler-rt/test/safestack/lit.cfg.py
+++ b/compiler-rt/test/safestack/lit.cfg.py
@@ -33,5 +33,5 @@
)
)
-if config.host_os not in ["Linux", "FreeBSD", "NetBSD"]:
+if config.host_os not in ["Linux", "FreeBSD", "NetBSD", "SunOS"]:
config.unsupported = True
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
33f68c3
to
18ce8ba
Compare
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/144/builds/1199 Here is the relevant piece of the build log for the reference:
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/66/builds/772 Here is the relevant piece of the build log for the reference:
|
This patch broke the Solaris/amd64 buildbot. For god's sake, can you please either test your Illumos patches on Solaris, too (there are Solaris buildbots in the cfarm for exactly such a purpose) and finally handle Issue #53919 when it's necessary to distinguish Solaris and Illumos. This happens ever and ever again with your patches and I'm getting pissed off by this attitude! |
oh I see let me figure out a fix, getting into it. |
No description provided.