[Solved] Compiler error: qatomic_mips.h:129: error: output number 1 not directly addressable
In file included from /home/jbarnes/rdk/pace/rng150/branches/fr_xre2723_091013/sdk/fsroot/ramdisk/usr/local/Qt/include/QtCore/qatomic_arch.h:70,
from ../../include/fontatlas.h:9, from ../../include/textlayout.h:4, from ../../src/receiver/textlayout.cpp:1:
/home/jbarnes/rdk/pace/rng150/branches/fr_xre2723_091013/sdk/fsroot/ramdisk/usr/local/Qt/include/QtCore/qatomic_mips.h: In function '(static initializers for /home/jbarnes/rdk/pace/rng150/branches/fr_xre2723_091013/sdk/fsroot/ramdisk/usr/local/Qt/include/QtCore/qatomic_mips.h)':
/home/jbarnes/rdk/pace/rng150/branches/fr_xre2723_091013/sdk/fsroot/ramdisk/usr/local/Qt/include/QtCore/qatomic_mips.h:129: error: output number 1 not directly addressable
/home/jbarnes/rdk/pace/rng150/branches/fr_xre2723_091013/sdk/fsroot/ramdisk/usr/local/Qt/include/QtCore/qatomic_mips.h:129: warning: use of memory input without lvalue in asm operand 4 is deprecated
As the compiler error shows, it comes from including QSharedPointer.
Cross compiling using mipsel-linux-gcc-4.4.5 compiler.
Googling the issue says to add -fno-strict-volatile-bitfields to CXXFLAGS. Doesn't seem to fix it in the .pro file.
The source indicated in QBasicAtomicInt::ref() is
@ asm volatile(".set push\n"
"ll %[originalValue], %[_q_value]\n"
"addiu %[newValue], %[originalValue], %[one]\n"
"sc %[newValue], %[_q_value]\n"
"beqz %[newValue], 0b\n"
: [originalValue] "=&r" (originalValue),
[_q_value] "+m" (_q_value),
[newValue] "=&r" (newValue)
: [one] "i" (1)
: "cc", "memory");
I don't know enough assembler to know what the problem is. Has anybody seen this before? Fixes? Workarounds? Help?
Ok, I found what caused it in my case.
There was a #pragma pack(push (1)) preprocessor directive in my code without a corresponding pack(). I hope this helps someone else who runs into the same problem.
Great you found out and thanks for sharing the solution !
Could you also update your thread title prepending [solved] so other forum users may know that a solution has been found :)