Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Cross Compiling Qtbase 5.3.1 for i.MX6
Forum Update on Monday, May 27th 2025

Cross Compiling Qtbase 5.3.1 for i.MX6

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 3 Posters 2.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Falcon83
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • P Offline
      P Offline
      ProstoTyoma
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        liyaoshi
        wrote on last edited by
        #3

        You can try this

        https://github.com/liyaoshi/buildroot

        intergrated with Wayland 1.5 and Qt 5.3.1

        1 Reply Last reply
        0
        • F Offline
          F Offline
          Falcon83
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • F Offline
            F Offline
            Falcon83
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved