Fix thread stack base detection in devel/kf5/kjs

The old patch points to the TOP and not to the base(end) of the thread stack.

OK mpi@
This commit is contained in:
rsadowski 2020-09-13 12:29:31 +00:00
parent 1ec3183e4b
commit a23000d486
2 changed files with 6 additions and 5 deletions

View File

@ -1,7 +1,8 @@
# $OpenBSD: Makefile,v 1.12 2020/03/23 18:01:09 rsadowski Exp $
# $OpenBSD: Makefile,v 1.13 2020/09/13 12:29:31 rsadowski Exp $
COMMENT = JavaScript/ECMAScript engine for KDE
DISTNAME = kjs-${VERSION}
REVISION = 0
SHARED_LIBS = KF5JS 5.0
SHARED_LIBS += KF5JSApi 5.0

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-src_kjs_collector_cpp,v 1.2 2017/06/07 17:03:38 rsadowski Exp $
$OpenBSD: patch-src_kjs_collector_cpp,v 1.3 2020/09/13 12:29:31 rsadowski Exp $
Allow to build & run on OpenBSD.
Index: src/kjs/collector.cpp
--- src/kjs/collector.cpp.orig
@ -8,9 +8,9 @@ Index: src/kjs/collector.cpp
pthread_t thread = pthread_self();
if (stackBase == nullptr || thread != stackThread) {
+#if defined(__OpenBSD__)
+ stack_t sinfo;
+ pthread_stackseg_np(thread, &sinfo);
+ stackBase = sinfo.ss_sp;
+ stack_t ss;
+ int rc = pthread_stackseg_np(thread, &ss);
+ stackBase = (void*)((size_t) ss.ss_sp - ss.ss_size);
+#else
pthread_attr_t sattr;
#if HAVE_PTHREAD_NP_H || defined(__NetBSD__)