gcc fails to cross compile Qt

Bug #683832 reported by Svein Seldal
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gcc-4.4-armel-cross (Ubuntu)
Invalid
Undecided
Unassigned
gcc-4.5-armel-cross (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Building fails when cross compiling building embedded Qt (not for X11). After a little while the compilation stops with the message:

{standard input}: Assembler messages:
{standard input}:26712: Error: selected processor does not support Thumb mode `swp r3,r2,[r1]'

The error occurs on arm-linux-gnueabi-gcc version 4.5.1 and 4.5.1. The error does not, however, occur on the Code Sourcery G++ Lite compiler (version 2010q1-202 - gcc 4.4.1)

Host system is Maverick, amd64. The bug has been confimed on g++-4.4-arm-linux-gnueabi version 4.4.4-14ubuntu4 and on g++-4.5-arm-linux-gnueabi version 4.5.1-7ubuntu1cross1.38

Steps to reproduce the bug:

*) Please note the attached patch is for configuring Qt to use the Ubuntu armel-cross compiler instead of using the code sourcery compiler.

$ git clone git://gitorious.org/qt/qt.git -b 4.7-stable
    Topmost commit is currently: caca740ea1219227008c303b5f2fac24af5a62a0
$ cd qt
$ git apply ../ubuntu-gnueabi.diff
$ cd ..
$ mkdir qt-build
$ cd qt-build
$ ../qt/configure \
    -opensource \
    -confirm-license \
    -hostprefix `pwd`/qt-bin \
    -prefix /opt/qt \
    -fast \
    -embedded arm \
    -little-endian \
    -platform linux-g++ \
    -xplatform qws/linux-arm-gnueabi-g++ \
    -arch arm \
    -no-openssl \
    -no-cups \
    -no-largefile \
    -no-qt3support \
    -no-webkit \
    -no-libmng \
    -no-libjpeg \
    -no-libtiff \
    -no-gif \
    -no-script \
    -no-scripttools \
    -no-sql-sqlite \
    -no-accessibility \
    -no-multimedia \
    -no-nis \
    -qt-mouse-pc \
    -plugin-mouse-pc \
    -exceptions \
    -xmlpatterns \
    -nomake demos \
    -nomake examples \
    -nomake docs \
    -nomake translations \
    -D QT_NO_QWS_CURSOR \
    -D QT_QWS_CLIENTBLIT
$ make

...
arm-linux-gnueabi-g++ -c -include .pch/release-shared-emb-arm/QtCore -pipe -march=armv7-a -mtune=cortex-a8 -mfloat-abi=softfp -mfpu=neon -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_NO_QWS_CURSOR -DQT_QWS_CLIENTBLIT -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DELF_INTERPRETER=\"/lib64/ld-linux-x86-64.so.2\" -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -I/home/user/temp/gcc-bug/qt/mkspecs/qws/linux-arm-gnueabi-g++ -I/home/user/temp/gcc-bug/qt/src/corelib -I../../include -I../../include/QtCore -I.rcc/release-shared-emb-arm -Iglobal -I/home/user/temp/gcc-bug/qt/src/3rdparty/zlib -I/home/user/temp/gcc-bug/qt/src/3rdparty/harfbuzz/src -I/home/user/temp/gcc-bug/qt/src/3rdparty/md5 -I/home/user/temp/gcc-bug/qt/src/3rdparty/md4 -I.moc/release-shared-emb-arm -I. -o .obj/release-shared-emb-arm/qobject.o /home/user/temp/gcc-bug/qt/src/corelib/kernel/qobject.cpp
{standard input}: Assembler messages:
{standard input}:26712: Error: selected processor does not support Thumb mode `swp r3,r2,[r1]'
make[1]: *** [.obj/release-shared-emb-arm/qobject.o] Error 1
make[1]: Leaving directory `/home/user/temp/gcc-bug/qt-build/src/corelib'
make: *** [sub-corelib-make_default-ordered] Error 2

Tags: patch
Revision history for this message
Svein Seldal (sveinse) wrote :
tags: added: patch
Marcin Juszkiewicz (hrw)
Changed in gcc-4.4-armel-cross (Ubuntu):
status: New → Confirmed
Changed in gcc-4.5-armel-cross (Ubuntu):
status: New → Confirmed
Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

OK, discussed it with people.

Problem lies in Qt which does not have proper support for Thumb2 instruction set which is used by default. Please add "-marm" into CFLAGS/CXXFLAGS to force normal ARM instruction set - should work.

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

ping

Revision history for this message
Svein Seldal (sveinse) wrote :

This is a confirmed bug in Qt and not in gcc. Using -marm fixes the issue.

Changed in gcc-4.5-armel-cross (Ubuntu):
status: Confirmed → Invalid
Changed in gcc-4.4-armel-cross (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.