Hi ports --

I have successfully built QT4 on Loongson, patches below. However, it segfaults whenever I try to launch any QT4 program. Nothing useful comes from the backtraces. I tried to build QT4 with -O0 but the build crashes when trying to link libwebcore.a (Could not read symbols: Memory exhausted). Does anyone know how I'd go about building everything with -O0, which seems to work OK, but build QTWebKit at the default of -O2 so I don't get the memory exhaustion errors?
The patches may be somewhat hacky, but they work.

Thanks.

~Brian

Index: patch-src_3rdparty_webkit_Source_JavaScriptCore_jit_ExecutableAllocator_h
===================================================================
RCS file: 
patch-src_3rdparty_webkit_Source_JavaScriptCore_jit_ExecutableAllocator_h
diff -N 
patch-src_3rdparty_webkit_Source_JavaScriptCore_jit_ExecutableAllocator_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patch-src_3rdparty_webkit_Source_JavaScriptCore_jit_ExecutableAllocator_h   
22 Aug 2012 14:20:28 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+--- src/3rdparty/webkit/Source/JavaScriptCore/jit/ExecutableAllocator.h.orig   
Mon Aug 20 11:05:51 2012
++++ src/3rdparty/webkit/Source/JavaScriptCore/jit/ExecutableAllocator.h        
Mon Aug 20 11:07:01 2012
+@@ -43,8 +43,8 @@
+ #include <e32std.h>
+ #endif
+ +-#if CPU(MIPS) && OS(LINUX)
+-#include <sys/cachectl.h>
++#if CPU(MIPS)
++#include <mips64/sysarch.h>
+ #endif
+ + #if CPU(SH4) && OS(LINUX)
Index: patch-src_3rdparty_webkit_Source_JavaScriptCore_runtime_JSGlobalData_cpp
===================================================================
RCS file: 
patch-src_3rdparty_webkit_Source_JavaScriptCore_runtime_JSGlobalData_cpp
diff -N patch-src_3rdparty_webkit_Source_JavaScriptCore_runtime_JSGlobalData_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patch-src_3rdparty_webkit_Source_JavaScriptCore_runtime_JSGlobalData_cpp    
22 Aug 2012 14:20:28 -0000
@@ -0,0 +1,35 @@
+$OpenBSD$
+--- src/3rdparty/webkit/Source/JavaScriptCore/runtime/JSGlobalData.cpp.orig    
Tue Aug 21 00:28:05 2012
++++ src/3rdparty/webkit/Source/JavaScriptCore/runtime/JSGlobalData.cpp Tue Aug 
21 00:31:37 2012
+@@ -123,22 +123,31 @@ void JSGlobalData::storeVPtrs()
+     // COMPILE_ASSERTS below check that this is true.
+     char storage[64];
+ ++ // We get errors stating that sizeof_JS*_must_be_less_than_storage is negative on MIPS.
++#if !CPU(MIPS)
+     COMPILE_ASSERT(sizeof(JSArray) <= sizeof(storage), 
sizeof_JSArray_must_be_less_than_storage);
++#endif
+     JSCell* jsArray = new (storage) JSArray(JSArray::VPtrStealingHack);
+     CLOBBER_MEMORY();
+     JSGlobalData::jsArrayVPtr = jsArray->vptr();
+ ++#if !CPU(MIPS)
+     COMPILE_ASSERT(sizeof(JSByteArray) <= sizeof(storage), 
sizeof_JSByteArray_must_be_less_than_storage);
++#endif
+     JSCell* jsByteArray = new (storage) 
JSByteArray(JSByteArray::VPtrStealingHack);
+     CLOBBER_MEMORY();
+     JSGlobalData::jsByteArrayVPtr = jsByteArray->vptr();
+ ++#if !CPU(MIPS)
+     COMPILE_ASSERT(sizeof(JSString) <= sizeof(storage), 
sizeof_JSString_must_be_less_than_storage);
++#endif
+     JSCell* jsString = new (storage) JSString(JSString::VPtrStealingHack);
+     CLOBBER_MEMORY();
+     JSGlobalData::jsStringVPtr = jsString->vptr();
+ ++#if !CPU(MIPS)
+     COMPILE_ASSERT(sizeof(JSFunction) <= sizeof(storage), 
sizeof_JSFunction_must_be_less_than_storage);
++#endif
+     JSCell* jsFunction = new (storage) JSFunction(JSCell::VPtrStealingHack);
+     CLOBBER_MEMORY();
+     JSGlobalData::jsFunctionVPtr = jsFunction->vptr();
Index: 
patch-src_3rdparty_webkit_Source_JavaScriptCore_runtime_JSValueInlineMethods_h
===================================================================
RCS file: 
patch-src_3rdparty_webkit_Source_JavaScriptCore_runtime_JSValueInlineMethods_h
diff -N 
patch-src_3rdparty_webkit_Source_JavaScriptCore_runtime_JSValueInlineMethods_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ 
patch-src_3rdparty_webkit_Source_JavaScriptCore_runtime_JSValueInlineMethods_h  
    22 Aug 2012 14:20:28 -0000
