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. QT5.7 libraries built with GCC-4.9.1 but linked with older libstdc++?
Forum Updated to NodeBB v4.3 + New Features

QT5.7 libraries built with GCC-4.9.1 but linked with older libstdc++?

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
8 Posts 2 Posters 2.6k 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.
  • S Offline
    S Offline
    SandeepT
    wrote on last edited by
    #1

    Hi,

    I built QT-5.7 sources on CentOS 6.5 64-bit and then compared with the binaries that is bundled in the QT-5.7 offline installer. I found that the QT5 libraries (specially webengine libs) that I built had a dependency on libstdc++.so that was installed on my machine when I built GCC-4.9.1. But the libraries that is bundled in the installer is actually linked with older libstdc++. How is it possible to do that?

    Installer lib:
    $ strings -a Qt570_installer/5.7/gcc_64/lib/libQt5WebEngineCore.so | grep GCC:
    GCC: (GNU) 4.4.7 20120313 (Red Hat 4.4.7-9)
    GCC: (GNU) 4.9.1 20140922 (Red Hat 4.9.1-10)

    $ strings -a Qt570_installer/5.7/gcc_64/lib/libQt5WebEngineCore.so | grep ^CXXABI
    CXXABI_1.3

    $ strings -a Qt570_installer/5.7/gcc_64/lib/libQt5WebEngineCore.so | grep ^GLIBCXX
    GLIBCXX_3.4.11
    GLIBCXX_3.4.10
    GLIBCXX_3.4.9
    GLIBCXX_3.4

    My Build:
    $ strings -a Qt-5.7.0/lib/libQt5WebEngineCore.so | grep GCC:
    GCC: (GNU) 4.4.7 20120313 (Red Hat 4.4.7-16)
    GCC: (GNU) 4.9.1

    $ strings -a Qt-5.7.0/lib/libQt5WebEngineCore.so | grep ^CXXABI
    CXXABI_1.3.5
    CXXABI_1.3

    $ strings -a Qt-5.7.0/lib/libQt5WebEngineCore.so | grep ^GLIBCXX
    GLIBCXX_3.4.20
    GLIBCXX_3.4.14
    GLIBCXX_3.4.10
    GLIBCXX_3.4.18
    GLIBCXX_3.4.15
    GLIBCXX_3.4.9
    GLIBCXX_3.4.11
    GLIBCXX_3.4

    So, because of this difference, I see that the resulting application needed libstdc++.so from the gcc-4.9.1 on the target machine. The same was not needed when I built the application using the QT offline installer.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SandeepT
      wrote on last edited by
      #2

      Hi,

      I really would like to know this how QT guys compile the QT source with higher version of GCC but link with lower STDC++ library. I'm trying to build QT5.7.1 on CentOS 6 32bit and the app crashes and gdb is not showing enough information but it seems it has to do with system libs like libc.so, libm.so

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SandeepT
        wrote on last edited by
        #3

        To give an idea on how I configured QT on CentOS 6 32bit:

        • Since system comes with GCC-4.4.7, I configured GCC-4.9.1 sources and installed in /usr/local/. I then set the PATH and LD_LIBRARY_PATH to include the GCC-4.9.1 bin and lib paths resp and configured QT.

        My app crashes and here is the backtrace:

        (gdb) bt
        #0 0x00003402 in ?? ()
        #1 0x00f19ac7 in __fmaf_ifunc () at ../sysdeps/i386/i686/multiarch/s_fmaf.c:30
        #2 0x00abff6c in elf_machine_rel (scope=0xb77b2a40, reloc_mode=1, consider_profiling=0) at ../sysdeps/i386/dl-machine.h:351
        #3 elf_dynamic_do_rel (scope=0xb77b2a40, reloc_mode=1, consider_profiling=0) at do-rel.h:120
        #4 _dl_relocate_object (scope=0xb77b2a40, reloc_mode=1, consider_profiling=0) at dl-reloc.c:268
        #5 0x00ab69df in dl_main (phdr=0x8048034, phnum=8, user_entry=0xbf9b92ec, auxv=0xbf9b93f8) at rtld.c:2262
        #6 0x00ac8c11 in _dl_sysdep_start (start_argptr=0xbf9b9350, dl_main=0xab5630 <dl_main>) at ../elf/dl-sysdep.c:244
        #7 0x00ab4273 in _dl_start_final (arg=0xbf9b9350) at rtld.c:335
        #8 _dl_start (arg=0xbf9b9350) at rtld.c:561
        #9 0x00ab3857 in _start () from /lib/ld-2.12.so

        jsulmJ 1 Reply Last reply
        0
        • S SandeepT

          To give an idea on how I configured QT on CentOS 6 32bit:

          • Since system comes with GCC-4.4.7, I configured GCC-4.9.1 sources and installed in /usr/local/. I then set the PATH and LD_LIBRARY_PATH to include the GCC-4.9.1 bin and lib paths resp and configured QT.

          My app crashes and here is the backtrace:

          (gdb) bt
          #0 0x00003402 in ?? ()
          #1 0x00f19ac7 in __fmaf_ifunc () at ../sysdeps/i386/i686/multiarch/s_fmaf.c:30
          #2 0x00abff6c in elf_machine_rel (scope=0xb77b2a40, reloc_mode=1, consider_profiling=0) at ../sysdeps/i386/dl-machine.h:351
          #3 elf_dynamic_do_rel (scope=0xb77b2a40, reloc_mode=1, consider_profiling=0) at do-rel.h:120
          #4 _dl_relocate_object (scope=0xb77b2a40, reloc_mode=1, consider_profiling=0) at dl-reloc.c:268
          #5 0x00ab69df in dl_main (phdr=0x8048034, phnum=8, user_entry=0xbf9b92ec, auxv=0xbf9b93f8) at rtld.c:2262
          #6 0x00ac8c11 in _dl_sysdep_start (start_argptr=0xbf9b9350, dl_main=0xab5630 <dl_main>) at ../elf/dl-sysdep.c:244
          #7 0x00ab4273 in _dl_start_final (arg=0xbf9b9350) at rtld.c:335
          #8 _dl_start (arg=0xbf9b9350) at rtld.c:561
          #9 0x00ab3857 in _start () from /lib/ld-2.12.so

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @SandeepT Do you set LD_LIBRARY_PATH variable before starting your app, so it points to /usr/local/... ?
          If not then I guess the loader loads older libs from /usr which are built with the older compiler.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SandeepT
            wrote on last edited by
            #5

            No, I set LD_LIBRARY_PATH and PATH variables before I configure QT so that it picks the correct GCC.

            PATH=/usr/local/gcc-4.9.1/bin:$PATH
            LD_LIBRARY_PATH=/usr/local/gcc-4.9.1/lib:$PATH

            jsulmJ 1 Reply Last reply
            0
            • S SandeepT

              No, I set LD_LIBRARY_PATH and PATH variables before I configure QT so that it picks the correct GCC.

              PATH=/usr/local/gcc-4.9.1/bin:$PATH
              LD_LIBRARY_PATH=/usr/local/gcc-4.9.1/lib:$PATH

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @SandeepT Then try to set LD_LIBRARY_PATH before starting your app, so the loader picks up correct libraries.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SandeepT
                wrote on last edited by
                #7

                yes, I do set LD_LIBRARY_PATH before I run my app. I basically need to know two things:

                1. Why the QT libraries that I built depends on libstdc++ that comes with gcc-4.9.1 and the libraries bundled in the QT offline installer do not, even though the compiler version used in both the cases is 4.9.1 ?

                2. Which libraries from GCC should I bundle along with my app? libstdc++.so, libgcc_s.so?

                jsulmJ 1 Reply Last reply
                0
                • S SandeepT

                  yes, I do set LD_LIBRARY_PATH before I run my app. I basically need to know two things:

                  1. Why the QT libraries that I built depends on libstdc++ that comes with gcc-4.9.1 and the libraries bundled in the QT offline installer do not, even though the compiler version used in both the cases is 4.9.1 ?

                  2. Which libraries from GCC should I bundle along with my app? libstdc++.so, libgcc_s.so?

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @SandeepT

                  1. As far as I know Qt for Linux is built on RedHat Linux, that could explain
                  2. You should bundle libraries which are needed by your app, you can find out which those are calling
                  ldd YOUR_APP
                  

                  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