[SOLVED] Unable to cross-compile Qt4.7.1 for the TI AM335x



  • I've been using the Linaro toolchain from TI to attempt to cross compile Qt4.7.1 for the ARM based TI AM335x processor. The toolchain was installed with the ti-sdk-am335x-evm-06.00.00.00.

    I've updated my Path to pick up these tools:
    mike@mike-VirtualBox:~/qt4.7.1_source/qt-everywhere-opensource-src-4.7.1$ echo $PATH
    /home/mike/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin:/usr/local/Trolltech/Qt-4.8.5/bin:/home/mike/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/mike/bin

    I then added a new directory under:
    [qt-install-dir]/mkspecs/qws/
    for my new chip. The directory was a copy of /mkspecs/qws/linux-arm-g++ and I called it linux-am335x-g++

    In that directory I updated the qmake.conf to point to the tools in my Linux dev-kit:

    qmake configuration for building with arm-linux-g++

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

    modifications to g++.conf

    QMAKE_CC = arm-linux-gnueabihf-gcc
    QMAKE_CXX = arm-linux-gnueabihf-g++
    QMAKE_LINK = arm-linux-gnueabihf-g++
    QMAKE_LINK_SHLIB = arm-linux-gnueabihf-g++

    modifications to linux.conf

    QMAKE_AR = arm-linux-gnueabihf-ar
    QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy
    QMAKE_STRIP = arm-linux-gnueabihf-strip

    load(qt_config)

    I then ran the configure command:

    ./configure -prefix /home/mike/qt4.7.1_source/my_qt -embedded arm -platform qws/linux-x86_64-g++ -xplatform qws/linux-am335x-g++ -depths 16,24,32 -no-mmx -no-3dnow -no-sse -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -qt-mouse-pc -qt-mouse-linuxtp -qt-mouse-linuxinput -plugin-mouse-linuxtp -plugin-mouse-pc -fast -opensource

    it ran and completed apparently successfully, and then I tried the make command.

    This ran for a few minutes then it spat out a build failure regarding an inability to compile thumb code:

    cc1plus: warning: ./.pch/release-shared-emb-arm/QtCore.gch/c: not for GNU C++ [enabled by default]
    {standard input}: Assembler messages:
    {standard input}:1294: Error: selected processor does not support Thumb mode swp r6,r4,[r3]' make[1]: *** [.obj/release-shared-emb-arm/qobject.o] Error 1 make[1]: Leaving directory/home/mike/qt4.7.1_source/qt-everywhere-opensource-src-4.7.1/src/corelib'
    make: *** [sub-corelib-make_default-ordered] Error 2

    Why am I seeing this build failure? The AM335x is an ARM based processor so it should support thumb code. Am I configuring the environment or setting it up incorrectly?



  • Solved my own problem. First, I updated my .configure command to:

    ./configure -prefix /home/mike/qt4.7.1_source/my_qt -embedded arm -platform qws/linux-x86_64-g++ -xplatform qws/linux-am335x-g++ -no-mmx -no-3dnow -no-sse -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -opensource -qt-mouse-tslib

    The only difference from the question's configure command is the removal of the -fast option.

    Then in my the linux-am335x-g++/qmake.conf file, I added a few command line options:

    QMAKE_CFLAGS= -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8
    QMAKE_CXXFLAGS= -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8

    With these two change I can now see everything build and install Qt4.7.1 successfully


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.