This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: librt and libpthread in alternate prefix


On Thu, 14 May 2009 20:00:36 -0400
Poor Yorick <org.sourceware.libchelp@pooryorick.com> wrote:

> Mike Frysinger wrote:
>  > On Tuesday 12 May 2009 10:15:16 Poor Yorick wrote:
>  >> Mike Frysinger wrote:
>  >>  > On Monday 11 May 2009 23:34:16 Poor Yorick wrote:
>  >>  >> Because my goal is to build a software collection in an alternate
>  >>  >> library path which uses its own glibc, I'm trying to get the new loader
>  >>  >> to work from the alternate location without setting --library-path.
>  >>  >
>  >>  > so use a wrapper script that builds paths using $0
>  >>
>  >> That's a kludge that doesn't work well, since wrapper scripts aren't
>  >> suitable for the #! line.
>  >
>  > i dont really know what you're talking about here.  #!/bin/sh works just fine.
> 
> I mean that I can't wrap binaries compiled against the alternate glibc in a
> script that calls the real binary using the new loader.  For example, if I wrap
> awk in a script called awk_new, I can't do this:
> 
> 	!# /path/to/alternate/awk_new
> 
> because the !# mechanism requires a binary, not a script.

False, you *can* call a script from the #! line.

I suspected your permission denied error is something else, and recalling that I once got permission denied errors under very wierd, non-obvious circumstances, I eventially remembered it can be caused by a peculiar dynamic-linking problem. :)

/lib/ld.so (actually /lib/ld-<version>.so) handles most of the dynamic linking in a system, but importantly it itself is a dynamically-linked library. It can't load itself, so what happens? It's loaded by a much more primitive kernel-based mechanism. When things go wrong the only error this primitive mechanism can give is permission denied! 

I guess that whatever the binary is that finally ends up executing your wrapper scripts, it's somehow finding the wrong ld.so.

-- 
Ethan Grammatikidis
The lyf so short, the craft so long to lerne. -- Chaucer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]