Re: set env affects host?

gp
2002-11-14T02:56:43Z

Thanks Paul, Daniel.

Knowing how it works (on my part) helps! ;-) The more I think about it, it
seems right that LD_LIBRARY_PATH be used only for loading solibs at runtime
(whether on the host or the target) and that a different env-var/mechanism be
used for the symbol file search path.

I (obviously) could see it the other way, too, but this does make sense, and
has the benefit of being how it actually works... ;-)

Thanks again. I will check thread 633 on this.

Regards,
GP

Daniel Jacobowitz <drow@mvista.com> said:

> On Wed, Nov 13, 2002 at 05:47:56PM -0500, Paul Koning wrote:
> > >>>>> "Graeme" == Graeme Peterson <gp@qnx.com> writes:
> >
> > Graeme> Well, I think I have answered my own question by checking in
> > Graeme> the source. I found a comment in solib.c for solib_open that
> > Graeme> says that solib symbols are found in the inferior's
> > Graeme> LD_LIBRARY_PATH, and never in the host's. So I guess that is
> > Graeme> that. :-)
> >
> > Graeme> Search order:
> > Graeme> * If path is absolute, look in SOLIB_ABSOLUTE_PREFIX.
> > Graeme> * If path is absolute or relative, look for it literally
> > Graeme> (unmodified).
> > Graeme> * Look in SOLIB_SEARCH_PATH.
> > Graeme> * Look in inferior's $PATH.
> > Graeme> * Look in inferior's $LD_LIBRARY_PATH.
> >
> > Graeme> Anyone care to comment on the rationale behind the behavior?
> > Graeme> Clearly it seemed reasonable to me to find the solibs for
> > Graeme> symbols in the host's LD_LIBRARY_PATH, but that is wrong.
> >
> > Looking in the host LD_LIBRARY_PATH, or for that matter using absolute
> > names literally, is likely to be wrong for cross-debugging.
> > Fortunately the literal lookup is not the first thing tried, but as
> > far as I'm concerned it might as well go away entirely if host !=
> > target.
>
> I think that was the consensus the last time this came up: cross
> debuggers should only do some of those. Check the large discussion
> resulting from gdb/633.
>
> Either local/remote or native/cross should control this; someone just
> needs to decide the exact behavior and implement it :)
>
> --
> Daniel Jacobowitz
> MontaVista Software Debian GNU/Linux Developer
>

--