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. Cross-compiled Qt6 libraries are huge!
Forum Updated to NodeBB v4.3 + New Features

Cross-compiled Qt6 libraries are huge!

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
4 Posts 2 Posters 77 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.
  • L Offline
    L Offline
    liteyear
    wrote last edited by
    #1

    I'm attempting to deploy a Qt Quick app to an embedded target with limited resources. Building the application is fine, but getting the Qt libraries on to the target is proving very challenging!

    I'm using a Linux x86_64 machine to build, because that's what the vendor toolchain (Digi Embedded Yocto, arm-dey-linux-gnueabi) supports. After setting up the cross compilation environment, my latest attempt configures like so:

    ../qt-everywhere-src-6.8.3/configure -release -opengl es2 -nomake examples -nomake tests -skip qtquick3d -skip qtgraphs -skip qtquick3dphysics -skip qtwebview -skip qtwebengine -skip qtdoc -skip qtopcua -skip qtremoteobjects -skip qtscxml -skip qtwebchannel -skip qtspeech -qt-host-path /opt/Qt/6.8.3/gcc_64 -extprefix /path/to/local/install -prefix /opt/Qt
    

    The resulting libraries are huge:

    Screenshot 2025-12-02 at 5.22.24 pm.png

    Everywhere else I see these libraries they are 10MB or less. Even in the vendor provided images! Alas there's no pre-built image with Qt5Compat, so I'm DIYing it.

    I've been experimenting with variations of -ltcg -reduce-exports and -skip but at 4 hours per iteration is slow going. My next attempt will be with -static. But I'm worried I'm barking up the wrong tree. Perhaps there's a fundamental limitation with yocto toolchains?

    1 Reply Last reply
    0
    • aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote last edited by
      #2

      Hi @liteyear,

      Are these libraries stripped? (You can test with the file command). My guess is they still contain debug symbols.

      Regards

      Qt has to stay free or it will die.

      L 1 Reply Last reply
      3
      • aha_1980A aha_1980

        Hi @liteyear,

        Are these libraries stripped? (You can test with the file command). My guess is they still contain debug symbols.

        Regards

        L Offline
        L Offline
        liteyear
        wrote last edited by
        #3

        @aha_1980 OMG you're right!

        $ file ../qt-install/lib/libQt6Core.so.6.8.3
        ../qt-install/lib/libQt6Core.so.6.8.3: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=ae13d6cd44f2f88e7f2be51eab194d12fed14f20, with debug_info, not stripped
        

        What part of "release build" results in debug symbols? FWIW, here's the top of config.summary:

        Building for: linux-g++ (arm, CPU features: neon)
        Compiler: gcc 13.4.0
        Build options:
          Mode ................................... release
          Optimize release build for size ........ no
          Fully optimize release builds (-O3) .... no
          Building shared libraries .............. yes
          Using ccache ........................... no
          Unity Build ............................ no
          Using new DTAGS ........................ yes
          Relocatable ............................ yes
          Using precompiled headers .............. yes
          Using Link Time Optimization (LTCG) .... yes
        

        I've looked all over the Internet for configure/build settings to reduce size, and haven't found any mention of debug symbols. Even "stripping" has resulted in deadends. Can I remove them?

        L 1 Reply Last reply
        0
        • L liteyear

          @aha_1980 OMG you're right!

          $ file ../qt-install/lib/libQt6Core.so.6.8.3
          ../qt-install/lib/libQt6Core.so.6.8.3: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=ae13d6cd44f2f88e7f2be51eab194d12fed14f20, with debug_info, not stripped
          

          What part of "release build" results in debug symbols? FWIW, here's the top of config.summary:

          Building for: linux-g++ (arm, CPU features: neon)
          Compiler: gcc 13.4.0
          Build options:
            Mode ................................... release
            Optimize release build for size ........ no
            Fully optimize release builds (-O3) .... no
            Building shared libraries .............. yes
            Using ccache ........................... no
            Unity Build ............................ no
            Using new DTAGS ........................ yes
            Relocatable ............................ yes
            Using precompiled headers .............. yes
            Using Link Time Optimization (LTCG) .... yes
          

          I've looked all over the Internet for configure/build settings to reduce size, and haven't found any mention of debug symbols. Even "stripping" has resulted in deadends. Can I remove them?

          L Offline
          L Offline
          liteyear
          wrote last edited by
          #4

          Well I did the most basic thing I could think of:

          arm-dey-linux-gnueabi-strip --strip-unneeded lib/*.so.6.8.3 lib/*.a
          

          And whaddya know:

          Screenshot 2025-12-03 at 9.36.18 am.png

          Why was that step necessary? I can't find mention of it anywhere, even in the Building Optimized Qt page.

          1 Reply Last reply
          2

          • Login

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