Compilation Error: "inconsistent operand constraints in an `asm'"
Hi,
I downloaded qt-x11-opensource-src-4.3.0 from the Trolltech website, but I'm not able to compile the code. 'make' fails, throwing the following errors:
Quote:
../../include/QtCore/../../src/corelib/arch/qatomic_x86_64.h: In member function `virtual QRect QStyleSheetStyle::subElementRect(QStyle::SubElemen t, const QStyleOption*, const QWidget*) const':
../../include/QtCore/../../src/corelib/arch/qatomic_x86_64.h:105: error: inconsistent operand constraints in an `asm'
../../include/QtCore/../../src/corelib/arch/qatomic_x86_64.h:105: error: inconsistent operand constraints in an `asm'
make[1]: *** [.obj/release-shared/qstylesheetstyle.o] Error 1
make[1]: Leaving directory `/home/jayanth/programs/qt-x11-opensource-src-4.3.0/src/gui'
make: *** [sub-gui-make_default-ordered] Error 2
The code that is causing the problem is given below.
Code:
asm volatile("xchgq %0,%1"
: "=r" (newval), "+m" (*reinterpret_cast<volatile long *>(ptr))
: "0" (newval)
: "memory");
I'm running CentOS 5 on a Pentium D machine.
Please help.
Thanks!
Jayanth
Re: Compilation Error: "inconsistent operand constraints in an `asm'"
I had the same issue with Red Hat. The response from Trolltech support was...
This is a known issue when building Qt 4.3 with gcc 3.4. To work around this bug, recompile qstylesheetstyle.cpp with removing -O2, or add the -fno-gcse compiler option. For more information, please see the description of task 161994, available online at
http://trolltech.com/developer/task-...ntry&id=161994
I did "make confclean" and then "./configure" and then edited the
makefile to remove "-O2" from CFLAGS and CXXFLAGS. The Qt now successfully
builds.
Re: Compilation Error: "inconsistent operand constraints in an `asm'"
Thanks a lot, jcraig! I changed src/gui/Makefile the way you have described and it worked! :)
Re: Compilation Error: "inconsistent operand constraints in an `asm'"
thanks a lot, I'v got the same problem and I'v solve it following the indication above.
:D