On Friday December 4, 2009, Duncan Coutts wrote:

> Right, but if we can resolve -lpcre to libpcre.so.0 then we can
>  dlopen libpcre.so.0 without having to parse linker scripts.

There is some code in dlopen that does this (sort of). I haven't studied 
it carefully yet. However, it basically uses ld.so's apparatus.

To give you an example, I ran the following command on my system and got 
the results below:

hbg-srv3 ~ # ldconfig -p | grep libpcre.so
        libpcre.so.0 (libc6,x86-64) => /lib/libpcre.so.0
        libpcre.so.0 (libc6,x86-64) => /usr/lib/libpcre.so.0
        libpcre.so.0 (libc6) => /usr/lib32/libpcre.so.0
        libpcre.so (libc6) => /usr/lib32/libpcre.so

It seems to me that we can pick the "latest" version for the right 
platform as the proper one to load. I'm not sure I can define "latest" 
at this point. Also, I'm not sure it will give the same answer as 
parsing the linker script. I will look into this some more and report my 
findings.

This approach may only work on GNU/Linux systems, but that's probably 
sufficient. I don't know if this issue is relevant on other platforms.

Howard

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to