On Sunday 14 November 2010 23:26:46 Michael Hope wrote:
Hi there. I've been looking into updating the QT4 atomic operations as an alternative to working around it in GCC. There's ARM specific code in: http://qt.gitorious.org/qt/qt/blobs/4.7/src/corelib/arch/qatomic_armv6.h that should be updated to include IT instructions so that it can compile in Thumb-2 mode.
There are bigger problems here though:
- There's code in corelib/arch/armv6/qatomic*.c that may also being used
- qatomic_armv6.h includes code for RVCT which should be updated for
Thumb-2 by someone
- The code may not work on multi-processor systems like Panda due to
the lack of DMB instructions
The better fix would be to replace everything with __sync_* primitives similar to qatomic_avr32.h and require GCC 4.4 or higher. The same probably applies to glib.
Thoughts? Any volunteers? It's mildly outside the Toolchain WG's mandate.
See also: https://bugs.launchpad.net/ubuntu/+source/qt4-x11/+bug/673085
Since this is mainly an armv7 specific problem, can't we mandate gcc-4.4+ when building for armv7 and use generic __builtin_cmpxchg() atomics whenever building with gcc-4.4?
I would assume that most people building a v7 version of qt (especially linaro) have this compiler anyway.
Arnd