Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to get cross compile toolchain from target system
Forum Updated to NodeBB v4.3 + New Features

How to get cross compile toolchain from target system

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
14 Posts 2 Posters 7.8k 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.
  • L Offline
    L Offline
    lx_frz
    wrote on last edited by
    #5

    So the link I clicled on talked about using a "configure" command, but I dont seem tonhave that on thebsystemnthat has QT.

    There is, however, already a qmake.conf and qplatformdefs.h for ARM in the mkspec location. Are these the files I am meant to be generating?

    Either way, that page ends with different plugin options. It doesnt say anything about how to actually set Qt to use these files for anything, so Im still a little unclear on what the end goal is.

    K 1 Reply Last reply
    0
    • L lx_frz

      So the link I clicled on talked about using a "configure" command, but I dont seem tonhave that on thebsystemnthat has QT.

      There is, however, already a qmake.conf and qplatformdefs.h for ARM in the mkspec location. Are these the files I am meant to be generating?

      Either way, that page ends with different plugin options. It doesnt say anything about how to actually set Qt to use these files for anything, so Im still a little unclear on what the end goal is.

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #6

      @lx_frz said in How to get cross compile toolchain from target system:

      So the link I clicled on talked about using a "configure" command, but I dont seem tonhave that on thebsystemnthat has QT.

      There is, however, already a qmake.conf and qplatformdefs.h for ARM in the mkspec location. Are these the files I am meant to be generating?

      Either way, that page ends with different plugin options. It doesnt say anything about how to actually set Qt to use these files for anything, so Im still a little unclear on what the end goal is.

      I guess you did not download Qt sources yet. Here is a link for Qt 5.10.0. Thereare always a zip (for compilation for windows) and tar.xz (for compilation for linux and other systems). This is the single folder for complete lib. There is also an option for downloading only submodules, which I never did so far, because I prefer the complete version, which is presumably easier.

      The sources already delivered with a precompiled version are not as complete as you found out already.

      Also make sure that you use the archive for the OS, see above, you are targeting. AFAIK the difference are only the line endings.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koahnig
        wrote on last edited by
        #7

        Here is another page for compilation on linux

        Sorry, I seem to remember some different guides helping in compilation, but apparently they have renamed or moved and I cannot find them.

        When all compilers are already installed the main thing you have to do is starting configure script, wait and follow the instructions for continuing.

        The main things from the guide would be the first part. There is also a link provided for description of the configuration parameters.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lx_frz
          wrote on last edited by
          #8

          Ok, thank you for that link, I was having a tough time locating those sources.

          So if I read that first page you linked correctly, the main two things I need to specify for "configure" are -device and -sysroot.

          In the mkspec directory there is a subdirectory called 'linux-arm-gnueabi-g++', which sounds right, but for some reason when I pass that I get back "ERROR: No device matching 'linux-arm-gnueabi-g++'."

          And for the -sysroot I just pass in my root directory? Is that right?

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lx_frz
            wrote on last edited by
            #9

            Ok, im making some progress I think.

            I sent in -device linux-arm-generic-g++ instead and that seemed to register. Now its complaining that it cant find g++. It also says "Maybe you forgot to setup the environment?"

            I can see g++ at "/opt/Xilinx/sdk/2016.2/gnu/arm/lin/bin/arm-xilinx-linux-gnueabi-g++", and when I set up Xilinx it set my CROSS_COMPILE to "arm-xilinx-linux-gnueabi-". But apparently thats either not correct or not what QT wants. So I need help figuring out how to direct it properly.

            K 1 Reply Last reply
            0
            • L lx_frz

              Ok, im making some progress I think.

              I sent in -device linux-arm-generic-g++ instead and that seemed to register. Now its complaining that it cant find g++. It also says "Maybe you forgot to setup the environment?"

              I can see g++ at "/opt/Xilinx/sdk/2016.2/gnu/arm/lin/bin/arm-xilinx-linux-gnueabi-g++", and when I set up Xilinx it set my CROSS_COMPILE to "arm-xilinx-linux-gnueabi-". But apparently thats either not correct or not what QT wants. So I need help figuring out how to direct it properly.

              K Offline
              K Offline
              koahnig
              wrote on last edited by koahnig
              #10

              @lx_frz

              Those are the commands I have used for cross-compilation for BeagleBoneBoard

              ./configure -platform linux-g++ -release -device linux-beagleboard-g++ \
              -sysroot /opt/arm-toolchain/sysroot-glibc-linaro-arm-linux-gnueabihf \
              -prefix /opt/QtForBBB/ -device-option CROSS_COMPILE=/opt/arm-toolchain/gcc-linaro-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- \
              -qt-xcb -nomake tests -nomake examples -no-opengl
              

              I do not know what the embedded device is you are compiling for, but for the beaglebone the cross-compiler and sysroot had to be installed. Whereever you are going to install this sysroot you need to refer to.
              Note: the part after CROSS_COMPILE looks broken, but that is correct to have a stump there. It will be extended configure with "g++" or whatever is required.

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply
              0
              • L Offline
                L Offline
                lx_frz
                wrote on last edited by
                #11

                OK, I found a set of parameters that worked to start the build.

                Is this version of Qt you linked "stable"? I ask because the actual make process is currently failing when it reaches QWebGL, citing some issues with the source file. Im not really sure how to skip compilation of this, but at the moment Im stuck on that part.

                K 1 Reply Last reply
                0
                • L lx_frz

                  OK, I found a set of parameters that worked to start the build.

                  Is this version of Qt you linked "stable"? I ask because the actual make process is currently failing when it reaches QWebGL, citing some issues with the source file. Im not really sure how to skip compilation of this, but at the moment Im stuck on that part.

                  K Offline
                  K Offline
                  koahnig
                  wrote on last edited by
                  #12

                  @lx_frz

                  The given command as given in my previous post was producing a stable set Qt libs currently deployed on to BBB and working stable. At least those libraries used by my application.

                  The Qt version compiled version 5.9.2

                  What does the error message?

                  You can exclude certain things by prepending -no e.g. -no-opengl as I have used. Here is a list of submodules which you apparently can exclude -no-
                  Not sure if -no-webkit would help

                  Vote the answer(s) that helped you to solve your issue(s)

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    lx_frz
                    wrote on last edited by
                    #13

                    Switching to 5.9 helped.

                    I think I have just one more problem before this will work.

                    When I built the 5.9 and made an executable, it was recognized on the target platform, but couldnt run because it couldnt find the Qt .so files, despite them being on my platform.

                    On some threads I found from google, it qas recommended that I compile Qt statically to avoid this. I tried it and it worked. However, there is still 1 missing .so, libstdc++.so.6

                    Supposedly I could use the -static_runtime option to statically include this, but when I try that I get

                    Warning: Feature static_runtime is insignificant in this configuration, ignoring related command(s)

                    So I can make executables now, but they wont run on my target because I cant compile with a static libstdc++.so.6

                    Do you jave any suggestions about this?

                    K 1 Reply Last reply
                    0
                    • L lx_frz

                      Switching to 5.9 helped.

                      I think I have just one more problem before this will work.

                      When I built the 5.9 and made an executable, it was recognized on the target platform, but couldnt run because it couldnt find the Qt .so files, despite them being on my platform.

                      On some threads I found from google, it qas recommended that I compile Qt statically to avoid this. I tried it and it worked. However, there is still 1 missing .so, libstdc++.so.6

                      Supposedly I could use the -static_runtime option to statically include this, but when I try that I get

                      Warning: Feature static_runtime is insignificant in this configuration, ignoring related command(s)

                      So I can make executables now, but they wont run on my target because I cant compile with a static libstdc++.so.6

                      Do you jave any suggestions about this?

                      K Offline
                      K Offline
                      koahnig
                      wrote on last edited by
                      #14

                      @lx_frz said in How to get cross compile toolchain from target system:

                      Switching to 5.9 helped.

                      I think I have just one more problem before this will work.

                      When I built the 5.9 and made an executable, it was recognized on the target platform, but couldnt run because it couldnt find the Qt .so files, despite them being on my platform.

                      I had that problem too, but this helped

                      export LD_LIBRARY_PATH=/home/ubuntu/QtForBBB/lib:.
                      

                      The statement above is basically similar for that case as the path enviroment setting in windows.
                      The only issue is, for windows boys like me, the different syntax to separate path values. The separator is a ' : '
                      The shared libraries are on QtForBBB/lib and the default folder ' . ' for the dynamic libs of my application. Basically the default is also the folder where the application executable resides. linux does apparently/obviously not look into the default folder for dynamic libs.

                      On some threads I found from google, it qas recommended that I compile Qt statically to avoid this. I tried it and it worked. However, there is still 1 missing .so, libstdc++.so.6

                      I have seen those posts in the past as well, but actually I was surprised how easy this dynamic link part.

                      Supposedly I could use the -static_runtime option to statically include this, but when I try that I get

                      Warning: Feature static_runtime is insignificant in this configuration, ignoring related command(s)

                      So I can make executables now, but they wont run on my target because I cant compile with a static libstdc++.so.6

                      libstdc++.so.6 is part of the compiler. On my BBB it is found on folder /usr/lib/arm-linux-gnueabihf
                      As the whole setup looks to me is the compiler with all its libraries already installed on the device. Probably it came already with the bootable SD card.

                      For you that would mean that you need to install the gnu c++ with its libraries.

                      Vote the answer(s) that helped you to solve your issue(s)

                      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