$OpenBSD: patch-qtdeclarative_src_qml_jsruntime_qv4engine_cpp,v 1.3 2016/03/06 11:56:42 zhuk Exp $
Add support for OpenBSD.
--- qtdeclarative/src/qml/jsruntime/qv4engine.cpp.ports.orig	Tue Oct 13 07:37:50 2015
+++ qtdeclarative/src/qml/jsruntime/qv4engine.cpp	Thu Dec 10 09:08:28 2015
@@ -86,6 +86,9 @@
 #if USE(PTHREADS)
 #  include <pthread.h>
 #  include <sys/resource.h>
+#if OS(OPENBSD)
+#  include <sys/signal.h>
+#endif
 #if HAVE(PTHREAD_NP_H)
 #  include <pthread_np.h>
 #endif
@@ -127,6 +130,14 @@ quintptr getStackLimit()
     } else
         size = pthread_get_stacksize_np(thread_self);
     stackLimit -= size;
+
+#  elif OS(OPENBSD)
+    stack_t sinfo;
+    pthread_t thread_self = pthread_self();
+    pthread_stackseg_np(thread_self, &sinfo);
+    stackLimit = reinterpret_cast<quintptr>(sinfo.ss_sp);
+    stackLimit -= sinfo.ss_size;
+
 #  elif defined(__hppa)
     // On some architectures the stack grows upwards. All of these are rather exotic, so simply assume
     // everything is fine there.
