Results 1 to 4 of 4

Thread: Compilation Error: "inconsistent operand constraints in an `asm'"

  1. #1
    Join Date
    Jul 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default 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:

    ../../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.

    Qt Code:
    1. asm volatile("xchgq %0,%1"
    2. : "=r" (newval), "+m" (*reinterpret_cast<volatile long *>(ptr))
    3. : "0" (newval)
    4. : "memory");
    To copy to clipboard, switch view to plain text mode 

    I'm running CentOS 5 on a Pentium D machine.

    Please help.

    Thanks!

    Jayanth

  2. #2
    Join Date
    Jul 2007
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Smile 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.

  3. #3
    Join Date
    Jul 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default 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!

  4. #4
    Join Date
    Nov 2007
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.