Qt World Summit: Submit your Presentation

Error when building Qt for ARM

  • Hi,

    I'm trying to build qt-everywhere-commercial-src-4.7.3 (with a commercial evaluation license) on Ubuntu 11.04 for an embedded linux system (ARM11). I've been roughly following this guide: http://developer.qt.nokia.com/wiki/Building_Qt_for_Embedded_Linux

    I've successfully done the host build but am now having problems with the target build.

    What I have done so far:

    • Cross-compiled libts with arm-linux-gnueabi-gcc and modified qmake.conf for the linux-arm-gnueabi-g++ mkspec to add the paths to the include and lib directories for this libts build.

    • The following configure command:
      @./configure -xplatform qws/linux-arm-gnueabi-g++ -embedded arm
      -qt-gfx-linuxfb -qt-gfx-vnc
      -no-largefile -exceptions -no-accessibility -no-qt3support -no-sse2 -qt-zlib -no-gif -no-libtiff
      -qt-libpng -no-libmng -qt-libjpeg -no-openssl -no-nis -no-cups -depths 16
      -qt-kbd-linuxinput -nomake demos -nomake examples
      -qt-mouse-linuxinput -qt-mouse-tslib
      -confirm-license -silent@

    • I execute make and it fails part way through:

    arm-linux-gnueabi-g++ -c -include .pch/release-shared-emb-arm/QtCore -pipe -O2 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_EDITION=QT_EDITION_DESKTOP -DQT_EVAL -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="/lib/ld-linux.so.2" -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -I../../mkspecs/qws/linux-arm-gnueabi-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared-emb-arm -Iglobal -I../3rdparty/zlib -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -Iglobal -I.moc/release-shared-emb-arm -I/home/anh/tslib-arm/include -o .obj/release-shared-emb-arm/qsocketnotifier.o kernel/qsocketnotifier.cpp
    {standard input}: Assembler messages:
    {standard input}:1710: Error: selected processor does not support Thumb mode `swp r6,r4,[r3]'

    a little further down

    make[1]: *** [.obj/release-shared-emb-arm/qobject.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make[1]: Leaving directory `/home/anh/qt-everywhere-commercial-src-4.7.3/src/corelib'
    make: *** [sub-corelib-make_default-ordered] Error 2

    How can I resolve this? I feel as though this bug is relevant to my problem: http://bugreports.qt.nokia.com/browse/QTBUG-15911?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel#issue-tabs, but I don't understand enough to be sure or know if I can use a workaround. Any help would be appreciated!


  • Welcome to this forum

    You probably need to check the source code file "kernel/qsocketnotifier.cpp" for some preprocessor if around the point error. This might give some hints, what is going wrong.

  • Thanks koahnig.

    I had a look at this file and I didn't see anything that seemed useful to me.

    I think my problem relates to the identified issue here:
    and also

    I tried the -marm workaround suggested in that last link by adding the following lines to make qmake.conf
    @QMAKE_CFLAGS = -marm

    which now makes it fail with the following errors:
    @image/qimage_neon.cpp: In function ‘void qt_convert_rgb888_to_rgb32_neon(quint32*, const uchar*, int)’:
    image/qimage_neon.cpp:47:18: error: ‘uint8x8_t’ does not name a type
    image/qimage_neon.cpp:63:23: error: ‘fullVector’ was not declared in this scope@
    @In file included from painting/qdrawhelper_neon.cpp:31:0:
    /usr/lib/gcc/arm-linux-gnueabi/4.5.2/include/arm_neon.h:32:2: error: #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h@

    I'll try to look a bit further into resolving this new error but it seems to be something specific to compiling for ARM.

  • Hi

    at the moment there is not a lot I can do to assist you in this problem. This is outside of my experience.

    However, I have noted something in the information you have provided.

    Initially you started out with Qt4.7.3 in the first post.
    [quote author="anht" date="1311320790"]
    @In file included from painting/qdrawhelper_neon.cpp:31:0:
    /usr/lib/gcc/arm-linux-gnueabi/4.5.2/include/arm_neon.h:32:2: error: #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h@
    the error message refers to version 4.5.2.

    Could it be that you are dealing with a mix of different Qt version?
    You might want to check this and ensure that you are using only one specific version.

  • Thanks, but the 4.5.2 refers to the version of the arm-linux-gnueabi compiler I am using, not Qt.

  • Hi everybody.

    I faced errors when trying to build qt-everywhere-opensource-src-4.7.2 on Ubuntu 11.04. please help me solve it.

    ./configure --prefix=/opt/qte --prefix=/opt/qte -embedded arm -xplatform qws/linux-arm-gnueabi-g++ -release -opensource -shared -fast -no-largefile -qt-sql-sqlite -no-mmx -no-sse -no-sse2 -no-3dnow -qt-zlib -no-libtiff -qt-libpng -no-libmng -qt-libjpeg -no-openssl -silent -no-nis -confirm-license -depths 16,18,24 -optimized-qmake -no-xcursor -qt-freetype -little-endian -host-little-endian -no-qt3support -no-qvfb -no-phonon -no-cups -no-glib -no-xfixes -no-xrandr -no-xrender -no-xkb -no-sm -no-xinerama -no-xshape -no-xfixes -no-separate-debug-info -nomake examples -nomake tools -nomake docs -no-gfx-qvfb -no-mouse-qvfb -qt-kbd-qvfb -qt-kbd-tty -qt-mouse-tslib

    when I use "make" command, the fault appears:
    arm-none-linux-gnueabi-g++: cannot specify -o with -c or -S with multiple files
    make[1]: *** [.pch/release-shared-emb-arm/corelib.gch/c++] Error 1
    make[1]: Leaving directory `/home/jack/qt-everywhere-opensource-src-4.7.2/src/corelib'
    make: *** [sub-corelib-make_default-ordered] Error 2

    - I've configured the qws/linux-arm-gnueabi-g++/qmake.conf :




    QMAKE_CC = /usr/local/arm/4.3.2/bin/arm-none-linux-gnueabi-gcc

    QMAKE_CXX = /usr/local/arm/4.3.2/bin/arm-none-linux-gnueabi-g++

    QMAKE_LINK = /usr/local/arm/4.3.2/bin/arm-none-linux-gnueabi-g++

    QMAKE_LINK_SHLIB = /usr/local/arm/4.3.2/bin/arm-none-linux-gnueabi-g++

    QMAKE_AR = /usr/local/arm/4.3.2/bin/arm-none-linux-gnueabi-ar cqs

    QMAKE_OBJCOPY = /usr/local/arm/4.3.2/bin/arm-none-linux-gnueabi-objcopy

    QMAKE_STRIP = /usr/local/arm/4.3.2/bin/arm-none-linux-gnueabi-strip

    QMAKE_INCDIR += /opt/tslib/include

    QMAKE_LIBDIR += /opt/tslib/lib


    I need your help. Thanks a lot.

Log in to reply