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. Qt 5.15.2 cross compile with different glibc and glibcxx on host and target
QtWS25 Last Chance

Qt 5.15.2 cross compile with different glibc and glibcxx on host and target

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
cross-compilingx8664aarch64
8 Posts 2 Posters 2.0k 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.
  • K Offline
    K Offline
    Kiruseni
    wrote on last edited by
    #1

    Hello. I have small problem. I need to compile Qt 5.15.2 on x86_64 under aarch64. I copied sysroot from raspberry, everything compiles, but there is a problem when running the program on raspberry.

    pi@raspberrypi:~ $ ./testRasbperry 
    ./testRasbperry: /lib/aarch64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /opt/Qt/qtbase/lib/libQt5Core.so.5)
    ./testRasbperry: /lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.28' not found (required by /opt/Qt/qtbase/lib/libQt5Core.so.5)
    ./testRasbperry: /lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /opt/Qt/qtbase/lib/libQt5Core.so.5)
    

    On x86_64 used the following build commands Qt 5.15.2
    Number one

    ./qtbase/configure -release -no-gui -xplatform linux-aarch64-gnu-g++ -sysroot ~/RaspberryPi3B+/sysroot -prefix /opt/Qt/qtbase -extprefix ~/RaspberryPi3B+/buildQt -hostprefix ~/RaspberryPi3B+/buildQtTools -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtwebengine -nomake tests -make libs -pkg-config -no-use-gold-linker
    

    Numbet two

    ./qtbase/configure -release -no-gui -xplatform linux-aarch64-gnu-g++ -sysroot ~/RaspberryPi3B+/sysroot -prefix /opt/Qt/qtbase -extprefix ~/RaspberryPi3B+/buildQt -hostprefix ~/RaspberryPi3B+/buildQtTools -I ~/RaspberryPi3B+/sysroot/usr/include -L ~/RaspberryPi3B+/sysroot/lib -L ~/RaspberryPi3B+/sysroot/usr/lib -rpath -confirm-license -skip qtscript -skip qtwayland -skip qtwebengine -nomake tests -make libs -pkg-config -no-use-gold-linker
    

    The result in both cases is the same, not the same glibc and glibcxx on host and target. Actually, what is the question, how to force the compiler to use the libraries from sysroot, and not the system ones. The host machine has aarch64-linux-gnu-g ++ - 10, so I changed the name of the compiler in the mkspec file. The option to download another compiler, I don't want, I need to force the existing compiler to look for libraries for Qt in sysroot.
    Thanks in advance.

    raven-worxR 1 Reply Last reply
    0
    • K Kiruseni

      Hello. I have small problem. I need to compile Qt 5.15.2 on x86_64 under aarch64. I copied sysroot from raspberry, everything compiles, but there is a problem when running the program on raspberry.

      pi@raspberrypi:~ $ ./testRasbperry 
      ./testRasbperry: /lib/aarch64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /opt/Qt/qtbase/lib/libQt5Core.so.5)
      ./testRasbperry: /lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.28' not found (required by /opt/Qt/qtbase/lib/libQt5Core.so.5)
      ./testRasbperry: /lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /opt/Qt/qtbase/lib/libQt5Core.so.5)
      

      On x86_64 used the following build commands Qt 5.15.2
      Number one

      ./qtbase/configure -release -no-gui -xplatform linux-aarch64-gnu-g++ -sysroot ~/RaspberryPi3B+/sysroot -prefix /opt/Qt/qtbase -extprefix ~/RaspberryPi3B+/buildQt -hostprefix ~/RaspberryPi3B+/buildQtTools -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtwebengine -nomake tests -make libs -pkg-config -no-use-gold-linker
      

      Numbet two

      ./qtbase/configure -release -no-gui -xplatform linux-aarch64-gnu-g++ -sysroot ~/RaspberryPi3B+/sysroot -prefix /opt/Qt/qtbase -extprefix ~/RaspberryPi3B+/buildQt -hostprefix ~/RaspberryPi3B+/buildQtTools -I ~/RaspberryPi3B+/sysroot/usr/include -L ~/RaspberryPi3B+/sysroot/lib -L ~/RaspberryPi3B+/sysroot/usr/lib -rpath -confirm-license -skip qtscript -skip qtwayland -skip qtwebengine -nomake tests -make libs -pkg-config -no-use-gold-linker
      

      The result in both cases is the same, not the same glibc and glibcxx on host and target. Actually, what is the question, how to force the compiler to use the libraries from sysroot, and not the system ones. The host machine has aarch64-linux-gnu-g ++ - 10, so I changed the name of the compiler in the mkspec file. The option to download another compiler, I don't want, I need to force the existing compiler to look for libraries for Qt in sysroot.
      Thanks in advance.

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

      @Kiruseni
      your cross compile toolchain must contain (built against) the correct libc variant/version.

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

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

        @Kiruseni
        your cross compile toolchain must contain (built against) the correct libc variant/version.

        K Offline
        K Offline
        Kiruseni
        wrote on last edited by
        #3

        @raven-worx
        So is it impossible to cross compile Qt with aarch64-linux-gnu-10 on host with systems libs from sysroot?

        raven-worxR 1 Reply Last reply
        0
        • K Kiruseni

          @raven-worx
          So is it impossible to cross compile Qt with aarch64-linux-gnu-10 on host with systems libs from sysroot?

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

          @Kiruseni
          cant answer that.
          But as always when you cross compile your toolchain must match your target system. The effectively used libc is not part of the sysroot but of the used cc toolchain.

          I simply assume your installed cross compile toolchain is too new for the target system.

          When your host system doesn't provide a compatible toolchain you can built it yourself, using crosstool-ng
          (for example see https://ilyas-hamadouche.medium.com/creating-a-cross-platform-toolchain-for-raspberry-pi-4-5c626d908b9d)

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

          K 1 Reply Last reply
          1
          • raven-worxR raven-worx

            @Kiruseni
            cant answer that.
            But as always when you cross compile your toolchain must match your target system. The effectively used libc is not part of the sysroot but of the used cc toolchain.

            I simply assume your installed cross compile toolchain is too new for the target system.

            When your host system doesn't provide a compatible toolchain you can built it yourself, using crosstool-ng
            (for example see https://ilyas-hamadouche.medium.com/creating-a-cross-platform-toolchain-for-raspberry-pi-4-5c626d908b9d)

            K Offline
            K Offline
            Kiruseni
            wrote on last edited by
            #5

            @raven-worx
            What is the meaning of the parameter "-gcc-sysroot" in qtbase/configure?

            raven-worxR 1 Reply Last reply
            0
            • K Kiruseni

              @raven-worx
              What is the meaning of the parameter "-gcc-sysroot" in qtbase/configure?

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

              @Kiruseni
              what do you mean exactly?
              what a sysroot is and what it is used for? if so there are plenty of resources on the web.

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

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

                @Kiruseni
                what do you mean exactly?
                what a sysroot is and what it is used for? if so there are plenty of resources on the web.

                K Offline
                K Offline
                Kiruseni
                wrote on last edited by
                #7

                @raven-worx
                no

                $ ./configure --help | grep sysroot
                  -sysroot <dir> ....... Set <dir> as the target sysroot
                  -gcc-sysroot ......... With -sysroot, pass --sysroot to the compiler [yes]
                

                if i use parametr -gcc-sysroot its mean take systems libs from sysroot or what?

                raven-worxR 1 Reply Last reply
                0
                • K Kiruseni

                  @raven-worx
                  no

                  $ ./configure --help | grep sysroot
                    -sysroot <dir> ....... Set <dir> as the target sysroot
                    -gcc-sysroot ......... With -sysroot, pass --sysroot to the compiler [yes]
                  

                  if i use parametr -gcc-sysroot its mean take systems libs from sysroot or what?

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

                  @Kiruseni
                  honestly i dont know, i've never used nor seen this parameter until now actually.
                  I always used the -sysroot parameter so far.

                  But it seems it is set automatically anyways. I assume it just means that the compiler handles the sysroot (which gcc is capable of)

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

                  • Login

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