@@ -0,0 +1,29 @@
+$OpenBSD$
+--- 
src/3rdparty/webkit/Source/JavaScriptCore/runtime/JSValueInlineMethods.h.orig   
   Sun Aug 19 13:47:47 2012
++++ src/3rdparty/webkit/Source/JavaScriptCore/runtime/JSValueInlineMethods.h   
Sun Aug 19 13:53:43 2012
+@@ -227,7 +227,12 @@ namespace JSC {
+             u.asBits.tag = CellTag;
+         else
+             u.asBits.tag = EmptyValueTag;
++#if defined(__mips__)
++      u.asBits.payload = reinterpret_cast<int64_t>(ptr);
++#else
+         u.asBits.payload = reinterpret_cast<int32_t>(ptr);
++#endif
++
+ #if ENABLE(JSC_ZOMBIES)
+         ASSERT(!isZombie());
+ #endif
+@@ -239,7 +244,12 @@ namespace JSC {
+             u.asBits.tag = CellTag;
+         else
+             u.asBits.tag = EmptyValueTag;
++#if defined(__mips__)
++      u.asBits.payload = reinterpret_cast<int64_t>(const_cast<JSCell*>(ptr));
++#else
+         u.asBits.payload = 
reinterpret_cast<int32_t>(const_cast<JSCell*>(ptr));
++#endif
++
+ #if ENABLE(JSC_ZOMBIES)
+         ASSERT(!isZombie());
+ #endif
Index: patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Platform_h
===================================================================
RCS file: patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Platform_h
diff -N patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Platform_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patch-src_3rdparty_webkit_Source_JavaScriptCore_wtf_Platform_h      22 Aug 
2012 14:20:28 -0000
@@ -0,0 +1,27 @@
+$OpenBSD$
+--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h.orig      Sun Aug 
19 14:20:26 2012
++++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h   Mon Aug 20 
11:18:08 2012
+@@ -146,9 +146,9 @@
+ + /* CPU(MIPS) - MIPS 32-bit */
+ /* Note: Only O32 ABI is tested, so we enable it for O32 ABI for now.  */
+-#if (defined(mips) || defined(__mips__) || defined(MIPS) || defined(_MIPS_)) \
+-    && defined(_ABIO32)
++#if (defined(mips) || defined(__mips__) || defined(MIPS) || defined(_MIPS_))
+ #define WTF_CPU_MIPS 1
++#define       USE_SYSTEM_MALLOC 1
+ #if defined(__MIPSEB__)
+ #define WTF_CPU_BIG_ENDIAN 1
+ #endif
+@@ -1024,9 +1024,9 @@
+ #define ENABLE_JIT 0
+ #endif
+ +-/* The JIT is enabled by default on all x86, x64-64, ARM & MIPS platforms. */
++/* The JIT is enabled by default on all x86, x64-64, & ARM platforms. */
+ #if !defined(ENABLE_JIT) \
+-    && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(MIPS)) \
++    && (CPU(X86) || CPU(X86_64) || CPU(ARM)) \
+     && (OS(DARWIN) || !COMPILER(GCC) || GCC_VERSION_AT_LEAST(4, 1, 0)) \
+     && !OS(WINCE) \
+     && !OS(QNX)

Reply via email to