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]
Other format: [Raw text]

Re: [RFC] Alternative LD_LIBRARY_PATH


Hi Eric,

> Works fine on SPARC/Solaris, except for libjava: all execution tests now
> fail 
> with:
> 
> set_ld_library_path_env_vars: ld_library_path=.
> Setting LD_LIBRARY_PATH 
> to .:.:.:/opt/build/eric/gcc/gcc:/opt/build/eric/local/lib
> ld.so.1: gij: fatal: libgij.so.0: open failed: No such file or directory
> FAIL: Array_3 execution - gij test
> UNTESTED: Array_3 output - gij test

The enclosed patch should fix the above problem.  I shouldn't have used "."
for the default value for ld_library_path in gcj_invoke and libjava_invoke.

Let me know if this works.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2004-11-24  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* testsuite/lib/libjava.exp (libjava_arguments): Add new global
	variable libjava_ld_library_path.
	(gcj_invoke, libjava_invoke): Use it to set ld_library_path.

Index: testsuite/lib/libjava.exp
===================================================================
RCS file: /cvs/gcc/gcc/libjava/testsuite/lib/libjava.exp,v
retrieving revision 1.63
diff -u -3 -p -r1.63 libjava.exp
--- testsuite/lib/libjava.exp	24 Nov 2004 04:39:40 -0000	1.63
+++ testsuite/lib/libjava.exp	25 Nov 2004 04:31:47 -0000
@@ -323,6 +323,7 @@ proc libjava_arguments {{mode compile}} 
     global tool_root_dir
     global libgcj_jar
     global libjava_libgcc_s_path
+    global libjava_ld_library_path
     global ld_library_path
     global target_triplet
 
@@ -338,7 +339,7 @@ proc libjava_arguments {{mode compile}} 
     # Basically we want to build up a colon separated path list from
     # the value of $libjava.
 
-    set lpath {}
+    set lpath "."
     foreach dir [list $libjava] {
 	foreach item [split $dir " "] {
 	    switch -glob -- $item {
@@ -352,6 +353,7 @@ proc libjava_arguments {{mode compile}} 
     set lpath [concat $lpath $libjava_libgcc_s_path]
     verbose "lpath = $lpath ; libgcc_s_path = $libjava_libgcc_s_path"
     set ld_library_path [join $lpath :]
+    set libjava_ld_library_path "$ld_library_path"
 
     # That's enough to make things work for the normal case.
     # If we wanted to handle an arbitrary value of libjava,
@@ -453,9 +455,10 @@ proc gcj_link {program main files {optio
 # Invoke the program and see what happens.  Return 0 on failure.
 proc gcj_invoke {program expectFile ld_library_additions} {
   global env
+  global libjava_ld_library_path
   global ld_library_path
 
-  set ld_library_path .
+  set ld_library_path "$libjava_ld_library_path"
   if {[llength $ld_library_additions] > 0} {
     append ld_library_path :[join $ld_library_additions :]
   }
@@ -498,9 +501,10 @@ proc gcj_invoke {program expectFile ld_l
 proc libjava_invoke {errname testName optName executable inpfile resultfile
 		      ld_library_additions args} {
     global env
+    global libjava_ld_library_path
     global ld_library_path
 
-    set ld_library_path .
+    set ld_library_path "$libjava_ld_library_path"
     if {[llength $ld_library_additions] > 0} {
 	append ld_library_path :[join $ld_library_additions :]
     }


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