  
  # Add ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} to LD_LIBRARY_PATH
  string(COMPARE EQUAL "$ENV{LD_LIBRARY_PATH}" "" ld_library_path_not_exist)
-diff -Naur webkitgtk-2.10.7/Source/bmalloc/bmalloc/Allocator.cpp webkitgtk-2.10.7/Source/bmalloc/bmalloc/Allocator.cpp
---- webkitgtk-2.10.7/Source/bmalloc/bmalloc/Allocator.cpp	2016-01-28 14:25:09.000000000 +0530
-+++ webkitgtk-2.10.7/Source/bmalloc/bmalloc/Allocator.cpp	2016-02-25 08:32:40.000000000 +0530
-@@ -73,8 +73,12 @@
- 
-     if (!m_isBmallocEnabled) {
-         void* result = nullptr;
-+#ifdef __ANDROID__
-+        result = memalign(alignment, size);
-+#else
-         if (posix_memalign(&result, alignment, size))
-             return nullptr;
-+#endif
-         return result;
-     }
-     
+diff -Naur webkitgtk-2.10.7/Source/WTF/wtf/Assertions.cpp /home/eric/workspace/hemroid/vault/src/webkitgtk-2.10.7/Source/WTF/wtf/Assertions.cpp
+--- webkitgtk-2.10.7/Source/WTF/wtf/Assertions.cpp	2016-01-29 21:59:32.000000000 +0530
++++ /home/eric/workspace/hemroid/vault/src/webkitgtk-2.10.7/Source/WTF/wtf/Assertions.cpp	2016-04-05 22:52:15.496286112 +0530
+@@ -71,7 +71,9 @@
+ #if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
+ #include <cxxabi.h>
+ #include <dlfcn.h>
+-#include <execinfo.h>
++#  ifndef __ANDROID__
++#  include <execinfo.h>
++#  endif
+ #endif
+ 
+ extern "C" {
+@@ -225,7 +227,7 @@
+ 
+ void WTFGetBacktrace(void** stack, int* size)
+ {
+-#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
++#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__) && !defined(__ANDROID__))
+     *size = backtrace(stack, *size);
+ #elif OS(WINDOWS)
+     // The CaptureStackBackTrace function is available in XP, but it is not defined
+diff -Naur webkitgtk-2.10.7/Source/WTF/wtf/PlatformGTK.cmake /home/eric/workspace/hemroid/vault/src/webkitgtk-2.10.7/Source/WTF/wtf/PlatformGTK.cmake
+--- webkitgtk-2.10.7/Source/WTF/wtf/PlatformGTK.cmake	2016-01-29 21:59:32.000000000 +0530
++++ /home/eric/workspace/hemroid/vault/src/webkitgtk-2.10.7/Source/WTF/wtf/PlatformGTK.cmake	2016-04-05 22:52:15.496286112 +0530
+@@ -15,7 +15,7 @@
+     ${GLIB_GIO_LIBRARIES}
+     ${GLIB_GOBJECT_LIBRARIES}
+     ${GLIB_LIBRARIES}
+-    pthread
++#    pthread
+     ${ZLIB_LIBRARIES}
+ )
+ 
+diff -Naur webkitgtk-2.10.7/Source/WTF/wtf/Platform.h /home/eric/workspace/hemroid/vault/src/webkitgtk-2.10.7/Source/WTF/wtf/Platform.h
+--- webkitgtk-2.10.7/Source/WTF/wtf/Platform.h	2016-01-29 21:59:32.000000000 +0530
++++ /home/eric/workspace/hemroid/vault/src/webkitgtk-2.10.7/Source/WTF/wtf/Platform.h	2016-04-05 22:52:15.496286112 +0530
+@@ -590,7 +590,6 @@
+ 
+ #if OS(UNIX)
+ #define HAVE_ERRNO_H 1
+-#define HAVE_LANGINFO_H 1
+ #define HAVE_MMAP 1
+ #define HAVE_SIGNAL_H 1
+ #define HAVE_STRINGS_H 1
+@@ -599,6 +598,11 @@
+ #define USE_PTHREADS 1
+ #endif /* OS(UNIX) */
+ 
++#if OS(UNIX) && !defined(__ANDROID__)
++#define HAVE_LANGINFO_H 1
++#else
++#endif
++
+ #if (OS(FREEBSD) || OS(OPENBSD)) && !defined(__GLIBC__)
+ #define HAVE_PTHREAD_NP_H 1
+ #endif
+@@ -622,6 +626,9 @@
+ #if !OS(WINDOWS) && !OS(SOLARIS)
+ #define HAVE_TM_GMTOFF 1
+ #define HAVE_TM_ZONE 1
++#endif
++
++#if !defined(__ANDROID__)
+ #define HAVE_TIMEGM 1
+ #endif
+ 
+diff -Naur webkitgtk-2.10.7/Source/WTF/wtf/PlatformJSC.cmake /home/eric/workspace/hemroid/vault/src/webkitgtk-2.10.7/Source/WTF/wtf/PlatformJSC.cmake
+--- webkitgtk-2.10.7/Source/WTF/wtf/PlatformJSC.cmake	1970-01-01 05:30:00.000000000 +0530
++++ /home/eric/workspace/hemroid/vault/src/webkitgtk-2.10.7/Source/WTF/wtf/PlatformJSC.cmake	2016-04-05 22:52:15.496286112 +0530
+@@ -0,0 +1,24 @@
++set(WTF_LIBRARY_TYPE STATIC)
++set(WTF_OUTPUT_NAME WTFGTK)
++
++list(APPEND WTF_SOURCES
++    glib/GLibUtilities.cpp
++    glib/GMainLoopSource.cpp
++    glib/GRefPtr.cpp
++    glib/GThreadSafeMainLoopSource.cpp
++    glib/MainThreadGLib.cpp
++    glib/RunLoopGLib.cpp
++    glib/WorkQueueGLib.cpp
++)
++
++list(APPEND WTF_LIBRARIES
++    ${GLIB_GIO_LIBRARIES}
++    ${GLIB_GOBJECT_LIBRARIES}
++    ${GLIB_LIBRARIES}
++#    pthread
++    ${ZLIB_LIBRARIES}
++)
++
++list(APPEND WTF_SYSTEM_INCLUDE_DIRECTORIES
++    ${GLIB_INCLUDE_DIRS}
++)
+diff -Naur webkitgtk-2.10.7/Source/WTF/wtf/ThreadIdentifierDataPthreads.cpp /home/eric/workspace/hemroid/vault/src/webkitgtk-2.10.7/Source/WTF/wtf/ThreadIdentifierDataPthreads.cpp
+--- webkitgtk-2.10.7/Source/WTF/wtf/ThreadIdentifierDataPthreads.cpp	2016-01-28 14:25:09.000000000 +0530
++++ /home/eric/workspace/hemroid/vault/src/webkitgtk-2.10.7/Source/WTF/wtf/ThreadIdentifierDataPthreads.cpp	2016-04-05 22:52:15.496286112 +0530
+@@ -36,7 +36,7 @@
+ 
+ #include "Threading.h"
+ 
+-#if OS(HURD)
++#if OS(HURD) || defined(__ANDROID__)
+ // PTHREAD_KEYS_MAX is not defined in bionic nor in Hurd, so explicitly define it here.
+ #define PTHREAD_KEYS_MAX 1024
+ #else

 
 if (ENABLE_WEBKIT)
     WEBKIT_SET_EXTRA_COMPILER_FLAGS(WebKit ${ADDITIONAL_COMPILER_FLAGS})
diff -Naur webkitgtk-2.10.7/Source/JavaScriptCore/CMakeLists.txt webkitgtk-2.10.7/Source/JavaScriptCore/CMakeLists.txt
--- webkitgtk-2.10.7/Source/JavaScriptCore/CMakeLists.txt	2016-01-29 21:59:32.000000000 +0530
+++ webkitgtk-2.10.7/Source/JavaScriptCore/CMakeLists.txt	2016-04-05 21:14:58.000000000 +0530
@@ -752,7 +752,11 @@
     ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp
     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h
 )
-target_link_libraries(LLIntOffsetsExtractor WTF)
+if ( MIPS OR MIPS64 )
+    target_link_libraries(LLIntOffsetsExtractor WTF -L${SANDBOX}/lib ffi gmodule-2.0 icudata intl iconv)
+else ()
+    target_link_libraries(LLIntOffsetsExtractor WTF)
+endif ()
 
 # The build system will execute asm.rb every time LLIntOffsetsExtractor's mtime is newer than
 # LLIntAssembly.h's mtime. The problem we have here is: asm.rb has some built-in optimization
diff -Naur webkitgtk-2.10.7/Source/JavaScriptCore/PlatformJSC.cmake webkitgtk-2.10.7/Source/JavaScriptCore/PlatformJSC.cmake
--- webkitgtk-2.10.7/Source/JavaScriptCore/PlatformJSC.cmake	1970-01-01 05:30:00.000000000 +0530
+++ webkitgtk-2.10.7/Source/JavaScriptCore/PlatformJSC.cmake	2016-04-03 17:11:19.000000000 +0530
@@ -0,0 +1,42 @@
+set(JavaScriptCore_OUTPUT_NAME javascriptcoregtk-${WEBKITGTK_API_VERSION})
+
+configure_file(javascriptcoregtk.pc.in ${CMAKE_BINARY_DIR}/Source/JavaScriptCore/javascriptcoregtk-${WEBKITGTK_API_VERSION}.pc @ONLY)
+configure_file(JavaScriptCore.gir.in ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir @ONLY)
+
+add_custom_command(
+    OUTPUT ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.typelib
+    DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
+    COMMAND ${INTROSPECTION_COMPILER} ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir -o ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.typelib
+)
+
+install(FILES "${CMAKE_BINARY_DIR}/Source/JavaScriptCore/javascriptcoregtk-${WEBKITGTK_API_VERSION}.pc"
+        DESTINATION "${LIB_INSTALL_DIR}/pkgconfig"
+)
+
+install(FILES API/JavaScript.h
+              API/JSBase.h
+              API/JSContextRef.h
+              API/JSObjectRef.h
+              API/JSStringRef.h
+              API/JSValueRef.h
+              API/WebKitAvailability.h
+        DESTINATION "${WEBKITGTK_HEADER_INSTALL_DIR}/JavaScriptCore"
+)
+
+if (ENABLE_INTROSPECTION)
+    install(FILES ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
+            DESTINATION ${INTROSPECTION_INSTALL_GIRDIR}
+    )
+    install(FILES ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.typelib
+            DESTINATION ${INTROSPECTION_INSTALL_TYPELIBDIR}
+    )
+endif ()
+
+add_definitions(-DSTATICALLY_LINKED_WITH_WTF)
+
+list(APPEND JavaScriptCore_LIBRARIES
+    ${GLIB_LIBRARIES}
+)
+list(APPEND JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES
+    ${GLIB_INCLUDE_DIRS}
+)
diff -Naur webkitgtk-2.10.7/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp webkitgtk-2.10.7/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp
--- webkitgtk-2.10.7/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp	2016-01-29 21:59:32.000000000 +0530
+++ webkitgtk-2.10.7/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp	2016-02-25 21:42:09.000000000 +0530
@@ -31,20 +31,22 @@
 
 #include "MacroAssemblerARM.h"

 #endif // OS(LINUX)
 
 #if (COMPILER(GCC_OR_CLANG) && defined(__VFP_FP__))
