Cross Compiling Qtbase 5.3.1 for i.MX6



  • Hello,

    I try to cross compile the qtbase 5.3.1 module for the i.MX6 family.

    As described in the following tutorial at freescale web page, I have configured the qtbase module:

    "https://community.freescale.com/docs/DOC-94066":https://community.freescale.com/docs/DOC-94066

    However, the linking process fails with the error:

    @arm-linux-gnueabi-ld: unrecognized option '-Wl,--gc-sections'@

    Normally the -Wl option is used for the gcc call to assign options to the linker directly.

    But why is the -Wl option not removed and only --gc-sections is asigned to ld?

    In the raspberry pi forum, the user bazza has had the same problem and fixed it by removing some environment. variables. Unfortunately he does not decribe the procedure in detail.

    Has somebody an idea, why the -Wl option is not removed by gcc?

    Thanks,

    Falcon83



  • Linker is defined in your qtbase/mkspecs/$(QMAKESPEC)/qmake.conf as QMAKE_LINK. Command line parameter for --gc-section is defined in qtbase/mkspecs/common/linux.conf with 'Wl'.
    If you use ld as linker, you should remove '-Wl' part from this parameter.



  • You can try this

    https://github.com/liyaoshi/buildroot

    intergrated with Wayland 1.5 and Qt 5.3.1



  • Hello,

    many thanks for your response.

    in the file "qtbase/mkspecs/common/linux.conf" I have removed -Wl from the QMAKE_LFLAGS_GCSECTIONS variable:

    @QMAKE_LFLAGS_GCSECTIONS = --gc-sections@

    However, the configure script fails:
    @g++: error: unrecognized command line option ‘--gc-sections’@

    When I delete the QMAKE_LFLAGS_GCSECTIONS completly, the linker fails with the following error:

    @arm-linux-gnueabi-ld: unrecognized option '-Wl,-O1'@

    I use ccache 3.1.8. Is it possible that the ccache is responsible for the problem?

    Falcon83



  • Hi,

    I have found the reason for the failing linker call.

    In my environment CC, LD, etc. were declared as read only variables.
    Therefore the cross compile environment in the linux_device_pre.conf cannot be setuped correctly.

    linux_device_pre.conf : QMAKE_LINK = $${QMAKE_CXX}

    This means Qt calls normally the linker with the g++ frontend and not directly ld.

    Now a lot of headers files were not found and I have to add the Qt include directories to the configure call.

    For example why I have to add "-I include/QtCore" to the configure call?
    It is part of the Qt framework.

    Falcon83


Log in to reply
 

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