QT5 build errors with arm tool chain (Cross Compiling)



  • Hi,
    I was trying to configure qt5 with the following options
    "./configure -prefix $(qt_embedded_install_dir) -opensource -openssl -platform linux-g++ -xplatform linux-wr-arm-g++"
    linux-g++ -- is present in ../qtbase/mkspecs
    linux-wr-arm-g++ --- I have created

    I am seeing build errors at compilaton of src/tools code (i.e uic,moc)

    The build errors are as follows


    g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fno-exceptions -fPIE -DQT_NO_LIBUDEV -DQT_NO_XCB -DQDOC2_COMPAT -DQT_NO_DEBUG -DQT_BOOTSTRAP_LIB -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_SYSTEMLOCALE -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -DQT_NO_TRANSLATION -DQT_QMAKE_LOCATION="/home/psravan/sravan/codebase/qtalpha/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-
    ......
    arm-wrs-linux-gnueabi-armv6jel-glibc_small-ld -Wl,-O1 -o ../../../bin/qdoc .obj/release-shared/atom.o .obj/release-shared/codechunk.o .obj/release-shared/codemarker.o .obj/release-shared/codeparser.o .obj/release-shared/config.o .obj/release-shared/cppcodemarker.o .obj/release-shared/cppcodeparser.o .obj/release-shared/ditaxmlgenerator.o .obj/release-shared/doc.o .obj/release-shared/editdistance.o .obj/release-shared/generator.o .obj/release-shared/helpprojectwriter.o .obj/release-shared/htmlgenerator.o .obj/release-shared/location.o .obj/release-shared/main.o .obj/release-shared/node.o .obj/release-shared/openedlist.o .obj/release-shared/plaincodemarker.o .obj/release-shared/puredocparser.o .obj/release-shared/qdocdatabase.o .obj/release-shared/qdoctagfiles.o .obj/release-shared/qdocindexfiles.o .obj/release-shared/quoter.o .obj/release-shared/separator.o .obj/release-shared/text.o .obj/release-shared/tokenizer.o .obj/release-shared/tree.o .obj/release-shared/yyindent.o .obj/release-shared/qcryptographichash.o .obj/release-shared/qqmljsast.o .obj/release-shared/qqmljsastvisitor.o .obj/release-shared/qqmljsengine_p.o .obj/release-shared/qqmljsgrammar.o .obj/release-shared/qqmljslexer.o .obj/release-shared/qqmljsparser.o .obj/release-shared/jscodemarker.o .obj/release-shared/qmlcodemarker.o .obj/release-shared/qmlcodeparser.o .obj/release-shared/qmlmarkupvisitor.o .obj/release-shared/qmlvisitor.o -L/home/psravan/sravan/codebase/qtalpha/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-wrlinux_3_0/build/qt-everywhere-opensource-src-5.0.0/qtbase/lib -lQt5Bootstrap -lz -lpthread
    arm-wrs-linux-gnueabi-ld: unrecognized option '-Wl,-O1'
    arm-wrs-linux-gnueabi-ld: use the --help option for usage information
    make[7]: *** [../../../bin/qdoc] Error 1
    make[7]: Leaving directory /home/psravan/sravan/codebase/qtalpha/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-wrlinux_3_0/build/qt-everywhere-opensource-src-5.0.0/qtbase/src/tools/qdoc' make[6]: *** [sub-qdoc-make_first] Error 2 make[6]: Leaving directory/home/psravan/sravan/codebase/qtalpha/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-wrlinux_3_0/build/qt-everywhere-opensource-src-5.0.0/qtbase/src/tools'
    make[5]: *** [sub-tools-make_first] Error 2
    make[5]: Leaving directory /home/psravan/sravan/codebase/qtalpha/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-wrlinux_3_0/build/qt-everywhere-opensource-src-5.0.0/qtbase/src' make[4]: *** [sub-src-make_first] Error 2 make[4]: Leaving directory/home/psravan/sravan/codebase/qtalpha/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-wrlinux_3_0/build/qt-everywhere-opensource-src-5.0.0/qtbase'
    make[3]: *** [module-qtbase-make_first] Error 2
    make[3]: Leaving directory /home/psravan/sravan/codebase/qtalpha/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-wrlinux_3_0/build/qt-everywhere-opensource-src-5.0.0' make[2]: *** [qt-embedded.compile] Error 2 make[2]: Leaving directory/home/psravan/sravan/codebase/qtalpha/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-wrlinux_3_0/build'
    make[1]: *** [qt-embedded.buildlogger] Error 2
    make[1]: Leaving directory `/home/psravan/sravan/codebase/qtalpha/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-wrlinux_3_0/build'
    make: *** [all] Error 2


    I dont know why arm-wrs-linux-gnueabi-armv6jel-glibc_small-ld is used in place of g++ while linking the tools.
    I compared the build with qt 4.7.4 ,g++ is involved in linking the tools code in case of qt 4.7.4
    Can any one help me in this regard



  • The cross toolchain used is as follows
    The code for linux-wr-arm-g++ is as follows


    +MAKEFILE_GENERATOR = UNIX
    +TARGET_PLATFORM = unix
    +TEMPLATE = app
    +CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index
    +QT += core gui
    +QMAKE_INCREMENTAL_STYLE = sublib
    +include(../common/linux.conf)
    +include(../common/gcc-base-unix.conf)
    +include(../common/g++-unix.conf)
    +QMAKE_CC = /home/psravan/sravan/codebase/QT5/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-wrlinux_3_0/host-cross/arm-wrs-linux-gnueabi/x86-linux2/arm-wrs-linux-gnueabi-armv6jel-glibc_small-gcc
    +QMAKE_CXX = /home/psravan/sravan/codebase/QT5/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-wrlinux_3_0/host-cross/arm-wrs-linux-gnueabi/x86-linux2/arm-wrs-linux-gnueabi-armv6jel-glibc_small-g++
    +QMAKE_LINK = /home/psravan/sravan/codebase/QT5/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-wrlinux_3_0/host-cross/arm-wrs-linux-gnueabi/x86-linux2/arm-wrs-linux-gnueabi-armv6jel-glibc_small-g++
    +QMAKE_LINK_SHLIB = /home/psravan/sravan/codebase/QT5/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-wrlinux_3_0/host-cross/arm-wrs-linux-gnueabi/x86-linux2/arm-wrs-linux-gnueabi-armv6jel-glibc_small-g++
    +QMAKE_LFLAGS_RPATH =
    +# modifications to linux.conf
    +QMAKE_AR = /home/psravan/sravan/codebase/QT5/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-wrlinux_3_0/host-cross/arm-wrs-linux-gnueabi/x86-linux2/arm-wrs-linux-gnueabi-armv6jel-glibc_small-ar cqs
    +QMAKE_OBJCOPY = /home/psravan/sravan/codebase/QT5/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-wrlinux_3_0/host-cross/arm-wrs-linux-gnueabi/x86-linux2/arm-wrs-linux-gnueabi-armv6jel-glibc_small-objcopy
    +QMAKE_STRIP = /home/psravan/sravan/codebase/QT5/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-wrlinux_3_0/host-cross/arm-wrs-linux-gnueabi/x86-linux2/arm-wrs-linux-gnueabi-armv6jel-glibc_small-strip
    +load(qt_config)




  • @arm-wrs-linux-gnueabi-ld: unrecognized option ‘-Wl,-O1’@

    It should be -Wl -O1 or something like that. Comma is not right separator for command line arguments.



  • I agree here for tools compilation ,the arm-wrs-linux-gnueabi-ld is wrong one,it should be host compiler option i.e g++(in this case).I dont know why cross compilation option is coming
    if it was g++,then -Wl,O1 would be correct.



  • Are you sure about that:

    @$ g++ -Wl,-O1 test.cpp
    ld: unknown option: -O1
    collect2: ld returned 1 exit status

    $ g++ -Wl,O1 test.cpp
    ld: file not found: O1
    collect2: ld returned 1 exit status@



  • I compared the build with qt 4.7.4 which was successful.

    the log is

    g++ -m32 -Wl,-O1 -o ../../../bin/uic .obj/release-shared-emb-arm/customwidgetsinfo.o .obj/release-shared-emb-arm/databaseinfo.o .obj/release-shared-emb-arm/driver.o .obj/release-shared-emb-arm/treewalker.o .obj/release-shared-emb-arm/ui4.o .obj/release-shared-emb-arm/validator.o .obj/release-shared-emb-arm/cppextractimages.o .obj/release-shared-emb-arm/cppwritedeclaration.o .obj/release-shared-emb-arm/cppwriteicondata.o .obj/release-shared-emb-arm/cppwriteicondeclaration.o .obj/release-shared-emb-arm/cppwriteiconinitialization.o .obj/release-shared-emb-arm/cppwriteincludes.o .obj/release-shared-emb-arm/cppwriteinitialization.o .obj/release-shared-emb-arm/main.o .obj/release-shared-emb-arm/uic.o -L/home/psravan/sravan/codebase/latestbuild/IPPhone/Generated/Build/platform/groupp-glibc_small-armv6jel-wrlinux_3_0/build/qt-everywhere-opensource-src-4.7.4/src/tools/bootstrap -lbootstrap -lz -lz
    make[4]: Leaving directory



  • OK. I have looked into "man g++":

    @-Wl,option
    Pass option as an option to the linker. If option contains commas, it is split into multiple options at the commas.@

    Now in successful case you are using g++ that passes -O1 to linker and in unsuccessful case you are using linker (*-ld) directly thus it should simply state -O1 (without -Wl). I would look into spec file, configuration or Makefile for this setting.



  • My query is cross compiler linker is used while building the tools.Is configuration (qtbase/configure) wrong



  • Maybe nobody tried to build for your configuration and that's it. I don't know ;-)



  • I'm having the same problem. I also tried -device instead of/in addition to -xplatform.

    And what's even more screwy, when it's building the tools, it's mixing the CFLAGS and LFLAGS between toolchains. For example, my cross compiler doesn't support -m64, so I took that out of my mkspec. But when it's building the tools, it's using my cross-compiler with -m64 (and the build is therefore failing). It's picking up the -m64 from -platform (which is linux-g++-64).

    Since I'm cross-compiling for x86_64 on an x86_64 machine, I can work around this by using the same value (my custom mkspec) for -platform and -xplatform.



  • Take a look at this bug report. Maybe you have some variables set that is confusing the build.

    https://bugreports.qt-project.org/browse/QTBUG-31030


Log in to reply
 

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