summaryrefslogtreecommitdiff
path: root/debian/patches/dyson-MachineStackMarker.patch
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2017-09-30 10:28:39 +0300
committerIgor Pashev <pashev.igor@gmail.com>2017-09-30 10:28:39 +0300
commit7d074160201598ee5270bf71c41c31ac5f11366c (patch)
treeb191b18ad2db0eaafda48b665011d333f9efc69a /debian/patches/dyson-MachineStackMarker.patch
parent10b769e541b7ac3ae0d71a5fcfbc7b6fb4e0fda8 (diff)
downloadwebkit-master.tar.gz
webkitgtk (2.4.11-3+dyson0.1)HEADdyson/2.4.11-3+dyson0.1master
Diffstat (limited to 'debian/patches/dyson-MachineStackMarker.patch')
-rw-r--r--debian/patches/dyson-MachineStackMarker.patch90
1 files changed, 90 insertions, 0 deletions
diff --git a/debian/patches/dyson-MachineStackMarker.patch b/debian/patches/dyson-MachineStackMarker.patch
new file mode 100644
index 0000000..b4b14a1
--- /dev/null
+++ b/debian/patches/dyson-MachineStackMarker.patch
@@ -0,0 +1,90 @@
+$NetBSD: patch-Source_JavaScriptCore_heap_MachineStackMarker.cpp,v 1.2 2012/10/30 12:46:30 drochner Exp $
+
+Index: webkit/Source/JavaScriptCore/heap/MachineStackMarker.cpp
+===================================================================
+--- webkit.orig/Source/JavaScriptCore/heap/MachineStackMarker.cpp
++++ webkit/Source/JavaScriptCore/heap/MachineStackMarker.cpp
+@@ -20,6 +20,9 @@
+ */
+
+ #include "config.h"
++#if OS(SOLARIS)
++#undef _FILE_OFFSET_BITS
++#endif
+ #include "MachineStackMarker.h"
+
+ #include "ConservativeRoots.h"
+@@ -49,6 +52,10 @@
+ #include <unistd.h>
+
+ #if OS(SOLARIS)
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <fcntl.h>
++#include <procfs.h>
+ #include <thread.h>
+ #else
+ #include <pthread.h>
+@@ -310,6 +317,7 @@ typedef pthread_attr_t PlatformThreadReg
+ #error Need a thread register struct for this platform
+ #endif
+
++#if !OS(SOLARIS)
+ static size_t getPlatformThreadRegisters(const PlatformThread& platformThread, PlatformThreadRegisters& regs)
+ {
+ #if OS(DARWIN)
+@@ -363,6 +371,7 @@ static size_t getPlatformThreadRegisters
+ #error Need a way to get thread registers on this platform
+ #endif
+ }
++#endif
+
+ static inline void* otherThreadStackPointer(const PlatformThreadRegisters& regs)
+ {
+@@ -425,6 +434,7 @@ static inline void* otherThreadStackPoin
+ #endif
+ }
+
++#if !OS(SOLARIS)
+ static void freePlatformThreadRegisters(PlatformThreadRegisters& regs)
+ {
+ #if USE(PTHREADS) && !OS(WINDOWS) && !OS(DARWIN)
+@@ -433,20 +443,36 @@ static void freePlatformThreadRegisters(
+ UNUSED_PARAM(regs);
+ #endif
+ }
++#endif
+
+ void MachineThreads::gatherFromOtherThread(ConservativeRoots& conservativeRoots, Thread* thread)
+ {
++#if OS(SOLARIS)
++ struct lwpstatus lwp;
++ char procfile[64];
++ int fd;
++ snprintf(procfile, 64, "/proc/self/lwp/%u/lwpstatus", thread->platformThread);
++ fd = open(procfile, O_RDONLY, 0);
++ if (fd == -1) {
++ fprintf(stderr, "%s: %s\n", procfile, strerror(errno));
++ abort();
++ }
++ pread(fd, &lwp, sizeof(lwp), 0);
++ close(fd);
++ void* stackPointer = (void*)lwp.pr_reg[REG_SP];
++#else
+ PlatformThreadRegisters regs;
+ size_t regSize = getPlatformThreadRegisters(thread->platformThread, regs);
+
+ conservativeRoots.add(static_cast<void*>(&regs), static_cast<void*>(reinterpret_cast<char*>(&regs) + regSize));
+
+ void* stackPointer = otherThreadStackPointer(regs);
++
++ freePlatformThreadRegisters(regs);
++#endif
+ void* stackBase = thread->stackBase;
+ swapIfBackwards(stackPointer, stackBase);
+ conservativeRoots.add(stackPointer, stackBase);
+-
+- freePlatformThreadRegisters(regs);
+ }
+
+ void MachineThreads::gatherConservativeRoots(ConservativeRoots& conservativeRoots, void* stackCurrent)