I recently blogged about Qt being available for Haiku/BeOS and OS/2. In case you have not read it at Slashdot yet, here comes another new platform: Amazon Kindle. This is getting crazy. What’s next? My ZX Spectrum?
Archive for the ‘Unix/Linux’ Category
Qt for Amazon Kindle
Sunday, January 31st, 2010Libraries and link interfaces
Friday, October 30th, 2009Today I received an e-mail from Vincent about some strange warnings dpkg-shlibdeps was showing when building from source the Wt packages on Debian:
dpkg-shlibdeps: warning: symbol pthread_join used by debian/witty/usr/lib/libwthttp.so.2.2.4 found in none of the libraries.
dpkg-shlibdeps: warning: symbol pthread_key_delete used by debian/witty/usr/lib/libwthttp.so.2.2.4 found in none of the libraries.
dpkg-shlibdeps: warning: symbol pthread_mutexattr_init used by debian/witty/usr/lib/libwthttp.so.2.2.4 found in none of the libraries.
dpkg-shlibdeps: warning: symbol pthread_setspecific used by debian/witty/usr/lib/libwthttp.so.2.2.4 found in none of the libraries.
dpkg-shlibdeps: warning: symbol pthread_mutexattr_settype used by debian/witty/usr/lib/libwthttp.so.2.2.4 found in none of the libraries.
dpkg-shlibdeps: warning: symbol pthread_detach used by debian/witty/usr/lib/libwthttp.so.2.2.4 found in none of the libraries.
dpkg-shlibdeps: warning: symbol pthread_mutexattr_destroy used by debian/witty/usr/lib/libwthttp.so.2.2.4 found in none of the libraries.
dpkg-shlibdeps: warning: symbol pthread_getspecific used by debian/witty/usr/lib/libwthttp.so.2.2.4 found in none of the libraries.
dpkg-shlibdeps: warning: symbol pthread_key_create used by debian/witty/usr/lib/libwthttp.so.2.2.4 found in none of the libraries.
dpkg-shlibdeps: warning: symbol pthread_sigmask used by debian/witty/usr/lib/libwthttp.so.2.2.4 found in none of the libraries.
dpkg-shlibdeps: warning: symbol pthread_mutexattr_settype used by debian/witty/usr/lib/libwt.so.2.2.4 found in none of the libraries.
dpkg-shlibdeps: warning: symbol pthread_mutexattr_init used by debian/witty/usr/lib/libwt.so.2.2.4 found in none of the libraries.
dpkg-shlibdeps: warning: symbol pthread_mutexattr_destroy used by debian/witty/usr/lib/libwt.so.2.2.4 found in none of the libraries.
He asked if I knew what was that (a dpkg-shlibdeps bug?) and what did it mean, it case it was correct.
That error means pthread_join, pthread_mutexattr_destroy, etc are used by libwt.so and libwthttp.so but those libraries are not linked to libpthread.so by Wt’s buildsystem. I. e. the linker command line when putting libwt.so and libwthttp.so together does not have a “-lpthread“.
Is dpkg-shlibdeps right about that? Yes, it is:
- libwt.so uses libpthread.so in the XML library (Wt bundles the sources ot MiniXML and compiles them as part of libwt.so)
- libwthttp.so uses libpthread.so in WServer.C
So, if the buildsystem is not linking libwt.so and libwthttp.so to libpthread.so, why doesn’t linking fail with “unresolved reference” errors? It’s because of the link interface in Boost is wrong.
Link interface? What’s that?
If you are reading me via Planet KDE, you probably know what I’m talking about because Alex has written about this. If you don’t know what I’m talking about, keep reading.
Say you have libA.so, libB.so and libC.so.
- libA.so does not link to any external library, save for glibc
- libB.so links only to libA.so and glibc
- libC.so links only libB.so and glibc
When you run ldd libC.so, what will you get? This?
$ ldd libC.so
linux-gate.so.1 => (0xb7f66000)
libB.so => /usr/lib/libB.so
libc.so.6 => /lib/tls/i686/cmov/libc.so.6
/lib/ld-linux.so.2 (0xb7f67000)
or this?
$ ldd libC.so
linux-gate.so.1 => (0xb7f66000)
libB.so => /usr/lib/libB.so
libA.so => /usr/lib/libA.so < =======
libc.so.6 => /lib/tls/i686/cmov/libc.so.6
/lib/ld-linux.so.2 (0xb7f67000)
The answer is you’ll see the second output: libC.so is linking to libA.so, although when you linked it you only did gcc -o libC.so libC.c -lB (no -lA, so no explicit linking to libA.so):
libC -> libB -> libA
Why is that? Why is libA.so being dragged to libC.so? It’s because of what we call “link interface”
As libC.so links to libB.so, by default, libC.so’s ELF header will have every library libB.so links to as NEEDED: libB.so’s dependencies have been transitively passed into libC.so! Usually that’s not what you want, therefore it is possible to specify a “reduced link interface”: given that libA.so is only used internally in libB.so (users of libB.so do not need to use any type or function defined in libA), there is no need to link libC.so to libA.so.
Therefore:
- As libwt.so and libwthttp.so link to libboost_thread-mt.so from Boost
- In Debian, Boost is compiled with threads (i. e. it links to libpthread.so)
- Boost does not publish a reduced link interface but the full link interface (i. e. every dependency of Boost is transitively passed into applications/libraries using Boost)
… even though libwt.so and libwthttp.so were not linking to libpthread.so explicitly, they were picking libpthread.so from libboost_thread-mt.so and no linkage error happened. If libboost_thread-mt.so would not export libpthread.so (it should not!), linkage of libwt.so and libwthttp.so would have failed and the authors of Wt would have noticed the bug in their build system.
While this is not a critical issue, it makes your application/library load slower, because it needs to resolve and load the NEEDED libraries.
Please note this discussion is valid for any operating system, including Windows and Mac OS X.
If you use CMake as your build system and you want to adopt a reduced link interface, take a look at the CMake docs for TARGET_LINK_LIBRARIES, particularly the LINK_INTERFACE_LIBRARIES section:
Library dependencies are transitive by default. When this target is linked into another target then the libraries linked to this target will appear on the link line for the other target too. See the LINK_INTERFACE_LIBRARIES target property to override the set of transitive link dependencies for a target.
target_link_libraries(
LINK_INTERFACE_LIBRARIES
[[debug|optimized|general]] …) The LINK_INTERFACE_LIBRARIES mode appends the libraries to the LINK_INTERFACE_LIBRARIES and its per-configuration equivalent target properties instead of using them for linking. Libraries specified as “debug” are appended to the the LINK_INTERFACE_LIBRARIES_DEBUG property (or to the properties corresponding to configurations listed in the DEBUG_CONFIGURATIONS global property if it is set). Libraries specified as “optimized” are appended to the the LINK_INTERFACE_LIBRARIES property. Libraries specified as “general” (or without any keyword) are treated as if specified for both “debug” and “optimized”.
NB: The comments in this blog do not work due to a hosting issue
ACE in Debian
Friday, October 30th, 2009Are you a developer and use ACE, TAO, CIAO? Do you use and/or deploy to Debian, Ubuntu or any other Debian-based distribution?
If you answered affirmatively to those two questions, you have probably noticed Debian still ships ACE 5.6.3, which is 18 months old. The reason is twofold:
- ACE is a complex beast. The source tarball generates 59 binary packages for 5.6.3, and that’s only to increase in the latest version (5.7.4).
- The only Debian developer working on ACE, Thomas Girard, is too busy at the moment. He did a great job maintaing ACE for years but now it’s time for others to help him.
Therefore, if you use ACE and Debian directly or indirectly, please step in and help me get the latest ACE in Debian. I’m half done but I’m having trouble with autotools (the autotools build system in ACE seems to need some love, I’m probably moving to the traditional build system) and I do not know where to put some of the new libraries (DAnCE, etc).
NB: The comments in this blog do not work due to a hosting issue, please contact me directly by e-mail:
or subscribe to the pkg-ace-devel mailing list.
PPA: broken on Hardy!
Friday, October 2nd, 2009A couple of weeks ago, I said I would not be backporting the latest versions of Glib2, Gtk+, GStreamer, etc to Hardy.
Today I decided I needed a newer GStreamer on my Hardy machine (where I build and use KDE from trunk almost daily) because I wanted to use libQtGstreamer.
As I expected, this requires major surgery to Hardy. Two prominent components of Hardy, ffmpeg and PulseAudio, require relatively recent versions. I don’t even know if it’s possible to build them due to limitations in Hardy’s kernel V4L2 support. In addition to that, I’m leaving on holidays to London and I won’t be able to work on this until next Wednesday.
Summary: IF YOU USE MY PPA AT THIS MOMENT, IT WILL BREAK YOUR HARDY INSTALLATION! BE VERY CAREFUL IF YOU RUN APTITUDE FULL-UPGRADE! I don’t like having the PPA broken for so long but I have to wake up in 4 hours and I really need to get some sleep.
PPA: CMake 2.8.0 RC1 available
Saturday, September 26th, 2009Bill Hoffman announced yesterday that CMake 2.8.0 RC1 is available from Kitware’s site.
As I love CMake, and you should too, CMake 2.8.0 RC1 packages are now available from my PPA for Ubuntu Hardy and Jaunty.
PPA: people actually use it!
Saturday, September 26th, 2009E-mail arrived a couple of days ago from Will E. from School District #33 in British Columbia, Canada:
Also thank you for all of the work you have put into your package archive. (we use your archive here in our school district on almost 1000 Kubuntu workstations and servers)
Wow, thank you! These e-mails are really motivational and encouraging!
PPA: Samba 3.4.1
Thursday, September 24th, 2009If you were affected by the winbind issues in Samba 3.4.0, you’ll be happy to know Samba 3.4.1 is available for Hardy and Jaunty from my PPA.
PPA: NetSurf
Wednesday, September 23rd, 2009Yesterday I learned Drobe, THE site for Risc OS and Acorn news was closing as its news service, thus remaining in archive-only mode. I have never used Risc OS or an Acorn and there is none in my classic computers collection but it is still sad news.
But I digress.
I cannot remember how but somehow, via Drobe, I discovered Risc OS had an Internet browser called NetSurf and it was available for Linux now. I backported the latest version (2.1) for Hardy and Jaunty.
Rendering-wise, it’s not too good. Plugins did not work for me and I’d say JavaScript is not working either. But there are some interesting points: NetSurf has its own rendering engine, split in several libraries:
- Hubbub, an HTML5 parsing library
- Instead of using libungif/libgif like everybody else does, they have their own GIF library (libnsgif)
- TinySVG library (libsvgtiny)
- BMP library (libnsbmp)
- CSS library (libCSS)
- DOM library (libDOM)
- and more
Everything is MIT licensed.
Summary: NetSurf 2.1, libnsgif, libnsbmp, libparserutils and libhubbub are now available for Hardy and Jaunty from my PPA
PPA: git, mldonkey
Thursday, September 17th, 2009PPA rsync, Subversion (by request)
Wednesday, September 16th, 2009Peter B., a happy user of my PPA, asked for Subversion >= 1.6.3 (it fixes a nasty bug) and told me he started using my packages because he needed a newer rsync on Hardy. Well Pieter, you got it: Subversion 1.6.5 and rsync 3.0.6 are now available for Hardy and Jaunty.
