Problem with inline SWP asm using arm-none-linux-qnueabi-g++
-
Hi, This my first post as I'm new to QT so please bear with me. I'm developing some QT apps for an iMx53 eval board and needed to compile qt for arm. So I cloned qt-everywhere-opensource-src-4.8.5, configured it for arm-none-linux then built. However, the following statement in qatomic_armv5.h failed:
@ in inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
{
int originalValue;
#ifndef QT_NO_ARM_EABI
asm volatile("swp %0, %2, [%3]"
: "=&r"(originalValue), "=m" (_q_value)
: "r"(newValue),"r"(&_q_value)
: "cc", "memory");@with the error message that %1 was not directly accessible. After some research I editted the code as shown below:
@inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
{
int originalValue;
#ifndef QT_NO_ARM_EABI
asm volatile("swp %[dest], %[source], [%[mem]]"
: [dest]"=&r"(originalValue) //, "=m" (_q_value)
: [source]"r"(newValue), [mem]"r"(&_q_value)
: "cc", "memory");@This seemed to work and the whole thing built ok. The question is, is this a valid amendment and will the code still work as intended? I'm not sure this is a bug so didn't know if I should use the bugtracker. Thank you for your patience and help in advance.
DaveP.
-
Hi and welcome to devnet,
I think this question is a bit too low-level for this forum (It's more user oriented) You should rather post it on the mailing list, there you'll find Qt's developer/maintainer.
-
Hi, Thanks for that, and I apologise. I followed the link you suggested.
-
You're welcome !
There's no need to apologize :)