July 15, 2011

adewang adewang
Lab Rat
18 posts

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: version `GLIBC_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:

  1. include(../../common/g++.conf)
  2. include(../../common/linux.conf)
  3. include(../../common/qws.conf)
  4.  
  5. # modifications to g++.conf
  6. QMAKE_CC                = i686-pc-linux-gnu-gcc
  7. QMAKE_CXX               = i686-pc-linux-gnu-g++
  8. QMAKE_LINK              = i686-pc-linux-gnu-g++
  9. QMAKE_LINK_SHLIB        = i686-pc-linux-gnu-g++
  10.  
  11. QMAKE_INCDIR            = /root/CodeSourcery/Sourcery_G++_Lite/i686-pc-linux-gnu/libc/usr/include
  12. QMAKE_LIBDIR            = /root/CodeSourcery/Sourcery_G++_Lite/i686-pc-linux-gnu/libc/usr/lib
  13.  
  14. # modifications to linux.conf
  15. QMAKE_AR                = i686-pc-linux-gnu-ar cqs
  16. QMAKE_OBJCOPY           = i686-pc-linux-gnu-objcopy
  17. QMAKE_STRIP             = i686-pc-linux-gnu-strip
  18.  
  19. load(qt_config)

10 replies

July 15, 2011

ZapB ZapB
Robot Herder
1354 posts

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.

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

July 21, 2011

adewang adewang
Lab Rat
18 posts

  1. root@adewang-desktop:~/tmp/qtEmbed/examples/webkit/fancybrowser# ldd fancybrowser
  2.  linux-gate.so.1 =>  (0x00bc8000)
  3.  libQtWebKit.so.4 => /root/tmp/QtEmbed/lib/libQtWebKit.so.4 (0x00bc9000)
  4.  libQtGui.so.4 => /root/tmp/QtEmbed/lib/libQtGui.so.4 (0x17a39000)
  5.  libQtNetwork.so.4 => /root/tmp/QtEmbed/lib/libQtNetwork.so.4 (0x0034c000)
  6.  libQtCore.so.4 => /root/tmp/QtEmbed/lib/libQtCore.so.4 (0x006e6000)
  7.  libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x00aa6000)
  8.  libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00110000)
  9.  libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x00206000)
  10.  libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0022c000)
  11.  libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00418000)
  12.  libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x00a57000)
  13.  librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0x005a3000)
  14.  /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:

  1. ./configure -xplatform qws/linux-i686-g++ -embedded x86 -D QT_NO_QWS_MULTIPROCESS \
  2.             -prefix /root/tmp/QtEmbed \
  3.             -qt-gfx-linuxfb -qt-gfx-vnc \
  4.             -no-largefile -exceptions -no-accessibility -no-qt3support -no-sse2 -qt-zlib -no-gif -no-libtiff\
  5.             -qt-libpng -no-libmng -qt-libjpeg -no-openssl -no-nis -no-cups -depths 16 \
  6.             -qt-kbd-linuxinput -nomake demos -nomake examples \
  7.             -confirm-license -opensource

Edit: Added @ tags [ZapB]

July 21, 2011

ZapB ZapB
Robot Herder
1354 posts

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:

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

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

July 21, 2011

adewang adewang
Lab Rat
18 posts

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

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

July 21, 2011

ZapB ZapB
Robot Herder
1354 posts

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

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

July 21, 2011

adewang adewang
Lab Rat
18 posts

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?

July 21, 2011

ZapB ZapB
Robot Herder
1354 posts

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

  1. readelf -d libQtCore.so

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

July 27, 2011

adewang adewang
Lab Rat
18 posts

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

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

July 27, 2011

peppe peppe
Ant Farmer
1025 posts

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

 Signature 

Software Engineer
KDAB (UK) Ltd., a KDAB Group company

July 28, 2011

adewang adewang
Lab Rat
18 posts

Hi peppe,

What you observed is just the thing puzzling me.

 
  ‹‹ Is it QT-creator-win-opensource-2.2.1 intended for the Destkop?      mysql for Qt on ubuntu ››

You must log in to post a reply. Not a member yet? Register here!