regression tests and shared libraries

Alexandre Oliva
Wed Jun 30 15:43:00 GMT 1999

On Jun  5, 1999, Alexandre Oliva <> wrote:

> On Jun  3, 1999, Marc Dionne <> wrote:
>> - Execution failures due to not finding the shared libraries at runtime
>> (as above).  Happens with both compilers.

> dejagnu must be fixed to obey whatever LD_LIBRARY_PATH the user
> specifies.  It might prepend whatever it thinks that should be
> there, but it should not just discard what the user specifies.  I
> remember having asked for help about how to do it in tcl/expect last
> time we went through this, but nobody told me what is the equivalent
> of `getenv', and I couldn't figure it out by myself :-(

This time I got more help!  In addition to Mark Mitchell, that replied
to the list, Robert Lipe and Michael Chamberlain wrote to me in
private.  So I came up with the attached patch for dejagnu (I thought
it had been sourceware'd, but I couldn't find a link to it in the
sourceware projects page, so I'm not posting the patch to the
appropriate mailing list; I hope it makes it to the dejagnu
maintainers, anyway)

Anyway, I ended up thinking it was not a good idea to use
LD_LIBRARY_PATH and SHLIB_PATH, as set by the user, because it could
lead the user to inadvertently link with the wrong library at
run-time.  Furthermore, unix.exp would unsetenv those variables before
running the compiler, and set them again before running the compiled
program, so, if we were to preserve their values, we'd have to save
them and restoring them, which is more than I'd like to do this time.

So, the attached patch should arrange that, if ld_library_path is set
in site.exp, its value will be used, not be simply discarded.

There's still a problem for those that configure with version-specific
libraries, since `[file exists "${gccpath}/lib/libstdc++.a"]' won't
find them, and there's no code to look for them in the
version-specific diretory.  But again, because I'm a tcl illiterate
and I don't have much time to pursue this issue, I can't figure out
how to find out the name of the version-specific directory at that
point of libgloss.exp.  Any tips?

Alexandre Oliva IC-Unicamp, Bra[sz]il
{oliva,Alexandre.Oliva}  aoliva@{,}
*** E-mail about software projects will be forwarded to mailing lists

More information about the Gcc mailing list