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-compile Qt build problem (host : linux x86_64, target : arm)
Qt 6.11 is out! See what's new in the release blog

Cross-compile Qt build problem (host : linux x86_64, target : arm)

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 5 Posters 12.7k Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi,

    I would like to build Qt libs for an arm architecture but I encounter strange problem.

    I first adapted my mkspecs/qws/linux-arm-g++/qmake.conf file so that my arm-gcc cross-compiler is correclty used.

    Here is a copy of my qmake.conf file :
    @
    include(../../common/g++.conf)
    include(../../common/linux.conf)
    include(../../common/qws.conf)

    modifications to g++.conf

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

    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++

    modifications to linux.conf

    #QMAKE_AR = arm-linux-ar cqs
    #QMAKE_OBJCOPY = arm-linux-objcopy
    #QMAKE_STRIP = arm-linux-strip

    QMAKE_AR = arm-none-linux-gnueabi-ar cqs
    QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
    QMAKE_RANLIB = arm-none-linux-gnueabi-ranlib
    @

    Here are the binaries of my cross-compiler :
    @
    arm-none-linux-gnueabi-addr2line arm-none-linux-gnueabi-g++ arm-none-linux-gnueabi-gprof arm-none-linux-gnueabi-readelf
    arm-none-linux-gnueabi-ar arm-none-linux-gnueabi-gcc arm-none-linux-gnueabi-ld arm-none-linux-gnueabi-size
    arm-none-linux-gnueabi-as arm-none-linux-gnueabi-gcc-4.3.2 arm-none-linux-gnueabi-nm arm-none-linux-gnueabi-sprite
    arm-none-linux-gnueabi-c++ arm-none-linux-gnueabi-gcov arm-none-linux-gnueabi-objcopy arm-none-linux-gnueabi-strings
    arm-none-linux-gnueabi-c++filt arm-none-linux-gnueabi-gdb arm-none-linux-gnueabi-objdump arm-none-linux-gnueabi-strip
    arm-none-linux-gnueabi-cpp arm-none-linux-gnueabi-gdbtui arm-none-linux-gnueabi-ranlib
    @

    Then I typed this command to configure :
    @
    ./configure --prefix=/home/azmodai/devel/friendlyarm/mini2440-bootstrap/arm-2008q3 -opensource -embedded arm -xplatform qws/linux-arm-g++ -no-cups -no-webkit -qt-libtiff -qt-libmng -qt-mouse-pc -no-mouse-linuxtp
    @

    Everything is Ok up to now, but when I launch the building by typing make, I get this error about 10 or 15 mins later :

    @
    g++ -fno-exceptions -Wl,-O1 -Wl,-rpath,/home/azmodai/devel/friendlyarm/mini2440-bootstrap/arm-2008q3/lib -Wl,-rpath,/home/azmodai/devel/friendlyarm/mini2440-bootstrap/arm-2008q3/lib -o ../../../bin/moc release-shared/moc.o release-shared/preprocessor.o release-shared/generator.o release-shared/parser.o release-shared/token.o release-shared/main.o -L/home/azmodai/devel/digicode/friendlyarm/qt/arm-qte-4.6.3/qt-everywhere-opensource-src-4.6.3/src/tools/bootstrap -lbootstrap
    /usr/bin/ld: /home/azmodai/devel/digicode/friendlyarm/qt/arm-qte-4.6.3/qt-everywhere-opensource-src-4.6.3/src/tools/bootstrap/libbootstrap.a(compress.o): Relocations in generic ELF (EM: 40)
    /home/azmodai/devel/digicode/friendlyarm/qt/arm-qte-4.6.3/qt-everywhere-opensource-src-4.6.3/src/tools/bootstrap/libbootstrap.a: could not read symbols: File in wrong format
    collect2: ld a retourné 1 code d'état d'exécution
    make[1]: *** [../../../bin/moc] Erreur 1
    make[1] : on quitte le répertoire « /home/azmodai/devel/digicode/friendlyarm/qt/arm-qte-4.6.3/qt-everywhere-opensource-src-4.6.3/src/tools/moc »
    make: *** [sub-moc-make_default-ordered] Erreur 2
    @

    It looks to be a link problem. about a wrong format of binary ...

    Last thing : I decide to remove the "-m64" flags of the linux-x68_64-g++ specs, and I did not replace -m64 by the non-updated equivalent, because I did not the equivalent.

    Have you ever experienced such a problem ? And have you any idea ?

    Thanks a lot !

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      When I build for ARM, I add these flags:

      QMAKE_CFLAGS_RELEASE = -O2 -march=armv5te (your arch may be different)
      QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv5te

      I also add the include paths to QMAKE_CFLAGS_RELEASE, QMAKE_CXXFLAGS_RELEASE. Check your QMAKE_LIBDIR, QMAKE_INCDIR, and QMAKE_LFLAGS variables too.

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        It seems the libbootstrap.a has incorrect format. Can you verify what options it was built with?

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Hi,

          Actually, What is the target, that you are working/going to get the Qt for.

          Are you working on any significant OMAP or what else.
          Because there are particular spec files for particular OMAPs.

          Try to check them...

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Hi,
            this page definitely solve your problem, there is also a instruction to config the file qmake.conf
            http://mini2440vietnam.blogspot.com/2011/04/upgrade-qt462-in-mini2440.html

            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