      // Only allow powers of two.
      unsigned log2size = static_cast<unsigned>(log2(size));
      bool isPOT(1UL << log2size == size);
+diff -Naur webkitgtk-2.10.7/Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp webkitgtk-2.10.7/Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp
+--- webkitgtk-2.10.7/Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp	2015-07-22 18:07:57.000000000 +0530
++++ webkitgtk-2.10.7/Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp	2016-04-05 22:52:15.496286112 +0530
+@@ -42,7 +42,11 @@
+ // Normal constructor: allocates for a given fftSize.
+ FFTFrame::FFTFrame(unsigned fftSize)
+     : m_FFTSize(fftSize)
++#ifdef __ANDROID__
++    , m_log2FFTSize(static_cast<unsigned>(log(fftSize) / log(2.)))
++#else
+     , m_log2FFTSize(static_cast<unsigned>(log2(fftSize)))
++#endif
+     , m_complexData(std::make_unique<GstFFTF32Complex[]>(unpackedFFTDataSize(m_FFTSize)))
+     , m_realData(unpackedFFTDataSize(m_FFTSize))
+     , m_imagData(unpackedFFTDataSize(m_FFTSize))
+diff -Naur webkitgtk-2.10.7/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp webkitgtk-2.10.7/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp
+--- webkitgtk-2.10.7/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp	2016-01-28 14:25:09.000000000 +0530
++++ webkitgtk-2.10.7/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp	2016-04-05 22:52:15.496286112 +0530
+@@ -43,7 +43,13 @@
+     
+     if (variable.isArray()) {
+         for (unsigned i = 0; i < variable.elementCount(); i++) {
++#ifdef __ANDROID__
++			char i_string[20];
++			sprintf(i_string, "%u", i);
++            std::string arrayBrackets = "[" + std::string(i_string) + "]";
++#else
+             std::string arrayBrackets = "[" + std::to_string(i) + "]";
++#endif
+             std::string arrayName = name + arrayBrackets;
+             std::string arrayMappedName = mappedName + arrayBrackets;
+             LOG(WebGL, "Map shader symbol %s -> %s\n", arrayName.c_str(), arrayMappedName.c_str());
+@@ -72,7 +78,13 @@
+     if (variable.isStruct()) {
+         if (variable.isArray()) {
+             for (unsigned i = 0; i < variable.elementCount(); i++) {
+-                std::string arrayBrackets = "[" + std::to_string(i) + "]";
++#ifdef __ANDROID__
++  				char i_string[20];
++				sprintf(i_string, "%u", i);
++            	std::string arrayBrackets = "[" + std::string(i_string) + "]";
++#else
++            	std::string arrayBrackets = "[" + std::to_string(i) + "]";
++#endif
+                 std::string arrayName = variable.name + arrayBrackets;
+                 std::string arrayMappedName = variable.mappedName + arrayBrackets;
+                 for (const auto& field : variable.fields)
+diff -Naur webkitgtk-2.10.7/Source/WebCore/platform/graphics/GLContext.cpp webkitgtk-2.10.7/Source/WebCore/platform/graphics/GLContext.cpp
+--- webkitgtk-2.10.7/Source/WebCore/platform/graphics/GLContext.cpp	2016-01-29 21:59:33.000000000 +0530
++++ webkitgtk-2.10.7/Source/WebCore/platform/graphics/GLContext.cpp	2016-04-05 22:52:15.500286120 +0530
+@@ -132,7 +132,10 @@
+         return WTF::move(glxContext);
+ #endif
+ #if USE(EGL)
+-    if (auto eglContext = GLContextEGL::createContext(windowHandle, sharingContext))
++#ifdef __ANDROID__
++    EGLNativeWindowType EGLWindowHandle = reinterpret_cast<EGLNativeWindowType>(windowHandle);
++#endif
++    if (auto eglContext = GLContextEGL::createContext(EGLWindowHandle, sharingContext))
+         return WTF::move(eglContext);
+ #endif
+     return nullptr;
+diff -Naur webkitgtk-2.10.7/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp webkitgtk-2.10.7/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp
+--- webkitgtk-2.10.7/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp	2016-01-29 21:59:33.000000000 +0530
++++ webkitgtk-2.10.7/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp	2016-04-05 22:52:15.500286120 +0530
+@@ -44,8 +44,10 @@
+     , m_supportsOESvertexArrayObject(false)
+     , m_supportsIMGMultisampledRenderToTexture(false)
+     , m_supportsANGLEinstancedArrays(false)
++#ifndef __ANDROID__
+     , m_glFramebufferTexture2DMultisampleIMG(0)
+     , m_glRenderbufferStorageMultisampleIMG(0)
++#endif
+     , m_glBindVertexArrayOES(0)
+     , m_glDeleteVertexArraysOES(0)
+     , m_glGenVertexArraysOES(0)
+@@ -54,9 +56,11 @@
+     , m_glReadnPixelsEXT(0)
+     , m_glGetnUniformfvEXT(0)
+     , m_glGetnUniformivEXT(0)
++#ifndef __ANDROID__
+     , m_glVertexAttribDivisorANGLE(nullptr)
+     , m_glDrawArraysInstancedANGLE(nullptr)
+     , m_glDrawElementsInstancedANGLE(nullptr)
++#endif
+ {
+ }
+ 
+@@ -66,17 +70,21 @@
+ 
+ void Extensions3DOpenGLES::framebufferTexture2DMultisampleIMG(unsigned long target, unsigned long attachment, unsigned long textarget, unsigned int texture, int level, unsigned long samples)
+ {
++#ifndef __ANDROID__
+     if (m_glFramebufferTexture2DMultisampleIMG)
+         m_glFramebufferTexture2DMultisampleIMG(target, attachment, textarget, texture, level, samples);
+     else
++#endif
+         m_context->synthesizeGLError(GL_INVALID_OPERATION);
+ }
+ 
+ void Extensions3DOpenGLES::renderbufferStorageMultisampleIMG(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height)
+ {
++#ifndef __ANDROID__
+     if (m_glRenderbufferStorageMultisampleIMG)
+         m_glRenderbufferStorageMultisampleIMG(target, samples, internalformat, width, height);
+     else
++#endif
+         m_context->synthesizeGLError(GL_INVALID_OPERATION);
+ }
+ 
+@@ -87,9 +95,11 @@
+ 
+ void Extensions3DOpenGLES::renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height)
+ {
++#ifndef __ANDROID__
+     if (m_glRenderbufferStorageMultisampleIMG)
+         renderbufferStorageMultisampleIMG(target, samples, internalformat, width, height);
+     else
++#endif
+         notImplemented();
+ }
+ 
+@@ -224,7 +234,9 @@
+ {
+     if (m_glGetnUniformivEXT) {
+         m_context->makeContextCurrent();
++#ifndef __ANDROID__
+         m_glGetnUniformivEXT(program, location, bufSize, params);
++#endif
+         return;
+     }
+ 
+@@ -233,17 +245,22 @@
+ 
+ void Extensions3DOpenGLES::drawArraysInstanced(GC3Denum mode, GC3Dint first, GC3Dsizei count, GC3Dsizei primcount)
+ {
++#ifndef __ANDROID__
+     if (!m_glDrawArraysInstancedANGLE) {
+         m_context->synthesizeGLError(GL_INVALID_OPERATION);
+         return;
+     }
+-
++    
+     m_context->makeContextCurrent();
+     m_glDrawArraysInstancedANGLE(mode, first, count, primcount);
++#else
++    m_context->synthesizeGLError(GL_INVALID_OPERATION);
++#endif
+ }
+ 
+ void Extensions3DOpenGLES::drawElementsInstanced(GC3Denum mode, GC3Dsizei count, GC3Denum type, long long offset, GC3Dsizei primcount)
+ {
++#ifndef __ANDROID__
+     if (!m_glDrawElementsInstancedANGLE) {
+         m_context->synthesizeGLError(GL_INVALID_OPERATION);
+         return;
+@@ -251,10 +268,14 @@
+ 
+     m_context->makeContextCurrent();
+     m_glDrawElementsInstancedANGLE(mode, count, type, reinterpret_cast<GLvoid*>(static_cast<intptr_t>(offset)), primcount);
++#else
++    m_context->synthesizeGLError(GL_INVALID_OPERATION);
++#endif
+ }
+ 
+ void Extensions3DOpenGLES::vertexAttribDivisor(GC3Duint index, GC3Duint divisor)
+ {
++#ifndef __ANDROID__
+     if (!m_glVertexAttribDivisorANGLE) {
+         m_context->synthesizeGLError(GL_INVALID_OPERATION);
+         return;
+@@ -262,6 +283,9 @@
+ 
+     m_context->makeContextCurrent();
+     m_glVertexAttribDivisorANGLE(index, divisor);
++#else
++    m_context->synthesizeGLError(GL_INVALID_OPERATION);
++#endif
+ }
+ 
+ bool Extensions3DOpenGLES::supportsExtension(const String& name)
+@@ -274,19 +298,28 @@
+             m_glIsVertexArrayOES = reinterpret_cast<PFNGLISVERTEXARRAYOESPROC>(eglGetProcAddress("glIsVertexArrayOES"));
+             m_supportsOESvertexArrayObject = true;
+         } else if (!m_supportsIMGMultisampledRenderToTexture && name == "GL_IMG_multisampled_render_to_texture") {
++#ifndef __ANDROID__
+             m_glFramebufferTexture2DMultisampleIMG = reinterpret_cast<PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC>(eglGetProcAddress("glFramebufferTexture2DMultisampleIMG"));
+             m_glRenderbufferStorageMultisampleIMG = reinterpret_cast<PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC>(eglGetProcAddress("glRenderbufferStorageMultisampleIMG"));
+             m_supportsIMGMultisampledRenderToTexture = true;
++#else
++            m_supportsIMGMultisampledRenderToTexture = false;
++#endif
++
+         } else if (!m_glGetGraphicsResetStatusEXT && name == "GL_EXT_robustness") {
+             m_glGetGraphicsResetStatusEXT = reinterpret_cast<PFNGLGETGRAPHICSRESETSTATUSEXTPROC>(eglGetProcAddress("glGetGraphicsResetStatusEXT"));
+             m_glReadnPixelsEXT = reinterpret_cast<PFNGLREADNPIXELSEXTPROC>(eglGetProcAddress("glReadnPixelsEXT"));
+             m_glGetnUniformfvEXT = reinterpret_cast<PFNGLGETNUNIFORMFVEXTPROC>(eglGetProcAddress("glGetnUniformfvEXT"));
+             m_glGetnUniformivEXT = reinterpret_cast<PFNGLGETNUNIFORMIVEXTPROC>(eglGetProcAddress("glGetnUniformivEXT"));
+         } else if (!m_supportsANGLEinstancedArrays && name == "GL_ANGLE_instanced_arrays") {
++#ifndef __ANDROID__
+             m_glVertexAttribDivisorANGLE = reinterpret_cast<PFNGLVERTEXATTRIBDIVISORANGLEPROC>(eglGetProcAddress("glVertexAttribDivisorANGLE"));
+             m_glDrawArraysInstancedANGLE = reinterpret_cast<PFNGLDRAWARRAYSINSTANCEDANGLEPROC >(eglGetProcAddress("glDrawArraysInstancedANGLE"));
+             m_glDrawElementsInstancedANGLE = reinterpret_cast<PFNGLDRAWELEMENTSINSTANCEDANGLEPROC >(eglGetProcAddress("glDrawElementsInstancedANGLE"));
+             m_supportsANGLEinstancedArrays = true;
++#else
++            m_supportsANGLEinstancedArrays = false;
++#endif
+         } else if (name == "GL_EXT_draw_buffers") {
+             // FIXME: implement the support.
+             return false;
+diff -Naur webkitgtk-2.10.7/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h webkitgtk-2.10.7/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h
+--- webkitgtk-2.10.7/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h	2016-01-04 16:08:34.000000000 +0530
++++ webkitgtk-2.10.7/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h	2016-04-05 22:52:15.500286120 +0530
+@@ -106,8 +106,10 @@
+     bool m_supportsIMGMultisampledRenderToTexture;
+     bool m_supportsANGLEinstancedArrays;
+ 
++#ifndef __ANDROID__
+     PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC m_glFramebufferTexture2DMultisampleIMG;
+     PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC m_glRenderbufferStorageMultisampleIMG;
++#endif
+     PFNGLBINDVERTEXARRAYOESPROC m_glBindVertexArrayOES;
+     PFNGLDELETEVERTEXARRAYSOESPROC m_glDeleteVertexArraysOES;
+     PFNGLGENVERTEXARRAYSOESPROC m_glGenVertexArraysOES;
+@@ -116,9 +118,11 @@
+     PFNGLREADNPIXELSEXTPROC m_glReadnPixelsEXT;
+     PFNGLGETNUNIFORMFVEXTPROC m_glGetnUniformfvEXT;
+     PFNGLGETNUNIFORMIVEXTPROC m_glGetnUniformivEXT;
++#ifndef __ANDROID__
+     PFNGLVERTEXATTRIBDIVISORANGLEPROC m_glVertexAttribDivisorANGLE;
+     PFNGLDRAWARRAYSINSTANCEDANGLEPROC m_glDrawArraysInstancedANGLE;
+     PFNGLDRAWELEMENTSINSTANCEDANGLEPROC m_glDrawElementsInstancedANGLE;
++#endif
+ 
+     std::unique_ptr<GraphicsContext3D::ContextLostCallback> m_contextLostCallback;
+ };
+diff -Naur webkitgtk-2.10.7/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp webkitgtk-2.10.7/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp
+--- webkitgtk-2.10.7/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp	2016-01-29 21:59:33.000000000 +0530
++++ webkitgtk-2.10.7/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp	2016-04-05 22:52:15.500286120 +0530
+@@ -202,7 +202,9 @@
+ void MemoryPressureHandler::platformReleaseMemory(Critical)
+ {
+     ReliefLogger log("Run malloc_trim");
++#ifndef __ANDROID__
+     malloc_trim(0);
++#endif
+ }
+ 
+ void MemoryPressureHandler::ReliefLogger::platformLog()
 diff -Naur webkitgtk-2.10.7/Source/WebCore/PlatformGTK.cmake webkitgtk-2.10.7/Source/WebCore/PlatformGTK.cmake
 --- webkitgtk-2.10.7/Source/WebCore/PlatformGTK.cmake	2016-01-29 21:59:32.000000000 +0530
-+++ webkitgtk-2.10.7/Source/WebCore/PlatformGTK.cmake	2016-03-13 21:31:18.000000000 +0530
++++ webkitgtk-2.10.7/Source/WebCore/PlatformGTK.cmake	2016-04-05 22:52:15.496286112 +0530
 @@ -201,7 +201,7 @@
      platform/text/hyphen/HyphenationLibHyphen.cpp
  )

 
 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
<<<<<<< HEAD
+++ webkitgtk-2.10.7/Source/JavaScriptCore/CMakeLists.txt	2016-04-26 08:35:30.000000000 +0530
=======
+++ webkitgtk-2.10.7/Source/JavaScriptCore/CMakeLists.txt	2016-04-27 23:09:59.064421319 +0530
>>>>>>> 9d478c4aed9a8ddb5e24d985f1d48b5111f7c191
@@ -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 icuhemdata 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"
 
<<<<<<< HEAD
-#if OS(LINUX)
+#if OS(LINUX) && !defined(__ANDROID__)
 #include <sys/types.h>

+        COMMAND xz -f ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
+    )
+endif ()
diff -Naur webkitgtk-2.10.7/Source/WebCore/CMakeLists.txt webkitgtk-2.10.7/Source/WebCore/CMakeLists.txt
--- webkitgtk-2.10.7/Source/WebCore/CMakeLists.txt	2016-01-29 21:59:32.000000000 +0530
+++ webkitgtk-2.10.7/Source/WebCore/CMakeLists.txt	2016-04-27 23:11:06.136502299 +0530
@@ -3670,7 +3670,16 @@
     WEBKIT_SET_EXTRA_COMPILER_FLAGS(ANGLESupport IGNORECXX_WARNINGS)
 endif ()
