This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Re: regression tests and shared libraries


On Jun  5, 1999, Alexandre Oliva <oliva@dcc.unicamp.br> wrote:

> On Jun  3, 1999, Marc Dionne <dionne@cs.wisc.edu> 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 http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
{oliva,Alexandre.Oliva}@dcc.unicamp.br  aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists
	* libgloss.exp: Allow site.exp to specify an initial ld_library_path.

--- share/dejagnu/libgloss.exp~	Sun Jun  6 21:41:33 1999
+++ share/dejagnu/libgloss.exp	Sun Jun  6 21:41:35 1999
@@ -234,7 +234,13 @@
     set gccpath [get_multilibs];
     set libio_dir ""
     set flags ""
-    set ld_library_path "."
+
+    # ld_library_path may be set in site.exp
+    if { $ld_library_path != "" } {
+      set ld_library_path "$ld_library_path:."
+    } else {
+      set ld_library_path "."
+    }
 
     if { $gccpath != "" } {
 	if [file exists "${gccpath}/lib/libstdc++.a"] {

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