Re: Haskell needs patching
Samuel Thibault, le Thu 30 Apr 2015 12:43:58 +0200, a écrit :
> > $ORIGIN really needs to be supported sooner or later, it is biting us
> > now and then...
> Indeed. Having a quick look at ./elf/dl-origin.c, it seems we could
> just define the LD_ORIGIN_PATH environment variable from the exec
I have implemented that and will probably upload, but only enabled
it when programs are called with an absolute path, which happens to
be enough for ghc. When exec only gets a relative path it could be
dangerous to set a relative path in LD_ORIGIN_PATH, since it'd change
meaning whenever the process chdirs. Perhaps we should just realpath()
the filename in glibc before calling exec? Are relative paths needed
for the shell bits? Another relatively different way to go is to
eventually implement /proc/self/exe, which we want to at some point
anyay. We already have some proposed patch for the self part. For the
exe part we still need the absolute path instead of relative.