diff -Naur webkitgtk-2.10.7/Source/JavaScriptCore/CMakeLists.txt /home/eric/workspace/hemroid/vault/src/webkitgtk-2.10.7/Source/JavaScriptCore/CMakeLists.txt
--- webkitgtk-2.10.7/Source/JavaScriptCore/CMakeLists.txt	2016-01-29 21:59:32.000000000 +0530
+++ /home/eric/workspace/hemroid/vault/src/webkitgtk-2.10.7/Source/JavaScriptCore/CMakeLists.txt	2016-04-05 22:52:15.496286112 +0530
@@ -752,7 +752,11 @@
     ${JAVASCRIPTCORE_DIR}/llint/LLIntOffsetsExtractor.cpp
     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/Bytecodes.h
 )
-target_link_libraries(LLIntOffsetsExtractor WTF)
+if ( MIPS OR MIPS64 )
+    target_link_libraries(LLIntOffsetsExtractor WTF -L${SANDBOX}/lib ffi gmodule-2.0 icudata intl iconv)
+else ()
+    target_link_libraries(LLIntOffsetsExtractor WTF)
+endif ()
 
 # The build system will execute asm.rb every time LLIntOffsetsExtractor's mtime is newer than
 # LLIntAssembly.h's mtime. The problem we have here is: asm.rb has some built-in optimization
