Re: [webkit-dev] Alignment issues in MIPS

2010-04-06 Thread Luciano Montanaro
On Tue, Apr 6, 2010 at 9:21 AM, Alex Vazquez alexvazquezfe...@gmail.com wrote:
 Hello list,

 I'm cross-compiling WebKit (revision 40084) for a MIPS board using DirectFB
 backend.

 While executing in the target, libwebkit is causing SIGBUS errors due to
 misaligned double data. The errors raise when loading a misaligned double in
 the FPU using the ldc1 instruction (it is stated in the MIPS documentation
 that data loaded in the FPU must be 8-byte aligned to avoid an address
 error). I know that the kernel can be configured to manage misaligned
 accesses but i prefer not to mess with that by the moment.

I have SIGBUS problems cross-compiling on SH4 with Qt, similar to yours.
Debug builds work fine, but release builds crash as soon as the first
webkit-related
call is made. I've not had time to investigate further, though I'll
soon have to.

I'm looking into your suggestion, and I see the class is not
optimallly laid out (there is a function pointer which is presumably 4
bytes, followed by a double which is 8), though the compiler should
correctly align it putting a 4 byte hole between the pointer and the
double. At new time, the class should be allocated from a correctly
aligned memory block, so any misalignments are probably due to copying
the class around?


 After some debugging, i found out that the offending variable is the
 attribute m_nextFireTime in the TimerBase class, which sometimes is not
 aligned to an 8-byte boundary. As a test, i tried compiling with
 -msoft-float (emulate FPU by software) and checked that the dissassembled
 code does not use the FPU but, in that case, webkit does not render
 anything. I also tried using the __attribute__ aligned directive without
 any success.

Well, that confirms it, the member variable was already aligned anyway.


 Finally, i made an ugly patch to avoid the load from an unaligned address
 and it worked fine but i don't know if there are other places in the code
 whith the same problem.

 I have 2 questions:

 1) Has anyone found similar alignment problems compiling webkit for MIPS? If
 so, how were they fixed?

 2) Is there any standard way of forcing alignment of doubles to 8 bytes
 boundary through compiler options (i'm using gcc 4.3.2)?



-- 
Luciano Montanaro

Anyone who is capable of getting themselves made President should on
no account be allowed to do the job. -- Douglas Adams
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] Making use of a KJS_EXPORT macro

2007-06-01 Thread Luciano Montanaro
Hi all.
I'm trying to reconcile the KJS and JSC repositories, and one of the 
differences I have found is the usage of the KJS_EXPORT macro, which
expands to 
__attribute ((visibility(default))) on GCC and 
__declspec(dllexport) or __declspec(dllimport) on Microsoft compilers.

I think it's a useful feature, and it offers a way to document which classes 
are for internal use and which do not without cluttering the source code 
too much. 

Would a patch for annotating classes and methods with this macro be welcome?

Luciano
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev