[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: kde4libs vs qt4



Carlos O'Donell wrote:
On Mon, Jun 9, 2008 at 6:26 PM, Helge Deller <deller@gmx.de> wrote:
attached is a _completely_ untested patch which should
show what's needed. In principle we could
a) copy over the HPUX-parisc architecture files to arch/hppa and apply the
patch on top of the copy (as you suggest above), or
b) alternatively, we could try to merge HPUX's parisc and Linux's HPPA
architecture into the existing Trolltech codebase of parisc.

I'll continue to look into it and will try to clean it up, depending on what
you think which solution (a or b) is best.

Unfortunately I think you're approach won't work due to the alignment
requirements placed on ldcw? It has to be 16-byte aligned according to
the architecture docs.

I was looking into the kde4libs issue, and I think the solution is to
copy atomic.h from glibc and use that interface.
http://sourceware.org/cgi-bin/cvsweb.cgi/ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h?rev=1.4&content-type=text/x-cvsweb-markup&cvsroot=glibc

This obviously only works when we have the linux kernel helper routines.

(better yet would be to put atomic.h into gcc, implement the atomic
builtins with that, and then propgate the use of the atomic builtins
to glibc and other software that needs it).

For Qt it might work as I mentioned without copying atomic.h from glibc.
Qt uses ldcw() not directly. Instead it uses q_atomic_lock(), which then utilizes q_ldcw().

Here is the code (from src/corelib/arch/parisc/qatomic_parisc.cpp):
    void q_atomic_lock(int *lock)
    {
        // ldcw requires a 16-byte aligned address
        volatile int *x = align16(lock);
        while (q_ldcw(x) == 0)
            ;
    }
So, the 16byte alignment is taken care of by align16().
My attempt was based on having a minimal patch against Qt.

Helge


Reply to: