Qt embedded compile error. fixing “Error: no such instruction” Error

谁说我不能喝 提交于 2019-11-30 15:00:48

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!

artless noise

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

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!