Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt embedded compile error. fixing "Error: no such instruction" Error

I am trying to compile qt 4.7.4 using the angstrom tool chain installed at /home/user/Software for a beagle board.

The error I am receiving is:

/corelib/arch/qatomic_arm.h:131: Error: no such instruction: `swpb %al,%dl,[%esi]'

My qmake.conf file is as follows:

#
# qmake configuration for building with arm-none-linux-gnueabi-g++
#

include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)

# modifications to g++.conf
QMAKE_CC                = arm-angstrom-linux-gnueabi-gcc
QMAKE_CXX              = arm-angstrom-linux-gnueabi-g++
QMAKE_LINK              = arm-angstrom-linux-gnueabi-g++
QMAKE_LINK_SHLIB        = arm-angstrom-linux-gnueabi-g++

# modifications to linux.conf
QMAKE_AR                = arm-angstrom-linux-gnueabi-ar cqs
QMAKE_OBJCOPY          = arm-angstrom-linux-gnueabi-objcopy
QMAKE_STRIP            = arm-angstrom-linux-gnueabi-strip

QMAKE_LIBDIR_QT        = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/${libdir}
QMAKE_MOC              = /usr/local/angstrom/arm/bin/moc4
QMAKE_UIC              = /usr/local/angstrom/arm/bin/uic4
QMAKE_UIC3              = /usr/local/angstrom/arm/bin/uic34
QMAKE_RCC              = /usr/local/angstrom/arm/bin/rcc4
QMAKE_QDBUSCPP2XML      = /usr/local/angstrom/arm/bin/qdbuscpp2xml4
QMAKE_QDBUSXML2CPP      = /usr/local/angstrom/arm/bin/qdbusxml2cpp4

QMAKE_INCDIR          = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/include
QMAKE_LIBDIR          = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/lib
QMAKE_INCDIR_X11      = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include
QMAKE_LIBDIR_X11      = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib
QMAKE_INCDIR_QT      = $$[QT_INSTALL_HEADERS]
QMAKE_LIBDIR_QT      = $$[QT_INSTALL_LIBS]
QMAKE_INCDIR_OPENGL  = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include
QMAKE_LIBDIR_OPENGL  = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib
QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_INCDIR_OPENGL
QMAKE_LIBDIR_OPENGL_ES1 = $$QMAKE_LIBDIR_OPENGL
QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL
QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL
QMAKE_INCDIR_EGL      =
QMAKE_LIBDIR_EGL      =
QMAKE_INCDIR_OPENVG  =
QMAKE_LIBDIR_OPENVG  =


load(qt_config)

my configure command is below

./configure -embedded arm -prefix /home/thwijeth/Software/qt-4.7.4-embedded -xplatform qws/linux-arm-gnueabi-g++ -fast -little-endian -opensource

Can someone figure out why this happens?

like image 879
Tharanga Avatar asked Nov 14 '11 10:11

Tharanga


3 Answers

Some Googling suggests the following:

BeagleBoard uses TI's OMAP 3530 processor, which uses ARMv7 instruction set (according to Wikipedia).

The ARM website suggests that the swpb instruction has been deprecated (and disabled by default) since ARMv6:

ARMv6 and later deprecate using SWP and SWPB. The Multiprocessor Extensions to ARMv7 introduce the SW bit in the CP15 System Control Register. On processors that implement these extensions, after power-up or a reset, software must set this bit to 1 to enable use of the SWP and SWPB instructions.

A bug report goes into more detail:

The "generic arm" atomics in src/arch/corelib/qatomic_arm.h use the swp and swpb instructions. This is incompatible with Thumb-2 and will not be multicore-safe, especially for armv7.

I'm afraid this isn't my core area of expertise and I don't have such a board in front of me at the moment.

My advice, however is to try enabling the System Control Register SW bit and see if that helps you (seeing as you're not using multiple cores, perhaps the problems referred to in the bug report above will not affect you).

Alternatively, this patch looks like it could provide another route for you by emulating the problem instructions using alternative means.

Good luck!

like image 92
sam-w Avatar answered Nov 15 '22 06:11

sam-w


/corelib/arch/qatomic_arm.h:131: Error: no such instruction: `swpb %al,%dl,[%esi]'

%esi is an x86 register, and al and dl are also x86 looking lower half of the 16bit ax and dx register? I looks likes Qt is configured for an ARM processor and you have x86 gcc compiling it.

... probably removing -fast got configure to pick the right compiler.

like image 33
artless noise Avatar answered Nov 15 '22 07:11

artless noise


actully removing the -fast did the trick. So the command finally used was

./configure -embedded armv7 -prefix /home/thwijeth/Software/qt-4.7.4-embedded -xplatform qws/linux-arm-gnueabi-g++ -little-endian -opensource
like image 41
Tharanga Avatar answered Nov 15 '22 08:11

Tharanga