ideas about threading lib switching

Simon 'corecode' Schubert corecode at fs.ei.tum.de
Wed Apr 11 13:22:26 PDT 2007


Steve O'Hara-Smith wrote:
However, I don't know how we can do this.  Does anybody have input,
ideas?  One way would be to use rtld/libmap, like in FreeBSD, but I don't
100% like this approach.  I'd like to find something more elegant.  But
I'm kind of stuck here, maybe somebody has some ideas to contribute?
	The thought that comes immediately to mind is that variant symlinks
may be of help here.
varsyms do not necessarily help here, because at link time the soname might be stored in the binary, which means that the varsym is not being used at runtime.  We would need some way to have a proxy lib at link time, but a varsym at runtime.

AH! (bulb lights up)

how about:

libpthread.so
	proxy lib.  ONLY used for linking, not for runtime usage.
	has set its soname to "librealpthread.so.0"
librealpthread.so.0
	is a varsym link to either one of the threading libs.
-pthread would translate to -lpthread.  however, libpthread.so has set a soname, so that this soname will be used by the rtld.  this means that all binaries in general obey the ABI (defined functions) defined by libpthread.so, however they will use the lib pointed to by librealpthread.so.0, which then can be libc_r.so.5 or libthread_xu.so.1.

makes sense?

cheers
 simon
--
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \
Attachment:
signature.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00007.pgp
Type: application/octet-stream
Size: 252 bytes
Desc: "Description: OpenPGP digital signature"
URL: <http://lists.dragonflybsd.org/pipermail/kernel/attachments/20070411/ce65ccdb/attachment-0020.obj>


More information about the Kernel mailing list