Compiling Qt 5.3 source code for arm linux embedded



  • I know this has been discussed earlier and i have read most of the post on this topic. Maybe i still missed something. I'm trying to compile Qt source code for arm-linux so that i could cross compile software from my windows 7 machine for an arm-linux system. I've installed msvc 2013 on my windows 7 host and downloaded the target toolchain - CodeSourcery g++ lite. But I'm still struggling to compile the Qt source code. Maybe someone could point out my mistake?

    After getting the Qt source code, i'm able to run configure.exe and get the following output.
    @
    c:\Dev\qt-everywhere-opensource-src-5.3.0\qtbase>configure.exe -debug -embedded
    -arch arm -neon -platform win32-msvc2013 -xplatform linux-arm-gnueabi-g++
    Which edition of Qt do you want to use ?
    Type 'c' if you want to use the Commercial Edition.
    Type 'o' if you want to use the Open Source Edition.
    o

    This is the Qt for Windows Open Source Edition.

    You are licensed to use this software under the terms of
    the GNU Lesser General Public License (LGPL) version 2.1
    or the GNU General Public License (GPL) version 3.

    Type '3' to view the GNU General Public License version 3 (GPLv3).
    Type 'L' to view the Lesser GNU General Public License version 2.1 (LGPLv2.1).
    Type 'y' to accept this license offer.
    Type 'n' to decline this license offer.

    Do you accept the terms of the license?
    y
    Creating qmake...

    NOTE: The -arch option is obsolete.

    Qt now detects the target and host architectures based on compiler
    output. Qt will be built using arm for the target architecture
    and i386 for the host architecture (note that these two
    will be the same unless you are cross-compiling).

    Generating Makefiles...

    Qt is now configured for building. Just run nmake.
    To reconfigure, run nmake confclean and configure.
    @
    Next, i edit the existing qmake.conf in the \mkspecs\linux-arm-gnueabi-g++\ folder to be the following:

    @

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

    include(../common/unix.conf)
    include(../common/gcc-base-unix.conf)
    include(../common/g++-unix.conf)

    MAKEFILE_GENERATOR = MINGW
    CONFIG += no_import_libs no_generated_target_info

    modifications to g++.conf

    QMAKE_CC = arm-none-linux-gnueabi-gcc
    QMAKE_CXX = arm-none-linux-gnueabi-g++
    QMAKE_LINK = arm-none-linux-gnueabi-g++
    QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++
    QMAKE_LIB = arm-none-linux-gnueabi-ar
    QMAKE_AR = arm-none-linux-gnueabi-ar cqs
    QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
    QMAKE_STRIP = arm-none-linux-gnueabi-strip
    QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o $obj $src
    QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o $"@" $<
    QMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
    QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $"@" $<
    QMAKE_INCDIR =
    QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS]
    QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS]
    QMAKE_MOC = $$[QT_INSTALL_BINS]\moc.exe
    QMAKE_UIC = $$[QT_INSTALL_BINS]\uic.exe
    QMAKE_IDC = $$[QT_INSTALL_BINS]\idc.exe
    QMAKE_COPY = copy /y
    QMAKE_COPY_DIR = xcopy /s /q /y /i
    QMAKE_MOVE = move
    QMAKE_DEL_FILE = del
    QMAKE_MKDIR = mkdir
    QMAKE_DEL_DIR = rmdir
    QMAKE_CHK_DIR_EXISTS = if not exist
    QMAKE_IDL = midl
    QMAKE_ZIP = zip -r -9
    CODESOURCERY_ARM_CFLAGS = -march=armv7-a -mtune=cortex-a8 -mthumb -mfpu=neon -mfloat-abi=softfp -Wa,-mimplicit-it=thumb
    TARGET_SYSROOT = /CodeSourcery-sysroot
    TARGET_QTDIR = /QtEmbedded-5.3.1-arm
    #modifications to gcc-base.conf
    QMAKE_CFLAGS += $$CODESOURCERY_ARM_CFLAGS
    QMAKE_CXXFLAGS += $$CODESOURCERY_ARM_CFLAGS
    QMAKE_LIBS += -lrt -lpthread -ldl
    QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$$[QT_INSTALL_LIBS]
    !isEmpty(TARGET_QTDIR) {
    QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${TARGET_QTDIR}/lib
    }
    !isEmpty(TARGET_SYSROOT) {
    QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${TARGET_SYSROOT}/lib:$${TARGET_SYSROOT}/usr/lib
    QMAKE_LFLAGS += -Wl,--dynamic-linker=$${TARGET_SYSROOT}/lib/ld-linux.so.3
    }
    load(qt_config)
    @

    However, when i run either nmake or jom (yes, i did set the PATH to include jom.exe), i get an error - "test" is not recognized as an internal or external command....
    @
    c:\Dev\qt-everywhere-opensource-src-5.3.0\qtbase>jom

    jom 1.0.14 - empower your cores

    'test' is not recognized as an internal or external command,
    operable program or batch file.
    A subdirectory or file -p already exists.
    Error occurred while processing: -p.
    A subdirectory or file src already exists.
    Error occurred while processing: src.
    A subdirectory or file cd already exists.
    Error occurred while processing: cd.
    A subdirectory or file src\ already exists.
    Error occurred while processing: src.
    jom: C:\Dev\qt-everywhere-opensource-src-5.3.0\qtbase\Makefile [sub-src-make_fir
    st] Error 1
    @

    Any thoughts or suggestions?



  • Hi,

    Are you working with a specific ARM device, or trying to build Qt in a generic fashion?

    I've been working with embedded community boards for a while now and each board, each SoC has some kind of singularity, which usually results at least in specific mkspecs files for that device.

    Some examples include:

    • Raspberry Pi
    • Cubieboard
    • Beagleboard

    For example, for Cubieboard (A20 SoC), which is an ARM Cortex A8 dual core with a Mali 400MP2 GPU, I've successfully cross-compiled Qt5 using specific cubieboard mkspec files and the following configure line (generating cross-compiled QT5 libraries to work on framebuffer):

    @
    ./configure
    -opengl es2
    -device linux-cubieboard2-g++
    -device-option CROSS_COMPILE=/opt/sdcard.cubieboard.workbench/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin/arm-linux-gnueabihf-
    -sysroot /opt/qt5.cubieboard2A20.workbench/cubie2-rootfs
    -opensource
    -confirm-license
    -optimized-qmake
    -release
    -make libs
    -prefix /usr/local/qt5cb2
    -no-pch
    -nomake examples
    -nomake tests
    -no-xcb
    -eglfs
    -v
    @



  • Hi,

    Im trying to get this to work on the Nvidia Jetson TK1, which has an ARM Cortex A15 (http://en.wikipedia.org/wiki/Tegra).

    Also, you are on a linux host and compiling with linaro cross-compiler, right?
    I'm on win 7, trying to get this to work with codesourcery.



  • Yes, I'm using linaro gcc on Linux, although for my embedded boards, codesourcery was also recommended - but I ended up reverting to linaro as codesourcery somehow was giving me issues - but nothing specific like you are having on your Windows environment...



  • Hello,

    qt_for_embedded, or anyone that knows ...

    did you manage to solve the problem when trying to compile qt for arm in windows? I am having the same problem and not sure how to proceed at this moment. What is this "test" command?

    This is what I get:
    @PS C:\Qt\qt-everywhere-opensource-src-5.3.1> jom

    jom 1.0.14 - empower your cores

    'test' is not recognized as an internal or external command,
    operable program or batch file.
    A subdirectory or file qtbase already exists.
    Error occurred while processing: qtbase.
    A subdirectory or file qtbase\ already exists.
    Error occurred while processing: qtbase.
    jom: C:\Qt\qt-everywhere-opensource-src-5.3.1\Makefile [module-qtbase-make_first] Error 1@

    I am using the "linaro toolchain for windows":http://releases.linaro.org/13.06/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2013.06-20130620_win32.exe (I'm using Win7) and I've configured Qt to compile with the following options.

    @.\configure -prefix C:\Qt\qt-everywhere-opensource-src-5.3.1\qtbase -release -opensource -confirm-license -embedded -neon -platform win32-g++ -xplatform linux-arm-gnueabihf-g++ -skip qtwebkit -skip qtwebkit-examples -skip qtserialport -skip qttools -skip qtx11extras -skip qtandroidextras -nomake tools -nomake examples -nomake tests -no-opengl -no-compile-examples -no-widgets -no-gui -no-opengl -no-angle@

    The configuration step works well. Any help is appreciated. Thanks!


Log in to reply
 

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