Does Qt4.7.3 have specific requirement of the glibc version?



  • Hello,

    I am cross-compiling Qt for embedded linux.
    after deployment on the target device, i run the application but get the following errors:
    ./fancybrowser: /lib/libc.so.6: version GLIBC_2.9' not found (required by /home/root/libQtGui.so.4) ./fancybrowser: /lib/libc.so.6: versionGLIBC_2.10' not found (required by /home/root/libQtNetwork.so.4)
    ./fancybrowser: /lib/libc.so.6: version `GLIBC_2.9' not found (required by /home/root/libQtCore.so.4)

    after that, i cross-complied a very simple application which can run normally on the target device.
    my target device has a libc.2.5.so, so i think that maybe qt4.7.3 has a requirement on glibc version?

    my qmake.conf:
    @include(../../common/g++.conf)
    include(../../common/linux.conf)
    include(../../common/qws.conf)

    modifications to g++.conf

    QMAKE_CC = i686-pc-linux-gnu-gcc
    QMAKE_CXX = i686-pc-linux-gnu-g++
    QMAKE_LINK = i686-pc-linux-gnu-g++
    QMAKE_LINK_SHLIB = i686-pc-linux-gnu-g++

    QMAKE_INCDIR = /root/CodeSourcery/Sourcery_G++_Lite/i686-pc-linux-gnu/libc/usr/include
    QMAKE_LIBDIR = /root/CodeSourcery/Sourcery_G++_Lite/i686-pc-linux-gnu/libc/usr/lib

    modifications to linux.conf

    QMAKE_AR = i686-pc-linux-gnu-ar cqs
    QMAKE_OBJCOPY = i686-pc-linux-gnu-objcopy
    QMAKE_STRIP = i686-pc-linux-gnu-strip

    load(qt_config)@



  • I'm not sure about a required minimal version of glibc for Qt but you need to ensure that you link against the same version on your host machine as is available on your target board.



  • @
    root@adewang-desktop:~/tmp/qtEmbed/examples/webkit/fancybrowser# ldd fancybrowser
    linux-gate.so.1 => (0x00bc8000)
    libQtWebKit.so.4 => /root/tmp/QtEmbed/lib/libQtWebKit.so.4 (0x00bc9000)
    libQtGui.so.4 => /root/tmp/QtEmbed/lib/libQtGui.so.4 (0x17a39000)
    libQtNetwork.so.4 => /root/tmp/QtEmbed/lib/libQtNetwork.so.4 (0x0034c000)
    libQtCore.so.4 => /root/tmp/QtEmbed/lib/libQtCore.so.4 (0x006e6000)
    libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x00aa6000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00110000)
    libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x00206000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0022c000)
    libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00418000)
    libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x00a57000)
    librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0x005a3000)
    /lib/ld-linux.so.2 (0x006c9000)
    @
    i have definded
    QMAKE_LIBDIR = /root/CodeSourcery/Sourcery_G++_Lite/i686-pc-linux-gnu/libc/usr/lib
    why does the excutable not linked to those lib in /root/CodeSourcery/Sourcery_G++_Lite/i686-pc-linux-gnu/libc/usr/lib, but still linked to the default libs in /lib/tls/i686/cmov?

    when i build qt, i used the following configure options:
    @./configure -xplatform qws/linux-i686-g++ -embedded x86 -D QT_NO_QWS_MULTIPROCESS
    -prefix /root/tmp/QtEmbed
    -qt-gfx-linuxfb -qt-gfx-vnc
    -no-largefile -exceptions -no-accessibility -no-qt3support -no-sse2 -qt-zlib -no-gif -no-libtiff
    -qt-libpng -no-libmng -qt-libjpeg -no-openssl -no-nis -no-cups -depths 16
    -qt-kbd-linuxinput -nomake demos -nomake examples
    -confirm-license -opensource@

    Edit: Added @ tags [ZapB]



  • Well, since you look to be building on an i686 for a different i686 it looks as if something is getting confused and using the wrong toolchain resulting in the wrong glibc (and others) being linked in when you build Qt.

    You need to ensure that i686-pc-linux-gnu-gcc and friends actually get resolved to the compiler that is part of your embedded toolchain rather than your normal system compiler. Hopefully that will be enough to get the toolchain to link to the correct libs. If not, then we may need to look at adjusting the linker search path.

    So try doing:

    @
    which i686-pc-linux-gnu-gcc
    @

    and see if it resolves to the embedded cross compiler. If not, adjust $PATH environment variable so that it does and try re-configuring and rebuilding Qt.



  • @root@adewang-desktop:/# which i686-pc-linux-gnu-gcc
    /root/CodeSourcery/Sourcery_G++_Lite/bin/i686-pc-linux-gnu-gcc@

    when i install codesourcery, the installer have adjusted $PATH.



  • Hmmm, OK then. Here's some more things to check:

    • Look over the output of Qt's configure command to make sure it all looks sane.
    • Look at the output during the Qt build to make sure that looks sane
    • Ensure that it is not just a case of your $LD_LIBRARY_PATH or /etc/ld.so.conf causing ldd to return spurious results.


  • I think the configure and build of Qt has no problem,
    cause the executable can run normally in the host system.
    I browsed the /etc/ld.so.cong, can not find /lib/tls/i686/cmov.
    how can ldd know to search .so files in that directory?



  • Search locations can also be hard-coded into the libs themselves. Google for RPATH to read about it. You can check the dynamic section of the generated lib/binary by doing this for e.g.:

    @
    readelf -d libQtCore.so
    @



  • @Dynamic section at offset 0x2e2c8c contains 28 entries:
    Tag Type Name/Value
    0x00000001 (NEEDED) Shared library: [libpthread.so.0]
    0x00000001 (NEEDED) Shared library: [libdl.so.2]
    0x00000001 (NEEDED) Shared library: [librt.so.1]
    0x00000001 (NEEDED) Shared library: [libstdc++.so.6]
    0x00000001 (NEEDED) Shared library: [libm.so.6]
    0x00000001 (NEEDED) Shared library: [libgcc_s.so.1]
    0x00000001 (NEEDED) Shared library: [libc.so.6]
    0x0000000e (SONAME) Library soname: [libQtCore.so.4]
    0x0000000f (RPATH) Library rpath: [/root/tmp/QtEmbed/lib]
    0x0000000c (INIT) 0x42744
    0x0000000d (FINI) 0x1b99f8
    0x00000004 (HASH) 0xd4
    0x00000005 (STRTAB) 0x14a98
    0x00000006 (SYMTAB) 0x4f98
    0x0000000a (STRSZ) 135346 (bytes)
    0x0000000b (SYMENT) 16 (bytes)
    0x00000003 (PLTGOT) 0x2e4094
    0x00000002 (PLTRELSZ) 15016 (bytes)
    0x00000014 (PLTREL) REL
    0x00000017 (JMPREL) 0x3ec9c
    0x00000011 (REL) 0x37c6c
    0x00000012 (RELSZ) 28720 (bytes)
    0x00000013 (RELENT) 8 (bytes)
    0x6ffffffe (VERNEED) 0x37aac
    0x6fffffff (VERNEEDNUM) 7
    0x6ffffff0 (VERSYM) 0x35b4a
    0x6ffffffa (RELCOUNT) 1624
    0x00000000 (NULL) 0x0
    @

    No information is related with /lib/tls/i686/cmov



  • How come that your application is looking for your Qt libraries are under /root/tmp/ and libc under /lib/? Isn't it supposed to pick the libc from the cross-compiler toolchain (i.e. somewhere under /root/CodeSourcery/, I guess)?



  • Hi peppe,

    What you observed is just the thing puzzling me.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.