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. OpenWRT QT5.7.0 static compilation
Forum Updated to NodeBB v4.3 + New Features

OpenWRT QT5.7.0 static compilation

Scheduled Pinned Locked Moved Mobile and Embedded
7 Posts 3 Posters 4.3k Views 2 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.
  • G Offline
    G Offline
    gustav nilsson
    wrote on last edited by gustav nilsson
    #1

    So, ive been at this thing now for about 3 weeks, so i thought id turn in for some help.

    Basically i want to run my QT5.7 project on a linksys WRT1200 router. The project works fine on the desktop, builds fine with qmake and make and runs perfectly.
    The router has about 28MB of storage, runs armv7l and has a limited busybox (1.23.2) for issuing linux commands. Compilation on this box would take centuries to say the least, not to mention other implications; no make, hdd space, ram shortage etc. The package manager (opkg) also has no reference to qt5, so there will be no cheating there.
    For reference my desktop runs xubuntu.

    So i need qt5 to run on this device. The steps ive taken are listed below;
    1.1: First i compiled a compiler (guide found here: http://telecnatron.com/articles/Cross-Compiling-For-OpenWRT-On-Linux/)
    1.2: I also configured and installed qt5.7.0 from git using "./configure -release -opensource -confirm-license -static -no-largefile -no-qml-debug -qt-xcb -developer-build -opengl es2 -skip wayland -skip declarative -nomake examples -nomake tests" and "make"
    1.3: Now i tried to simply set up qmake with the QMAKE_CXX, QMAKE_CC, CONFIG += static flags to use this compiler (arm-openwrt-linux-g++/gcc). This resulted in two errors with ld; Relocations in generic ELF (EM: 40) and error adding symbols: File in wrong format. I think this has todo with qt not installed proper static, but i dont know, maybe i am missing something.

    2: I tried to decipher the instructions at http://doc.qt.io/QtForDeviceCreation/qtee-static-linking.html but failed at creating my own mkspec located at "qtbase/mkspecs/arm-openwrt-linux-g++". I based my mkspec on the linux-arm-gnueabi-g++ mkspec thinking that they were alike, but i still get error messages (Error: No device matching 'arm-openwrt-linux-g++') when configuring qt with;
    "/home/gustav/opt/qt5/qtbase/configure -top-level -release -opensource -confirm-license -static -no-largefile -no-qml-debug -qt-xcb -developer-build -opengl es2 -skip wayland -skip declarative -nomake examples -nomake tests -hostprefix /home/gustav/opt/qt5-openwrt -device arm-openwrt-linux-g++ -device-option CROSS_COMPILE=/home/gustav/crosscompile/openwrt/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/bin/arm-openwrt-linux- -sysroot /home/gustav/crosscompile/openwrt/staging_dir/qt5-openwrt"

    3: Im thinking of running armv7l openwrt in qemu (or any generic virtualization software, tips appreciated), this is a prospect i haven't pursued yet due to doubts. This way i could give the machine a whole heap of resources, but i would still have to compile things like make, gnuutils etc.

    So, what have i done wrong, alternatively what approach should i take? I have scoured the interwebs for information but there might be posts ive missed.
    Any help is greatly appreciated!

    edit: im trying to fix this for the openwrt 15.05.1 "chaos calmer"

    raven-worxR 1 Reply Last reply
    0
    • G gustav nilsson

      So, ive been at this thing now for about 3 weeks, so i thought id turn in for some help.

      Basically i want to run my QT5.7 project on a linksys WRT1200 router. The project works fine on the desktop, builds fine with qmake and make and runs perfectly.
      The router has about 28MB of storage, runs armv7l and has a limited busybox (1.23.2) for issuing linux commands. Compilation on this box would take centuries to say the least, not to mention other implications; no make, hdd space, ram shortage etc. The package manager (opkg) also has no reference to qt5, so there will be no cheating there.
      For reference my desktop runs xubuntu.

      So i need qt5 to run on this device. The steps ive taken are listed below;
      1.1: First i compiled a compiler (guide found here: http://telecnatron.com/articles/Cross-Compiling-For-OpenWRT-On-Linux/)
      1.2: I also configured and installed qt5.7.0 from git using "./configure -release -opensource -confirm-license -static -no-largefile -no-qml-debug -qt-xcb -developer-build -opengl es2 -skip wayland -skip declarative -nomake examples -nomake tests" and "make"
      1.3: Now i tried to simply set up qmake with the QMAKE_CXX, QMAKE_CC, CONFIG += static flags to use this compiler (arm-openwrt-linux-g++/gcc). This resulted in two errors with ld; Relocations in generic ELF (EM: 40) and error adding symbols: File in wrong format. I think this has todo with qt not installed proper static, but i dont know, maybe i am missing something.

      2: I tried to decipher the instructions at http://doc.qt.io/QtForDeviceCreation/qtee-static-linking.html but failed at creating my own mkspec located at "qtbase/mkspecs/arm-openwrt-linux-g++". I based my mkspec on the linux-arm-gnueabi-g++ mkspec thinking that they were alike, but i still get error messages (Error: No device matching 'arm-openwrt-linux-g++') when configuring qt with;
      "/home/gustav/opt/qt5/qtbase/configure -top-level -release -opensource -confirm-license -static -no-largefile -no-qml-debug -qt-xcb -developer-build -opengl es2 -skip wayland -skip declarative -nomake examples -nomake tests -hostprefix /home/gustav/opt/qt5-openwrt -device arm-openwrt-linux-g++ -device-option CROSS_COMPILE=/home/gustav/crosscompile/openwrt/staging_dir/toolchain-arm_mpcore+vfp_gcc-4.8-linaro_uClibc-0.9.33.2_eabi/bin/arm-openwrt-linux- -sysroot /home/gustav/crosscompile/openwrt/staging_dir/qt5-openwrt"

      3: Im thinking of running armv7l openwrt in qemu (or any generic virtualization software, tips appreciated), this is a prospect i haven't pursued yet due to doubts. This way i could give the machine a whole heap of resources, but i would still have to compile things like make, gnuutils etc.

      So, what have i done wrong, alternatively what approach should i take? I have scoured the interwebs for information but there might be posts ive missed.
      Any help is greatly appreciated!

      edit: im trying to fix this for the openwrt 15.05.1 "chaos calmer"

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @gustav-nilsson
      not help, just out of curiosity.
      Why, why, why do you want to run Qt on such a limited device???
      I mean what are the benefits? I guess you just want to use the utility classes out of convenience?
      So about 95% of the Qt framework are not needed, but still the whole binary is loaded into the RAM (since you built static) which anyway is limited by 28MB !!!!

      You are way better off holding your code base minimal and use the tools available and if they are not use some minimalistic 3rd-party libraries for the tasks.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      G 1 Reply Last reply
      0
      • raven-worxR raven-worx

        @gustav-nilsson
        not help, just out of curiosity.
        Why, why, why do you want to run Qt on such a limited device???
        I mean what are the benefits? I guess you just want to use the utility classes out of convenience?
        So about 95% of the Qt framework are not needed, but still the whole binary is loaded into the RAM (since you built static) which anyway is limited by 28MB !!!!

        You are way better off holding your code base minimal and use the tools available and if they are not use some minimalistic 3rd-party libraries for the tasks.

        G Offline
        G Offline
        gustav nilsson
        wrote on last edited by
        #3

        Thank you for your reply @raven-worx =)

        QT is kinda awesome, especially for networking, which the purpose of the project. To my knowledge alot of QTs functionality can be skipped when configuring. Also only using QTBase, core and networking when compiling would bring down the projects size.

        Maybe you are correct in using other tooling, i will take it into consideration.

        raven-worxR 1 Reply Last reply
        0
        • G gustav nilsson

          Thank you for your reply @raven-worx =)

          QT is kinda awesome, especially for networking, which the purpose of the project. To my knowledge alot of QTs functionality can be skipped when configuring. Also only using QTBase, core and networking when compiling would bring down the projects size.

          Maybe you are correct in using other tooling, i will take it into consideration.

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @gustav-nilsson
          i think Qt is a dead-end here. Using the standard/native socket API consumes nothing on the device and isn that hard to use, you just might need some reading on it.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          G 1 Reply Last reply
          0
          • raven-worxR raven-worx

            @gustav-nilsson
            i think Qt is a dead-end here. Using the standard/native socket API consumes nothing on the device and isn that hard to use, you just might need some reading on it.

            G Offline
            G Offline
            gustav nilsson
            wrote on last edited by
            #5

            Thank you for perspective @raven-worx, however i would really like to know if this is possible. Porting the codebase to use anything else than QT will be a whole heap of work, talking months, and im not ready to give up on cross compiling QT for this device yet.

            raven-worxR 1 Reply Last reply
            0
            • G gustav nilsson

              Thank you for perspective @raven-worx, however i would really like to know if this is possible. Porting the codebase to use anything else than QT will be a whole heap of work, talking months, and im not ready to give up on cross compiling QT for this device yet.

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              @gustav-nilsson said in OpenWRT QT5.7.0 static compilation:

              and im not ready to give up on cross compiling QT for this device yet.

              then i wish you good luck ;)

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Hi,

                Then the only way I see possible is to make a custom Qt build where you remove everything that you don't use. Take a look at the new configuration system from Qt 5.8 to make your own lightweight version of Qt.

                Hope it helps

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                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