Qt World Summit: Submit your Presentation

Compiling QT5 From Source For Embedded

  • Hi there,

    I'm trying to build qt5 from source to prepare a cross-compile environment for an imx6 embedded board.

    I have some question about it and be happy if you could answer them.

    1- Why we have different mkspec conf files? Aren't all arm7v family same? Ok, they may not be same, but isn't is possible to reconfigure compilation by just setting or disabling some flags?

    2- Why do we need toolchain for target board? Why we need to download different arm-gnueabi/gnueabihf compilers and libraries? Doesn't the arm compiler (which is in the current ubuntu repository) compile all required libraries from source code from my computer?

    Can anybody explain me the whole process with a basic steps? I was thinking about something like this;
    Get compiler for arm (hf or sf) --> get the source code --> use arm compiler to compile source against arm architecture

    Which part am I missing?

    Thanks in advance.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    1. No, they don't provide all the exact same hardware e.g. FPU model. Also, because the various devices offer different support not only related to the processor but also for example the GPU available etc.
      It's also nice to have all the needed flags stored in one place rather than to have to hunt for them, store them anyway somewhere for the next time you need to build Qt on a different machine etc.

    2. Because the hard float support is pretty recent and was not as widespread as today. Also, depending on the distribution running you didn't had the option to run hf binaries because the system was built using gnu-eabi.

    It's rather:

    1. Look for the device's Linux distribution
    2. Determine which ABI it uses
    3. Get the correct compiler
    4. Install all the needed dev package on the device
    5. Cross-compile
    6. Enjoy

  • @SGaist thank you for the fast reply. now I started to see the difference.