diff -Naur webkitgtk-2.10.7/Source/JavaScriptCore/PlatformJSC.cmake /home/eric/workspace/hemroid/vault/src/webkitgtk-2.10.7/Source/JavaScriptCore/PlatformJSC.cmake
--- webkitgtk-2.10.7/Source/JavaScriptCore/PlatformJSC.cmake	1970-01-01 05:30:00.000000000 +0530
+++ /home/eric/workspace/hemroid/vault/src/webkitgtk-2.10.7/Source/JavaScriptCore/PlatformJSC.cmake	2016-04-05 22:52:15.496286112 +0530
@@ -0,0 +1,42 @@
+set(JavaScriptCore_OUTPUT_NAME javascriptcoregtk-${WEBKITGTK_API_VERSION})
+
+configure_file(javascriptcoregtk.pc.in ${CMAKE_BINARY_DIR}/Source/JavaScriptCore/javascriptcoregtk-${WEBKITGTK_API_VERSION}.pc @ONLY)
+configure_file(JavaScriptCore.gir.in ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir @ONLY)
+
+add_custom_command(
+    OUTPUT ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.typelib
+    DEPENDS ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
+    COMMAND ${INTROSPECTION_COMPILER} ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir -o ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.typelib
+)
+
+install(FILES "${CMAKE_BINARY_DIR}/Source/JavaScriptCore/javascriptcoregtk-${WEBKITGTK_API_VERSION}.pc"
+        DESTINATION "${LIB_INSTALL_DIR}/pkgconfig"
+)
+
+install(FILES API/JavaScript.h
+              API/JSBase.h
+              API/JSContextRef.h
+              API/JSObjectRef.h
+              API/JSStringRef.h
+              API/JSValueRef.h
+              API/WebKitAvailability.h
+        DESTINATION "${WEBKITGTK_HEADER_INSTALL_DIR}/JavaScriptCore"
+)
+
+if (ENABLE_INTROSPECTION)
+    install(FILES ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.gir
+            DESTINATION ${INTROSPECTION_INSTALL_GIRDIR}
+    )
+    install(FILES ${CMAKE_BINARY_DIR}/JavaScriptCore-${WEBKITGTK_API_VERSION}.typelib
+            DESTINATION ${INTROSPECTION_INSTALL_TYPELIBDIR}
+    )
+endif ()
+
+add_definitions(-DSTATICALLY_LINKED_WITH_WTF)
+
+list(APPEND JavaScriptCore_LIBRARIES
+    ${GLIB_LIBRARIES}
+)
+list(APPEND JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES
+    ${GLIB_INCLUDE_DIRS}
+)
diff -Naur webkitgtk-2.10.7/Source/JavaScriptCore/runtime/MathObject.cpp /home/eric/workspace/hemroid/vault/src/webkitgtk-2.10.7/Source/JavaScriptCore/runtime/MathObject.cpp
--- webkitgtk-2.10.7/Source/JavaScriptCore/runtime/MathObject.cpp	2016-01-29 21:59:32.000000000 +0530
+++ /home/eric/workspace/hemroid/vault/src/webkitgtk-2.10.7/Source/JavaScriptCore/runtime/MathObject.cpp	2016-04-05 22:52:15.496286112 +0530
@@ -355,6 +355,9 @@
 
 EncodedJSValue JSC_HOST_CALL mathProtoFuncLog2(ExecState* exec)
