--- ./qtdeclarative/src/qml/jsruntime/qv4engine.cpp.orig Thu Sep 11 12:48:29 2014 +++ ./qtdeclarative/src/qml/jsruntime/qv4engine.cpp Sun Sep 28 02:04:00 2014 @@ -79,6 +79,10 @@ #include "qv4isel_moth_p.h" #if USE(PTHREADS) +# if OS(SOLARIS) +# include +# include +# endif # include # include #if HAVE(PTHREAD_NP_H) @@ -113,6 +117,17 @@ } else size = pthread_get_stacksize_np(thread_self); stackLimit -= size; +# elif OS(SOLARIS) + stack_t s; + if ((thr_stksegment(&s)) == 0) { + void *stackBottom = s.ss_sp - s.ss_size; + stackLimit = reinterpret_cast(stackBottom); + } else { + /* thread still initializing? -> use fallback as others below*/ + perror("Failed to determine stack bottom"); + int dummy; + stackLimit = reinterpret_cast(&dummy) - 1024*1024; + } # else void* stackBottom = 0; pthread_attr_t attr; @@ -132,7 +147,7 @@ getrlimit(RLIMIT_STACK, &limit); stackBottom = reinterpret_cast(reinterpret_cast(stackBottom) + stackSize - limit.rlim_cur); } -# endif +# endif /* Q_OS_ANDROID */ stackLimit = reinterpret_cast(stackBottom); } else { @@ -142,7 +157,7 @@ stackLimit = reinterpret_cast(&dummy) - 1024*1024; } -# endif +# endif /* OS */ // This is wrong. StackLimit is the currently committed stack size, not the real end. // only way to get that limit is apparently by using VirtualQuery (Yuck) //#elif OS(WINDOWS) @@ -153,7 +168,7 @@ // this is inexact, as part of the stack is used when being called here, // but let's simply default to 1MB from where the stack is right now stackLimit = reinterpret_cast(&dummy) - 1024*1024; -#endif +#endif /* USE(PTHREADS) && !OS(QNX) */ // 256k slack return stackLimit + 256*1024;