summaryrefslogtreecommitdiff
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
parent10b769e541b7ac3ae0d71a5fcfbc7b6fb4e0fda8 (diff)
downloadwebkit-master.tar.gz
webkitgtk (2.4.11-3+dyson0.1)HEADdyson/2.4.11-3+dyson0.1master
-rw-r--r--debian/changelog17
-rw-r--r--debian/patches/dyson-HAVE_TM_GMTOFF.patch13
-rw-r--r--debian/patches/dyson-InlineASM.patch21
-rw-r--r--debian/patches/dyson-MachineStackMarker.patch90
-rw-r--r--debian/patches/dyson-MathExtras.h.patch29
-rw-r--r--debian/patches/dyson-g-ir-scanner-hangs.patch95
-rw-r--r--debian/patches/dyson-gcc.patch26
-rw-r--r--debian/patches/dyson-solaris-amd64-memory-layout.patch492
-rw-r--r--debian/patches/dyson-use-system-malloc.patch15
-rw-r--r--debian/patches/dyson-uses-gnu-ld.patch13
-rw-r--r--debian/patches/dyson-webkit2-PluginProcess-missing-basename.patch14
-rw-r--r--debian/patches/series10
12 files changed, 835 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 9da5dbf..d2810d6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,20 @@
+webkitgtk (2.4.11-3+dyson0.1) unstable; urgency=medium
+
+ * Package for Dyson
+ * Added patches:
+ - debian/patches/dyson-g-ir-scanner-hangs.patch
+ - debian/patches/dyson-gcc.patch
+ - debian/patches/dyson-HAVE_TM_GMTOFF.patch
+ - debian/patches/dyson-InlineASM.patch
+ - debian/patches/dyson-MachineStackMarker.patch
+ - debian/patches/dyson-MathExtras.h.patch
+ - debian/patches/dyson-solaris-amd64-memory-layout.patch
+ - debian/patches/dyson-use-system-malloc.patch
+ - debian/patches/dyson-uses-gnu-ld.patch
+ - debian/patches/dyson-webkit2-PluginProcess-missing-basename.patch
+
+ -- Igor Pashev <pashev.igor@gmail.com> Fri, 29 Sep 2017 12:18:08 +0300
+
webkitgtk (2.4.11-3) unstable; urgency=medium
[ Jeremy Bicha ]
diff --git a/debian/patches/dyson-HAVE_TM_GMTOFF.patch b/debian/patches/dyson-HAVE_TM_GMTOFF.patch
new file mode 100644
index 0000000..59bd5d8
--- /dev/null
+++ b/debian/patches/dyson-HAVE_TM_GMTOFF.patch
@@ -0,0 +1,13 @@
+Index: webkitgtk-2.4.11/Source/WTF/wtf/Platform.h
+===================================================================
+--- webkitgtk-2.4.11.orig/Source/WTF/wtf/Platform.h
++++ webkitgtk-2.4.11/Source/WTF/wtf/Platform.h
+@@ -618,7 +618,7 @@
+ #endif
+ #endif
+
+-#if !OS(WINDOWS) && !OS(SOLARIS)
++#if !OS(WINDOWS)
+ #define HAVE_TM_GMTOFF 1
+ #define HAVE_TM_ZONE 1
+ #define HAVE_TIMEGM 1
diff --git a/debian/patches/dyson-InlineASM.patch b/debian/patches/dyson-InlineASM.patch
new file mode 100644
index 0000000..c0d987d
--- /dev/null
+++ b/debian/patches/dyson-InlineASM.patch
@@ -0,0 +1,21 @@
+Index: webkit/Source/WTF/wtf/InlineASM.h
+===================================================================
+--- webkit.orig/Source/WTF/wtf/InlineASM.h
++++ webkit/Source/WTF/wtf/InlineASM.h
+@@ -42,7 +42,7 @@
+ #define THUMB_FUNC_PARAM(name)
+ #endif
+
+-#if (OS(LINUX) || OS(FREEBSD)) && CPU(X86_64)
++#if (OS(LINUX) || OS(FREEBSD) || OS(SOLARIS)) && CPU(X86_64)
+ #define GLOBAL_REFERENCE(name) #name "@plt"
+ #elif CPU(X86) && COMPILER(MINGW)
+ #define GLOBAL_REFERENCE(name) "@" #name "@4"
+@@ -82,6 +82,7 @@
+ #if OS(DARWIN)
+ #define LOCAL_LABEL_STRING(name) "L" #name
+ #elif OS(LINUX) \
++ || OS(SOLARIS) \
+ || OS(FREEBSD) \
+ || OS(OPENBSD) \
+ || OS(HURD) \
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)
diff --git a/debian/patches/dyson-MathExtras.h.patch b/debian/patches/dyson-MathExtras.h.patch
new file mode 100644
index 0000000..4ade009
--- /dev/null
+++ b/debian/patches/dyson-MathExtras.h.patch
@@ -0,0 +1,29 @@
+Index: webkit/Source/WTF/wtf/MathExtras.h
+===================================================================
+--- webkit.orig/Source/WTF/wtf/MathExtras.h
++++ webkit/Source/WTF/wtf/MathExtras.h
+@@ -76,24 +76,6 @@ inline double wtf_ceil(double x) { retur
+
+ #endif
+
+-#if OS(SOLARIS)
+-
+-namespace std {
+-
+-#ifndef isfinite
+-inline bool isfinite(double x) { return finite(x) && !isnand(x); }
+-#endif
+-#ifndef signbit
+-inline bool signbit(double x) { return copysign(1.0, x) < 0; }
+-#endif
+-#ifndef isinf
+-inline bool isinf(double x) { return !finite(x) && !isnand(x); }
+-#endif
+-
+-} // namespace std
+-
+-#endif
+-
+ #if OS(OPENBSD)
+
+ namespace std {
diff --git a/debian/patches/dyson-g-ir-scanner-hangs.patch b/debian/patches/dyson-g-ir-scanner-hangs.patch
new file mode 100644
index 0000000..854a112
--- /dev/null
+++ b/debian/patches/dyson-g-ir-scanner-hangs.patch
@@ -0,0 +1,95 @@
+Description: deadlock in gobject introspection
+Bug-Dyson: http://osdyson.org/issues/161
+Bug-Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=463960
+Stack:
+25849: /home/pashev/packaging/webkitgtk/webkitgtk-2.0.4/build-2.0/tmp-introsp
+----------------- lwp# 1 / thread# 1 --------------------
+ fffffd7ffeeaf957 lwp_park (0, 0, 0)
+ fffffd7ffeea8036 mutex_lock_impl () + 156
+ fffffd7ffeea810b mutex_lock () + b
+ fffffd7ffee340fa _preexec_atfork_unload () + 3a
+ fffffd7ffee343ab _preexec_exit_handlers () + bb
+ fffffd7fff5ccf0d purge_exit_handlers () + 10d
+ fffffd7fff5cec18 remove_hdl () + ce8
+ fffffd7fff5c8895 dlclose_core () + c5
+ fffffd7fff5c88e5 dlclose_intn () + 15
+ fffffd7fff5c89bb dlclose_check () + 7b
+ fffffd7fff5c8a21 dlclose () + 41
+ fffffd7ffaa03c41 px_module_manager_load () + 191
+ fffffd7ffaa03cf6 px_module_manager_load_dir () + 66
+ fffffd7ffaa050d7 px_proxy_factory_new () + 107
+ fffffd7ffb201671 ???????? ()
+ fffffd7feca30eca g_type_create_instance () + 16a
+ fffffd7feca1597c ???????? ()
+ fffffd7feca17472 g_object_newv () + 792
+ fffffd7feca17aec g_object_new () + ec
+ fffffd7fece5d052 ???????? ()
+ fffffd7fece5d1d8 ???????? ()
+ fffffd7fc98659a5 ???????? ()
+ fffffd7feca173f6 g_object_newv () + 716
+ fffffd7feca17aec g_object_new () + ec
+ fffffd7fc986da24 soup_session_add_feature_by_type () + e4
+ fffffd7fc986fb43 ???????? ()
+ fffffd7feca17e00 g_object_set_valist () + 300
+ fffffd7feca186d7 g_object_set () + e7
+ fffffd7fc5724f87 WebCore::ResourceHandle::defaultSession() () + a7
+ fffffd7fc48da299 webkitExit() () + 9
+ fffffd7ffee33f56 _exithandle () + 66
+ fffffd7ffee1e191 exit () + 11
+ 00000000004086af ???????? ()
+ 000000000040724c _start () + 6c
+----------------- lwp# 2 / thread# 2 --------------------
+ fffffd7ffeeaf957 lwp_park (0, 0, 0)
+ fffffd7ffeea94bf cond_wait_queue () + 4f
+ fffffd7ffeea9b12 __cond_wait () + b2
+ fffffd7ffeea9b42 cond_wait () + 22
+ fffffd7ffeea9b79 pthread_cond_wait () + 9
+ fffffd7fc4eed04b WebCore::IconDatabase::syncThreadMainLoop() () + 12b
+ fffffd7fc4eed278 WebCore::IconDatabase::iconDatabaseSyncThread() () + 138
+ fffffd7fc3b2bc59 WTF::wtfThreadEntryPoint(void*) () + 19
+ fffffd7ffeeaf617 _thrp_setup () + 77
+ fffffd7ffeeaf910 _lwp_start ()
+----------------- lwp# 3 / thread# 3 --------------------
+ fffffd7ffeeaf957 lwp_park (0, 0, 0)
+ fffffd7ffeea8036 mutex_lock_impl () + 156
+ fffffd7ffeea810b mutex_lock () + b
+ fffffd7ffee33e17 atexit_locks () + 17
+ fffffd7ffee58ce9 libc_prepare_atfork () + 9
+ fffffd7ffee34533 _prefork_handler () + 33
+ fffffd7ffee9fc85 forkx () + 275
+ fffffd7ffee9fcab fork () + b
+ fffffd7fec68aacb ???????? ()
+ fffffd7fec68b2a7 g_spawn_sync () + 167
+ fffffd7fec68b994 g_spawn_command_line_sync () + 74
+ fffffd7feceb2748 ???????? ()
+ fffffd7feceb4019 g_dbus_address_get_for_bus_sync () + 2c9
+ fffffd7fecebd11e ???????? ()
+ fffffd7fecec4643 g_bus_get_sync () + 63
+ fffffd7ffc60700b ???????? ()
+ fffffd7ffc60714f ???????? ()
+ fffffd7fec648ad0 g_main_context_dispatch () + 130
+ fffffd7fec648e40 ???????? ()
+ fffffd7fec648f08 g_main_context_iteration () + 38
+ fffffd7ffc606f65 ???????? ()
+ fffffd7fec66d50d ???????? ()
+ fffffd7ffeeaf617 _thrp_setup () + 77
+ fffffd7ffeeaf910 _lwp_start ()
+Index: webkit/Source/WebKit/gtk/webkit/webkitglobals.cpp
+===================================================================
+--- webkit.orig/Source/WebKit/gtk/webkit/webkitglobals.cpp 2013-12-02 00:06:10.504150531 +0400
++++ webkit/Source/WebKit/gtk/webkit/webkitglobals.cpp 2013-12-03 14:08:05.956932011 +0400
+@@ -564,6 +564,14 @@
+
+ WebCore::SchemeRegistry::registerURLSchemeAsLocal("resource");
+
++ // http://osdyson.org/issues/161
++ // WebKitGTK FTBFS when building GObject introspection due to deadlock.
++ // When gobject introspection is done, a simple program call exit()
++ // exit() -> webkitExit() -> g_object_unref() -> webkit_get_default_session()
++ // -> ResourceHandle::defaultSession() => default session doesn't exist! AND
++ // we try to create it! Thus deadlock. So, create default session earlier:
++ (void) webkit_get_default_session();
++
+ atexit(webkitExit);
+ }
+
diff --git a/debian/patches/dyson-gcc.patch b/debian/patches/dyson-gcc.patch
new file mode 100644
index 0000000..46f3a63
--- /dev/null
+++ b/debian/patches/dyson-gcc.patch
@@ -0,0 +1,26 @@
+Index: webkitgtk-2.4.11/Source/WebCore/bindings/scripts/preprocessor.pm
+===================================================================
+--- webkitgtk-2.4.11.orig/Source/WebCore/bindings/scripts/preprocessor.pm
++++ webkitgtk-2.4.11/Source/WebCore/bindings/scripts/preprocessor.pm
+@@ -47,8 +47,6 @@ sub applyPreprocessor
+ require Config;
+ if ($ENV{CC}) {
+ $preprocessor = $ENV{CC};
+- } elsif (($Config::Config{'osname'}) =~ /solaris/i) {
+- $preprocessor = "/usr/sfw/bin/gcc";
+ } elsif (-x "/usr/bin/clang") {
+ $preprocessor = "/usr/bin/clang";
+ } elsif ($Config{osname} eq 'msys') {
+Index: webkitgtk-2.4.11/Source/WebCore/dom/make_names.pl
+===================================================================
+--- webkitgtk-2.4.11.orig/Source/WebCore/dom/make_names.pl
++++ webkitgtk-2.4.11/Source/WebCore/dom/make_names.pl
+@@ -65,8 +65,6 @@ require Config;
+ my $gccLocation = "";
+ if ($ENV{CC}) {
+ $gccLocation = $ENV{CC};
+-} elsif (($Config::Config{"osname"}) =~ /solaris/i) {
+- $gccLocation = "/usr/sfw/bin/gcc";
+ } elsif ($Config::Config{"osname"} eq "darwin" && $ENV{SDKROOT}) {
+ chomp($gccLocation = `xcrun -find cc -sdk '$ENV{SDKROOT}'`);
+ } elsif ($Config::Config{"osname"} eq "msys") {
diff --git a/debian/patches/dyson-solaris-amd64-memory-layout.patch b/debian/patches/dyson-solaris-amd64-memory-layout.patch
new file mode 100644
index 0000000..e52ea77
--- /dev/null
+++ b/debian/patches/dyson-solaris-amd64-memory-layout.patch
@@ -0,0 +1,492 @@
+Description: fix for Solaris/amd64 memory layout
+ This patch:
+ 1. Fixes C++ classes
+ 2. Disables JIT and enables LLInt
+ 3. Fixes LLInt
+
+ TODO: Fix JIT
+Bug-Dyson: http://osdyson.org/issues/160
+Index: webkit/Source/WTF/wtf/Platform.h
+===================================================================
+--- webkit.orig/Source/WTF/wtf/Platform.h
++++ webkit/Source/WTF/wtf/Platform.h
+@@ -434,6 +434,15 @@
+ #define WTF_OS_SOLARIS 1
+ #endif
+
++#if CPU(X86_64) && OS(SOLARIS)
++# define WTF_OS_SOLARIS_AMD64 1
++# endif
++
++// Let's port LLInt first:
++#if OS(SOLARIS_AMD64)
++#define ENABLE_JIT 0
++#endif
++
+ /* OS(WINCE) - Windows CE; note that for this platform OS(WINDOWS) is also defined */
+ #if defined(_WIN32_WCE)
+ #define WTF_OS_WINCE 1
+@@ -762,7 +771,7 @@
+ low-level interpreter. */
+ #if !defined(ENABLE_LLINT) \
+ && ENABLE(JIT) \
+- && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD) || OS(HURD)) \
++ && (OS(SOLARIS) || OS(DARWIN) || OS(LINUX) || OS(FREEBSD) || OS(HURD)) \
+ && (PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(GTK)) \
+ && (CPU(X86) || CPU(X86_64) || CPU(ARM_THUMB2) || CPU(ARM_TRADITIONAL) || CPU(ARM64) || CPU(MIPS) || CPU(SH4))
+ #define ENABLE_LLINT 1
+@@ -770,7 +779,7 @@
+
+ #if !defined(ENABLE_DFG_JIT) && ENABLE(JIT) && !COMPILER(MSVC)
+ /* Enable the DFG JIT on X86 and X86_64. */
+-#if (CPU(X86) || CPU(X86_64)) && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD) || OS(HURD))
++#if (CPU(X86) || CPU(X86_64)) && (OS(SOLARIS) || OS(DARWIN) || OS(LINUX) || OS(FREEBSD) || OS(HURD))
+ #define ENABLE_DFG_JIT 1
+ #endif
+ /* Enable the DFG JIT on ARMv7. Only tested on iOS and Qt/GTK+ Linux. */
+Index: webkit/Source/JavaScriptCore/runtime/JSCJSValue.h
+===================================================================
+--- webkit.orig/Source/JavaScriptCore/runtime/JSCJSValue.h
++++ webkit/Source/JavaScriptCore/runtime/JSCJSValue.h
+@@ -405,6 +405,14 @@ private:
+ // alignment for a GC cell, and in the zero page).
+ #define ValueEmpty 0x0ll
+ #define ValueDeleted 0x4ll
++#if OS(SOLARIS_AMD64)
++// https://bugzilla.mozilla.org/show_bug.cgi?id=577056
++// Memory layout for 64-bit Solaris is different than other 64-bit systems.
++// User space memory may locate on PART-A (0xFFFFFD80.00000000 - 0xFFFF8000.00000000)
++// and PART-B (0x00008000.00000000 - 0x00000000.04000000).
++ bool isSolarisAMD64StackPointer() const;
++#endif
++
+ #endif
+
+ EncodedValueDescriptor u;
+Index: webkit/Source/JavaScriptCore/runtime/JSCJSValueInlines.h
+===================================================================
+--- webkit.orig/Source/JavaScriptCore/runtime/JSCJSValueInlines.h
++++ webkit/Source/JavaScriptCore/runtime/JSCJSValueInlines.h
+@@ -336,6 +336,13 @@ inline bool JSValue::asBoolean() const
+
+ #else // !USE(JSVALUE32_64) i.e. USE(JSVALUE64)
+
++#if OS(SOLARIS_AMD64)
++inline bool JSValue::isSolarisAMD64StackPointer() const
++{
++ return ((u.asInt64 & 0xFFFF800000000000LL) == 0xFFFF800000000000LL);
++}
++#endif
++
+ // 0x0 can never occur naturally because it has a tag of 00, indicating a pointer value, but a payload of 0x0, which is in the (invalid) zero page.
+ inline JSValue::JSValue()
+ {
+@@ -412,6 +419,10 @@ inline int32_t JSValue::asInt32() const
+
+ inline bool JSValue::isDouble() const
+ {
++#if OS(SOLARIS_AMD64)
++ if (isSolarisAMD64StackPointer())
++ return false;
++#endif
+ return isNumber() && !isInt32();
+ }
+
+@@ -437,22 +448,38 @@ inline JSValue::JSValue(JSFalseTag)
+
+ inline bool JSValue::isUndefinedOrNull() const
+ {
++#if OS(SOLARIS_AMD64)
++ if (isSolarisAMD64StackPointer())
++ return false;
++#endif
+ // Undefined and null share the same value, bar the 'undefined' bit in the extended tag.
+ return (u.asInt64 & ~TagBitUndefined) == ValueNull;
+ }
+
+ inline bool JSValue::isBoolean() const
+ {
++#if OS(SOLARIS_AMD64)
++ if (isSolarisAMD64StackPointer())
++ return false;
++#endif
+ return (u.asInt64 & ~1) == ValueFalse;
+ }
+
+ inline bool JSValue::isCell() const
+ {
++#if OS(SOLARIS_AMD64)
++ if (isSolarisAMD64StackPointer())
++ return true; // TRUE!
++#endif
+ return !(u.asInt64 & TagMask);
+ }
+
+ inline bool JSValue::isInt32() const
+ {
++#if OS(SOLARIS_AMD64)
++ if (isSolarisAMD64StackPointer())
++ return false;
++#endif
+ return (u.asInt64 & TagTypeNumber) == TagTypeNumber;
+ }
+
+@@ -483,6 +510,10 @@ inline double JSValue::asDouble() const
+
+ inline bool JSValue::isNumber() const
+ {
++#if OS(SOLARIS_AMD64)
++ if (isSolarisAMD64StackPointer())
++ return false;
++#endif
+ return u.asInt64 & TagTypeNumber;
+ }
+
+Index: webkit/Source/JavaScriptCore/jit/JITInlines.h
+===================================================================
+--- webkit.orig/Source/JavaScriptCore/jit/JITInlines.h
++++ webkit/Source/JavaScriptCore/jit/JITInlines.h
+@@ -989,7 +989,14 @@ ALWAYS_INLINE void JIT::emitInitRegister
+
+ ALWAYS_INLINE JIT::Jump JIT::emitJumpIfJSCell(RegisterID reg)
+ {
++#if OS(SOLARIS_AMD64)
++ // Does "reg" hold solaris 64-bit stack pointer?
++ move(TrustedImm64(static_cast<uint64_t>(0xFFFF800000000000)), scratchRegister);
++ and64(reg, scratchRegister);
++ return branch64(Equal, scratchRegister, TrustedImm64(static_cast<uint64_t>(0xFFFF800000000000)));
++#else
+ return branchTest64(Zero, reg, tagMaskRegister);
++#endif
+ }
+
+ ALWAYS_INLINE JIT::Jump JIT::emitJumpIfBothJSCells(RegisterID reg1, RegisterID reg2, RegisterID scratch)
+Index: webkit/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
+===================================================================
+--- webkit.orig/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
++++ webkit/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
+@@ -323,12 +323,21 @@ end
+
+ macro loadConstantOrVariableInt32(index, value, slow)
+ loadConstantOrVariable(index, value)
++if SOLARIS_AMD64
++ bqaeq value, solarisAMD64StackBottom, slow
++end
+ bqb value, tagTypeNumber, slow
+ end
+
+ macro loadConstantOrVariableCell(index, value, slow)
+ loadConstantOrVariable(index, value)
++if SOLARIS_AMD64
++ bqaeq value, solarisAMD64StackBottom, .done
++end
+ btqnz value, tagMask, slow
++if SOLARIS_AMD64
++.done:
++end
+ end
+
+ macro writeBarrierOnOperand(cellOperand)
+@@ -518,7 +527,13 @@ _llint_op_to_this:
+ traceExecution()
+ loadisFromInstruction(1, t0)
+ loadq [cfr, t0, 8], t0
++if SOLARIS_AMD64
++ bqaeq t0, solarisAMD64StackBottom, .opToThisSolarisAMD64StackPointer
++end
+ btqnz t0, tagMask, .opToThisSlow
++if SOLARIS_AMD64
++.opToThisSolarisAMD64StackPointer:
++end
+ loadp JSCell::m_structure[t0], t0
+ bbneq Structure::m_typeInfo + TypeInfo::m_type[t0], FinalObjectType, .opToThisSlow
+ loadpFromInstruction(2, t2)
+@@ -636,7 +651,13 @@ _llint_op_neq:
+ macro equalNullComparison()
+ loadisFromInstruction(2, t0)
+ loadq [cfr, t0, 8], t0
++if SOLARIS_AMD64
++ bqaeq t0, solarisAMD64StackBottom, .solarisAMD64StackPointer
++end
+ btqnz t0, tagMask, .immediate
++if SOLARIS_AMD64
++.solarisAMD64StackPointer:
++end
+ loadp JSCell::m_structure[t0], t2
+ btbnz Structure::m_typeInfo + TypeInfo::m_flags[t2], MasqueradesAsUndefined, .masqueradesAsUndefined
+ move 0, t0
+@@ -676,6 +697,10 @@ macro strictEq(equalityOperation, slowPa
+ loadisFromInstruction(2, t2)
+ loadConstantOrVariable(t0, t1)
+ loadConstantOrVariable(t2, t0)
++if SOLARIS_AMD64
++ bqaeq t0, solarisAMD64StackBottom, .slow
++ bqaeq t1, solarisAMD64StackBottom, .slow
++end
+ move t0, t2
+ orq t1, t2
+ btqz t2, tagMask, .slow
+@@ -712,6 +737,9 @@ macro preOp(arithmeticOperation, slowPat
+ traceExecution()
+ loadisFromInstruction(1, t0)
+ loadq [cfr, t0, 8], t1
++if SOLARIS_AMD64
++ bqaeq t1, solarisAMD64StackBottom, .slow
++end
+ bqb t1, tagTypeNumber, .slow
+ arithmeticOperation(t1, .slow)
+ orq tagTypeNumber, t1
+@@ -740,6 +768,9 @@ _llint_op_to_number:
+ loadisFromInstruction(2, t0)
+ loadisFromInstruction(1, t1)
+ loadConstantOrVariable(t0, t2)
++if SOLARIS_AMD64
++ bqaeq t2, solarisAMD64StackBottom, .opToNumberSlow
++end
+ bqaeq t2, tagTypeNumber, .opToNumberIsImmediate
+ btqz t2, tagTypeNumber, .opToNumberSlow
+ .opToNumberIsImmediate:
+@@ -756,6 +787,9 @@ _llint_op_negate:
+ loadisFromInstruction(2, t0)
+ loadisFromInstruction(1, t1)
+ loadConstantOrVariable(t0, t2)
++if SOLARIS_AMD64
++ bqaeq t2, solarisAMD64StackBottom, .opNegateSlow
++end
+ bqb t2, tagTypeNumber, .opNegateNotInt
+ btiz t2, 0x7fffffff, .opNegateSlow
+ negi t2
+@@ -778,7 +812,13 @@ macro binaryOpCustomStore(integerOperati
+ loadisFromInstruction(2, t2)
+ loadConstantOrVariable(t0, t1)
+ loadConstantOrVariable(t2, t0)
++if SOLARIS_AMD64
++ bqaeq t0, solarisAMD64StackBottom, .slow
++end
+ bqb t0, tagTypeNumber, .op1NotInt
++if SOLARIS_AMD64
++ bqaeq t1, solarisAMD64StackBottom, .op2NotInt
++end
+ bqb t1, tagTypeNumber, .op2NotInt
+ loadisFromInstruction(1, t2)
+ integerOperationAndStore(t1, t0, .slow, t2)
+@@ -787,6 +827,9 @@ macro binaryOpCustomStore(integerOperati
+ .op1NotInt:
+ # First operand is definitely not an int, the second operand could be anything.
+ btqz t0, tagTypeNumber, .slow
++if SOLARIS_AMD64
++ bqaeq t1, solarisAMD64StackBottom, .slow
++end
+ bqaeq t1, tagTypeNumber, .op1NotIntOp2Int
+ btqz t1, tagTypeNumber, .slow
+ addq tagTypeNumber, t1
+@@ -807,6 +850,9 @@ macro binaryOpCustomStore(integerOperati
+ .op2NotInt:
+ # First operand is definitely an int, the second is definitely not.
+ loadisFromInstruction(1, t2)
++if SOLARIS_AMD64
++ bqaeq t1, solarisAMD64StackBottom, .slow
++end
+ btqz t1, tagTypeNumber, .slow
+ ci2d t0, ft0
+ addq tagTypeNumber, t1
+@@ -901,6 +947,10 @@ macro bitOp(operation, slowPath, advance
+ loadisFromInstruction(1, t3)
+ loadConstantOrVariable(t0, t1)
+ loadConstantOrVariable(t2, t0)
++if SOLARIS_AMD64
++ bqaeq t0, solarisAMD64StackBottom, .slow
++ bqaeq t1, solarisAMD64StackBottom, .slow
++end
+ bqb t0, tagTypeNumber, .slow
+ bqb t1, tagTypeNumber, .slow
+ operation(t1, t0)
+@@ -1004,6 +1054,9 @@ _llint_op_instanceof:
+ loadp JSCell::m_structure[t2], t2
+ loadq Structure::m_prototype[t2], t2
+ bqeq t2, t1, .opInstanceofDone
++if SOLARIS_AMD64
++ bqaeq t2, solarisAMD64StackBottom, .opInstanceofLoop
++end
+ btqz t2, tagMask, .opInstanceofLoop
+
+ move 0, t0
+@@ -1022,6 +1075,9 @@ _llint_op_is_undefined:
+ loadisFromInstruction(2, t1)
+ loadisFromInstruction(1, t2)
+ loadConstantOrVariable(t1, t0)
++if SOLARIS_AMD64
++ bqaeq t0, solarisAMD64StackBottom, .opIsUndefinedCell
++end
+ btqz t0, tagMask, .opIsUndefinedCell
+ cqeq t0, ValueUndefined, t3
+ orq ValueFalse, t3
+@@ -1059,6 +1115,12 @@ _llint_op_is_number:
+ loadisFromInstruction(2, t1)
+ loadisFromInstruction(1, t2)
+ loadConstantOrVariable(t1, t0)
++if SOLARIS_AMD64
++ bqb t0, solarisAMD64StackBottom, .opIsNumberNotSolarisAMD64StackPointer
++ storeq ValueFalse, [cfr, t2, 8]
++ dispatch(3)
++.opIsNumberNotSolarisAMD64StackPointer:
++end
+ tqnz t0, tagTypeNumber, t1
+ orq ValueFalse, t1
+ storeq t1, [cfr, t2, 8]
+@@ -1070,7 +1132,13 @@ _llint_op_is_string:
+ loadisFromInstruction(2, t1)
+ loadisFromInstruction(1, t2)
+ loadConstantOrVariable(t1, t0)
++if SOLARIS_AMD64
++ bqaeq t0, solarisAMD64StackBottom, .opIsStringSolarisAMD64StackPointer
++end
+ btqnz t0, tagMask, .opIsStringNotCell
++if SOLARIS_AMD64
++.opIsStringSolarisAMD64StackPointer:
++end
+ loadp JSCell::m_structure[t0], t0
+ cbeq Structure::m_typeInfo + TypeInfo::m_type[t0], StringType, t1
+ orq ValueFalse, t1
+@@ -1421,6 +1489,9 @@ macro putByVal(holeCheck, slowPath)
+ contiguousPutByVal(
+ macro (operand, scratch, address)
+ loadConstantOrVariable(operand, scratch)
++if SOLARIS_AMD64
++ bqaeq scratch, solarisAMD64StackBottom, .opPutByValSlow
++end
+ bpb scratch, tagTypeNumber, .opPutByValSlow
+ storep scratch, address
+ end)
+@@ -1430,6 +1501,9 @@ macro putByVal(holeCheck, slowPath)
+ contiguousPutByVal(
+ macro (operand, scratch, address)
+ loadConstantOrVariable(operand, scratch)
++if SOLARIS_AMD64
++ bqaeq scratch, solarisAMD64StackBottom, .notInt
++end
+ bqb scratch, tagTypeNumber, .notInt
+ ci2d scratch, ft0
+ jmp .ready
+@@ -1512,7 +1586,13 @@ macro equalNull(cellHandler, immediateHa
+ loadisFromInstruction(1, t0)
+ assertNotConstant(t0)
+ loadq [cfr, t0, 8], t0
++if SOLARIS_AMD64
++ bqaeq t0, solarisAMD64StackBottom, .solarisAMD64StackPointer
++end
+ btqnz t0, tagMask, .immediate
++if SOLARIS_AMD64
++.solarisAMD64StackPointer:
++end
+ loadp JSCell::m_structure[t0], t2
+ cellHandler(t2, Structure::m_typeInfo + TypeInfo::m_flags[t2], .target)
+ dispatch(3)
+@@ -1570,6 +1650,10 @@ macro compare(integerCompare, doubleComp
+ loadisFromInstruction(2, t3)
+ loadConstantOrVariable(t2, t0)
+ loadConstantOrVariable(t3, t1)
++if SOLARIS_AMD64
++ bqaeq t0, solarisAMD64StackBottom, .slow
++ bqaeq t1, solarisAMD64StackBottom, .slow
++end
+ bqb t0, tagTypeNumber, .op1NotInt
+ bqb t1, tagTypeNumber, .op2NotInt
+ integerCompare(t0, t1, .jumpTarget)
+@@ -1617,6 +1701,9 @@ _llint_op_switch_imm:
+ muli sizeof SimpleJumpTable, t3 # FIXME: would be nice to peephole this!
+ loadp CodeBlock::RareData::m_switchJumpTables + VectorBufferOffset[t2], t2
+ addp t3, t2
++if SOLARIS_AMD64
++ bqaeq t1, solarisAMD64StackBottom, .opSwitchImmFallThrough
++end
+ bqb t1, tagTypeNumber, .opSwitchImmNotInt
+ subi SimpleJumpTable::min[t2], t1
+ biaeq t1, SimpleJumpTable::branchOffsets + VectorSizeOffset[t2], .opSwitchImmFallThrough
+@@ -1645,7 +1732,13 @@ _llint_op_switch_char:
+ muli sizeof SimpleJumpTable, t3
+ loadp CodeBlock::RareData::m_switchJumpTables + VectorBufferOffset[t2], t2
+ addp t3, t2
++if SOLARIS_AMD64
++ bqaeq t1, solarisAMD64StackBottom, .opSwitchCharSolarisAMD64StackPointer
++end
+ btqnz t1, tagMask, .opSwitchCharFallThrough
++if SOLARIS_AMD64
++.opSwitchCharSolarisAMD64StackPointer:
++end
+ loadp JSCell::m_structure[t1], t0
+ bbneq Structure::m_typeInfo + TypeInfo::m_type[t0], StringType, .opSwitchCharFallThrough
+ bineq JSString::m_length[t1], 1, .opSwitchCharFallThrough
+@@ -1695,7 +1788,13 @@ macro arrayProfileForCall()
+ loadisFromInstruction(4, t3)
+ negp t3
+ loadq ThisArgumentOffset[cfr, t3, 8], t0
++if SOLARIS_AMD64
++ bqaeq t0, solarisAMD64StackBottom, .solarisAMD64StackPointer
++end
+ btqnz t0, tagMask, .done
++if SOLARIS_AMD64
++.solarisAMD64StackPointer:
++end
+ loadp JSCell::m_structure[t0], t0
+ loadpFromInstruction(6, t1)
+ storep t0, ArrayProfile::m_lastSeenStructure[t1]
+@@ -1759,7 +1858,13 @@ _llint_op_ret_object_or_this:
+ checkSwitchToJITForEpilogue()
+ loadisFromInstruction(1, t2)
+ loadConstantOrVariable(t2, t0)
++if SOLARIS_AMD64
++ bqaeq t0, solarisAMD64StackBottom, .opRetObjectOrThisSolarisAMD64StackPointer
++end
+ btqnz t0, tagMask, .opRetObjectOrThisNotObject
++if SOLARIS_AMD64
++.opRetObjectOrThisSolarisAMD64StackPointer:
++end
+ loadp JSCell::m_structure[t0], t2
+ bbb Structure::m_typeInfo + TypeInfo::m_type[t2], ObjectType, .opRetObjectOrThisNotObject
+ doReturn()
+@@ -1775,7 +1880,13 @@ _llint_op_to_primitive:
+ loadisFromInstruction(2, t2)
+ loadisFromInstruction(1, t3)
+ loadConstantOrVariable(t2, t0)
++if SOLARIS_AMD64
++ bqaeq t0, solarisAMD64StackBottom, .opToPrimitiveSolarisAMD64StackPointer
++end
+ btqnz t0, tagMask, .opToPrimitiveIsImm
++if SOLARIS_AMD64
++.opToPrimitiveSolarisAMD64StackPointer:
++end
+ loadp JSCell::m_structure[t0], t2
+ bbneq Structure::m_typeInfo + TypeInfo::m_type[t2], StringType, .opToPrimitiveSlowCase
+ .opToPrimitiveIsImm:
+Index: webkit/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
+===================================================================
+--- webkit.orig/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
++++ webkit/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
+@@ -124,6 +124,12 @@
+ #define OFFLINE_ASM_JSVALUE64 0
+ #endif
+
++#if OS(SOLARIS_AMD64)
++#define OFFLINE_ASM_SOLARIS_AMD64 1
++#else
++#define OFFLINE_ASM_SOLARIS_AMD64 0
++#endif
++
+ #if !ASSERT_DISABLED
+ #define OFFLINE_ASM_ASSERT_ENABLED 1
+ #else
+Index: webkit/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
+===================================================================
+--- webkit.orig/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
++++ webkit/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
+@@ -60,6 +60,9 @@ const ValueFalse = TagBitTypeOther
+ const ValueTrue = TagBitTypeOther | TagBitBool | 1
+ const ValueUndefined = TagBitTypeOther | TagBitUndefined
+ const ValueNull = TagBitTypeOther
++if SOLARIS_AMD64
++const solarisAMD64StackBottom = 0xFFFF800000000000
++end
+ else
+ const Int32Tag = -1
+ const BooleanTag = -2
diff --git a/debian/patches/dyson-use-system-malloc.patch b/debian/patches/dyson-use-system-malloc.patch
new file mode 100644
index 0000000..4cc3559
--- /dev/null
+++ b/debian/patches/dyson-use-system-malloc.patch
@@ -0,0 +1,15 @@
+Index: webkit/Source/WTF/wtf/Platform.h
+===================================================================
+--- webkit.orig/Source/WTF/wtf/Platform.h
++++ webkit/Source/WTF/wtf/Platform.h
+@@ -665,6 +665,10 @@
+ #define USE_SYSTEM_MALLOC 1
+ #endif
+
++#if OS(SOLARIS)
++#define USE_SYSTEM_MALLOC 1
++#endif
++
+ #if !defined(ENABLE_GLOBAL_FASTMALLOC_NEW)
+ #define ENABLE_GLOBAL_FASTMALLOC_NEW 1
+ #endif
diff --git a/debian/patches/dyson-uses-gnu-ld.patch b/debian/patches/dyson-uses-gnu-ld.patch
new file mode 100644
index 0000000..46b2899
--- /dev/null
+++ b/debian/patches/dyson-uses-gnu-ld.patch
@@ -0,0 +1,13 @@
+Index: webkit/Source/autotools/CheckSystemAndBasicDependencies.m4
+===================================================================
+--- webkit.orig/Source/autotools/CheckSystemAndBasicDependencies.m4 2013-12-02 00:06:10.832973190 +0400
++++ webkit/Source/autotools/CheckSystemAndBasicDependencies.m4 2013-12-04 15:19:00.159184752 +0400
+@@ -19,7 +19,7 @@
+ darwin*)
+ os_darwin=yes
+ ;;
+- gnu*|k*bsd*-gnu*)
++ gnu*|k*bsd*-gnu*|solaris*|kopensolaris-gnu)
+ os_gnu=yes
+ ;;
+ esac
diff --git a/debian/patches/dyson-webkit2-PluginProcess-missing-basename.patch b/debian/patches/dyson-webkit2-PluginProcess-missing-basename.patch
new file mode 100644
index 0000000..fa42513
--- /dev/null
+++ b/debian/patches/dyson-webkit2-PluginProcess-missing-basename.patch
@@ -0,0 +1,14 @@
+Index: webkit/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp
+===================================================================
+--- webkit.orig/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp 2013-12-02 00:06:10.542282436 +0400
++++ webkit/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp 2013-12-04 08:45:30.300783460 +0400
+@@ -26,6 +26,9 @@
+ */
+
+ #include "config.h"
++
++#include <libgen.h> // for basename()
++
+ #include "PluginProcessMainUnix.h"
+
+ #if ENABLE(PLUGIN_PROCESS)
diff --git a/debian/patches/series b/debian/patches/series
index ca1231e..107e4d9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,13 @@ x32_support.patch
disable-jit-nonsse2.patch
fix-ftbfs-m68k.patch
fix-ftbfs-gcc6.patch
+dyson-MathExtras.h.patch
+dyson-InlineASM.patch
+dyson-g-ir-scanner-hangs.patch
+dyson-webkit2-PluginProcess-missing-basename.patch
+dyson-uses-gnu-ld.patch
+dyson-use-system-malloc.patch
+dyson-solaris-amd64-memory-layout.patch
+dyson-gcc.patch
+dyson-HAVE_TM_GMTOFF.patch
+dyson-MachineStackMarker.patch