mock issues on ia64 with LoadLibrary("libc.so.6")

Michael E Brown Michael_E_Brown at dell.com
Mon Dec 31 19:19:50 UTC 2007


On Sat, Dec 22, 2007 at 03:47:10PM -0600, Clark Williams wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Doug Chapman wrote:
> > On Thu, 2007-12-20 at 01:19 -0800, Roland McGrath wrote:
> >> What mock is doing there is a little freaky.  Since the functions you want
> >> are in libc and you know it's always going to be there, you don't really
> >> need to ask for the right libc object by name.  
> >> You can use dlsym (RTLD_DEFAULT, "function") to look up the functions in
> >> the global scope that the python executable uses, which gets to libc.
> >>
> >> The python code doesn't seem to have a way to use RTLD_DEFAULT.
> >> But, when you do:
> >>
> >> 	_libc = ctypes.cdll.LoadLibrary(None)
> >>
> >> That translates to dlopen (NULL, ...), which in fact works the same as
> >> dlopen ("", ...), i.e. opens the executable itself (python).  Since libc is
> >> a dependency of the executable, its symbols are found by dlsym on the
> >> handle from dlopen (NULL, ...).
> >>
> >> In short, to the extent this whole kludge of the python code knowing the
> >> ABI details of some libc symbols is sane at all, it's probably fine enough
> >> to use "_libc = ctypes.cdll.LoadLibrary(None)" and be "portable".
> >>
> > 
> > Roland,
> > 
> > Thanks for the tip.  I have verified this does indeed do the trick.
> > 
> > Could one of the mock maintainers make the fix?  Patch is below.
> > 
> 
> Both Michael and I are in and out due to Christmas holidays, but I'll try and get
> this (and the other patches) into a build by Monday.

I didnt see this pushed to the git repo, so I just pushed it. This is
now in upstream git and will make it into the next fedora push. I dont
have solid plans for another fedora push yet, unless Clark wants to do
one.

Thanks for the patch.
--
Michael




More information about the Fedora-buildsys-list mailing list