1 # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation
3 load_lib "libgloss.exp"
5 # GCJ_UNDER_TEST is the compiler under test.
9 if ![info exists tmpdir] {
13 # This is like `prune_warnings', but it also prunes away a warning
14 # from the bytecode front end that we don't care about.
15 proc libjava_prune_warnings {text} {
16 set text [prune_warnings $text]
17 set tlist [split $text \n]
18 set len [llength $tlist]
19 for {set i [expr {$len - 1}]} {$i >= 2} {incr i -1} {
20 if {[string match "*unreachable bytecode*" [lindex $tlist $i]]} {
21 # Delete this line, all other unreachable warnings and the previous
22 # two lines containing the method and class.
24 while {[string match "*unreachable bytecode*" [lindex $tlist $j]]} {
28 set tlist [lreplace $tlist $j $i]
32 return [join $tlist \n]
35 # This is like `target_compile' but it does some surgery to work
36 # around stupid DejaGNU bugs. In particular DejaGNU has very poor
37 # quoting, so for instance a `$' will be re-evaluated at spawn time.
39 proc libjava_tcompile {source destfile type options} {
40 # This strange-looking expression really does quote the `$'.
41 regsub -all -- {\$} $source {\$} source
42 regsub -all -- {\$} $destfile {\$} destfile
43 return [target_compile $source $destfile $type $options]
46 # Read an `xfail' file if it exists. Returns a list of xfail tokens.
47 proc libjava_read_xfail {file} {
48 if {! [file exists $file]} {
52 set tokens [string trim [read $fd]]
57 # Find a particular executable. FIXME: this relies on DejaGnu
58 # internals. These should probably be exposed in a better way.
59 proc libjava_find_program {prog} {
62 set file [lookfor_file $tool_root_dir $prog]
64 set file [lookfor_file $tool_root_dir gcc/$prog];
74 return [libjava_find_program jv-scan]
79 return [libjava_find_program gcjh]
83 global SUN_JAVAC GCJ_UNDER_TEST env libgcj_jar
84 # If JDK doesn't run on your platform but some other
85 # JDK-compatible javac does, you may set SUN_JAVAC to point to it.
86 # One of the most important properties of a SUN_JAVAC is that it
87 # must create class-files even for classes that have not been
88 # specified in the command line, but that were needed to compile
89 # those that have. For example, Pizza won't do it, but you can
90 # use `kaffe sun.tools.javac.Main', if you have Sun's classes.zip
91 # in the kaffe's default search path.
92 if {![info exists SUN_JAVAC]} {
93 if {[info exists env(SUN_JAVAC)]} {
94 set SUN_JAVAC $env(SUN_JAVAC)
96 set SUN_JAVAC "$GCJ_UNDER_TEST -C -I$libgcj_jar"
102 proc bytecompile_file { file objdir {classpath {}} } {
104 set dirname [file dirname $file]
106 set javac [find_javac]
107 if {$classpath != ""} then {
108 set env(CLASSPATH) $classpath
113 set q [eval exec "$javac [list $file] -d $objdir 2>@ stdout"]
115 verbose "couldn't compile $file: $msg"
124 set libjava_initialized 0
127 # Build the status wrapper library as needed.
129 proc libjava_init { args } {
131 global wrap_compile_flags;
132 global libjava_initialized libjava_uses_threads
133 global GCJ_UNDER_TEST
134 global TOOL_EXECUTABLE
135 global original_ld_library_path
137 global env libgcj_jar
139 global libjava_libgcc_s_path
141 if { $libjava_initialized == 1 } { return; }
143 if ![info exists GCJ_UNDER_TEST] {
144 if [info exists TOOL_EXECUTABLE] {
145 set GCJ_UNDER_TEST $TOOL_EXECUTABLE;
147 if [info exists env(GCJ)] {
148 set GCJ_UNDER_TEST $env(GCJ)
150 set GCJ_UNDER_TEST "[find_gcj]"
155 # Find the libgcj jar file.
156 set libgcj_jar [glob $objdir/../libgcj-*.jar]
157 verbose "jar file is $libgcj_jar"
159 # FIXME: This finds libgcj.spec for the default multilib.
160 # If thread models differ between multilibs, this has to be moved
161 # to libjava_arguments
162 set specdir [libjava_find_spec]
164 # The -B is so we find libgcj.spec.
165 set text [eval exec "$GCJ_UNDER_TEST -B$specdir -v 2>@ stdout"]
166 regexp -- "Thread model: (\[^\n\]+)\n" $text ignore model
167 set libjava_uses_threads [expr {! ($model == "no"
169 || $model == "single")}]
171 # Always set encoding used by gcj.
172 append GCJ_UNDER_TEST " --encoding=UTF-8"
174 if [info exists env(LD_LIBRARY_PATH)] {
175 set original_ld_library_path $env(LD_LIBRARY_PATH)
177 if [info exists env(SHLIB_PATH)] {
178 set original_ld_library_path $env(SHLIB_PATH)
180 set original_ld_library_path ""
185 set wrap_compile_flags "";
186 if [target_info exists needs_status_wrapper] {
187 set result [build_wrapper "testglue.o"];
188 if { $result != "" } {
189 set wrapper_file [lindex $result 0];
190 set wrap_compile_flags [lindex $result 1];
192 warning "Status wrapper failed to build."
196 # Finally, add the gcc build directory so that we can find the
197 # shared libgcc. This, like much of dejagnu, is hideous.
198 set libjava_libgcc_s_path {}
199 set gccdir [lookfor_file $tool_root_dir gcc/libgcc_s.so]
201 set gccdir [file dirname $gccdir]
202 lappend libjava_libgcc_s_path $gccdir
203 verbose "libjava_libgcc_s_path = $libjava_libgcc_s_path"
204 set compiler ${gccdir}/xgcc
205 if { [is_remote host] == 0 && [which $compiler] != 0 } {
206 foreach i "[exec $compiler --print-multi-lib]" {
208 regexp -- "\[a-z0-9=/\.-\]*;" $i mldir
209 set mldir [string trimright $mldir "\;@"]
210 if { "$mldir" == "." } {
213 if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] == 1 } {
214 lappend libjava_libgcc_s_path "${gccdir}/${mldir}"
220 set libjava_initialized 1
223 # Find a library. We know where libtool puts the actual libraries,
224 # and we look there. The implementation is fairly hacky. We can't
225 # compile with -nodefaultlibs, because that will also eliminate the
226 # system libraries we need. In order to have gcj still work, it must
227 # find the appropriate libraries so we must add -L options for their
228 # paths. However we can't simply use those libraries; we still need
229 # libtool for linking.
230 # Don't return the the lib${name}.la files here, since this causes the
231 # libraries to be linked twice: once as lib${name}.so and another time
232 # via gcj's implicit -l${name}. This is both unnecessary and causes the
233 # Solaris ld to warn: attempted multiple inclusion of file. This warning
234 # is not ignored by the dejagnu framework and cannot be disabled.
235 proc libjava_find_lib {dir name} {
237 set gp [get_multilibs]
238 foreach extension {so dll a} {
239 foreach sub {.libs _libs} {
241 if {[file exists $gp/$dir/$sub/lib${name}.${extension}]} then {
242 # Just return the `-L' option. The library itself
243 # will be picked up via the spec file.
244 return "-L$gp/$dir/$sub"
247 # Just return the `-L' option. The library itself will be
248 # picked up via the spec file.
250 $base_dir/../../$dir/$sub/lib${name}.${extension} \
251 "-L$base_dir/../../$dir/$sub" \
261 # Find libgcj.spec. We need to use the file corresponding to the multilib
262 # under test since they might differ. Append a trailing slash since this
264 proc libjava_find_spec {} {
266 set gp [get_multilibs]
268 if {[file exists $gp/libjava/libgcj.spec]} then {
269 return "$gp/libjava/"
275 proc libjava_find_gij {} {
277 set gp [get_multilibs]
279 set file $gp/libjava/gij
281 set file $base_dir/../gij
284 if {[file exists $file]} {
290 # Remove a bunch of files.
291 proc gcj_cleanup {args} {
293 if {[string match *.o $file]} {
294 verbose "removing [file rootname $file].lo"
295 file delete -force [file rootname $file].lo
297 file delete -force -- $file
298 verbose "removing $file"
300 # It is simplest to do this instead of trying to figure out what
301 # bits in .libs ought to be removed.
302 catch {system "rm -rf .libs"}
305 # Compute arguments needed for compiler. MODE is a libtool mode:
306 # either compile or link.
307 proc libjava_arguments {{mode compile}} {
313 global srcdir subdir objdir
315 global GCJ_UNDER_TEST
321 global libjava_libgcc_s_path
323 if [info exists LIBJAVA] {
324 set libjava $LIBJAVA;
326 set libjava [libjava_find_lib libjava gcj]
329 if [info exists LIBGC] {
332 set libgc [libjava_find_lib boehm-gc gcjgc]
335 if [info exists LIBQTHREADS] {
336 set libqthreads $LIBQTHREADS
338 set libqthreads [libjava_find_lib qthreads gcjcoop]
341 if [info exists LIBZ] {
344 set libz [libjava_find_lib zlib zgcj]
347 verbose "using LIBJAVA = $libjava" 2
348 verbose "using LIBGC = $libgc" 2
349 verbose "using LIBQTHREADS = $libqthreads" 2
350 verbose "using LIBZ = $libz" 2
353 # Basically we want to build up a colon separated path list from
354 # the value of $libjava.
357 foreach dir [list $libjava $libgc $libz] {
358 foreach item [split $dir " "] {
359 switch -glob -- $item {
361 lappend lpath [string range $item 2 end]
367 set lpath [concat $lpath $libjava_libgcc_s_path]
368 verbose "lpath = $lpath ; libgcc_s_path = $libjava_libgcc_s_path"
369 set ld_library_path [join $lpath :]
371 # That's enough to make things work for the normal case.
372 # If we wanted to handle an arbitrary value of libjava,
373 # then we'd have to do a lot more work.
375 # Set variables the dynamic linker looks at.
376 global original_ld_library_path
377 setenv LD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path"
378 setenv SHLIB_PATH "$ld_library_path:$original_ld_library_path"
380 verbose "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)"
382 # Set the CLASSPATH environment variable
383 verbose "CLASSPATH is .:$srcdir/$subdir:$objdir:$libgcj_jar"
385 set env(CLASSPATH) ".:$srcdir/$subdir:$objdir:$libgcj_jar"
387 if {$mode == "link"} {
388 global wrapper_file wrap_compile_flags
389 lappend args "additional_flags=$wrap_compile_flags"
390 lappend args "libs=$wrapper_file"
391 lappend args "libs=$libjava"
395 if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
396 lappend args "libs=${gluefile}"
397 lappend args "ldflags=$wrap_flags"
400 if [info exists TOOL_OPTIONS] {
401 lappend args "additional_flags=$TOOL_OPTIONS"
404 # Determine libgcj.spec corresponding to multilib under test.
405 set specdir [libjava_find_spec]
407 # Search for libtool. We need it to link.
409 set d [absolute $objdir]
410 foreach x {. .. ../.. ../../..} {
411 if {[file exists $d/$x/libtool]} then {
412 # We have to run silently to avoid DejaGNU lossage.
414 "compiler=$d/$x/libtool --silent --tag=GCJ --mode=$mode $GCJ_UNDER_TEST -B$specdir"
419 if {! $found_compiler} {
420 # Append -B$specdir so that we find libgcj.spec before it
422 lappend args "compiler=$GCJ_UNDER_TEST -B$specdir"
425 # Avoid libtool wrapper scripts when possible.
426 # but not if libtool warnings results in FAILs
427 if {$mode == "link"} {
428 if {! [istarget "*-*-cygwin*"] && ! [istarget "*-*-mingw*"] } {
429 lappend args "additional_flags=-no-install"
436 # Link a bunch of objects into a program. MAIN is the name of the
437 # class holding `main'. Return 0 on failure.
438 proc gcj_link {program main files {options {}}} {
439 set arguments [libjava_arguments link]
440 if {[llength $options]} {
441 eval lappend arguments $options
443 lappend arguments "additional_flags=--main=$main"
444 set x [libjava_prune_warnings \
445 [libjava_tcompile $files $program executable $arguments]]
447 verbose "link failure: $x" 2
448 fail "linking $program"
450 fail "running $program"
454 pass "linking $program"
458 # Invoke the program and see what happens. Return 0 on failure.
459 proc gcj_invoke {program expectFile ld_library_additions} {
461 set lib_path $env(LD_LIBRARY_PATH)
464 if {[llength $ld_library_additions] > 0} {
465 append newval :[join $ld_library_additions :]
467 append newval :$lib_path
469 setenv LD_LIBRARY_PATH $newval
470 setenv SHLIB_PATH $newval
472 verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
474 set result [libjava_load ./$program]
475 set status [lindex $result 0]
476 set output [lindex $result 1]
479 setenv LD_LIBRARY_PATH $lib_path
480 setenv SHLIB_PATH $lib_path
482 if {$status != "pass"} {
483 verbose "got $output"
485 untested "$program output"
489 set id [open $expectFile r]
490 set expected [read $id]
493 if {! [string compare $output $expected]} {
494 pass "$program output"
497 fail "$program output"
502 # Invoke a program and check its output. EXECUTABLE is the program;
503 # ARGS are the arguments to the program. Returns 1 if tests passed
504 # (or things were left untested), 0 otherwise.
505 proc libjava_invoke {errname testName optName executable inpfile resultfile args} {
508 if {[info exists opts(no-exec)]} {
509 if {[info exists opts(need-threads)]} {
510 # This means we wanted to try to run it but we couldn't
511 # because threads aren't supported. So we have to
512 # generate an `untested'.
513 untested "$errname execution - $testName"
514 untested "$errname output - $testName"
519 set result [libjava_load $executable $args "$inpfile"]
520 set status [lindex $result 0]
521 set output [lindex $result 1]
522 if {[info exists opts(xfail-exec)]} then {
525 $status "$errname execution - $testName"
526 if { $status != "pass" } {
527 untested "$errname output - $testName"
531 verbose "resultfile is $resultfile"
532 set id [open $resultfile r]
534 append expected [read $id]
535 regsub -all "\r" "$output" "" output
536 regsub "\n*$" $expected "" expected
537 regsub "\n*$" $output "" output
538 regsub "^\n*" $expected "" expected
539 regsub "^\n*" $output "" output
540 regsub -all "\[ \t\]\[ \t\]*" $expected " " expected
541 regsub -all "\[ \t\]*\n\n*" $expected "\n" expected
542 regsub -all "\[ \t\]\[ \t\]*" $output " " output
543 regsub -all "\[ \t\]*\n\n*" $output "\n" output
544 verbose "expected is $expected"
545 verbose "actual is $output"
547 if {[info exists opts(regexp_match)]} {
548 if [regexp $expected $output] {
552 if { $expected == $output } {
556 if {[info exists opts(xfail-output)]} {
559 if { $passed == 1 } {
560 pass "$errname output - $testName"
562 fail "$errname output - $testName"
570 # Run the test specified by srcfile and resultfile. compile_args and
571 # exec_args are options telling this proc how to work.
573 proc test_libjava_from_source { options srcfile compile_args inpfile resultfile exec_args } {
577 global srcdir subdir objdir
579 global GCJ_UNDER_TEST
583 # Make opts into an array.
586 foreach item $exec_args {
590 # If we need threads and we don't have them then set the `no-exec'
591 # flag. This is case is also handled specially later.
592 if {[info exists opts(need-threads)]} {
593 global libjava_uses_threads
594 if {! $libjava_uses_threads} {
599 set errname [file rootname [file tail $srcfile]]
600 if {! [runtest_file_p $runtests $errname]} {
604 if {[info exists opts(no-link)]} {
609 set args [libjava_arguments $mode]
610 if {! [info exists opts(no-link)]} {
611 # Add the --main flag
612 lappend args "additional_flags=--main=[file rootname [file tail $srcfile]]"
613 if { $compile_args != "" } {
614 lappend args "additional_flags=$compile_args"
618 regsub "^.*/(\[^/.\]+)\[.\]\[^/]*$" "$srcfile" "\\1" out
619 set executable "${objdir}/$out"
620 if {[info exists opts(no-link)]} {
621 append executable ".o"
624 # DOS/win32 targets default to .exe if no suffix is given
625 # We then try to delete a file that doesn't exist. It is
626 # simpler to add the suffix everywhere.
627 append executable ".exe"
628 set target executable
630 if { $compile_args != "" } {
631 set errname "$errname $compile_args"
634 set removeList [list $executable]
636 set x [libjava_prune_warnings \
637 [libjava_tcompile $srcfile "$executable" $target $args]]
638 if {[info exists opts(xfail-gcj)]} {
642 verbose "target_compile failed: $x" 2
644 if {[info exists opts(shouldfail)]} {
645 pass "$errname compilation from source"
646 eval gcj_cleanup $removeList
650 fail "$errname compilation from source"
651 if {[info exists opts(xfail-gcj)]
652 || ! [info exists opts(no-exec)]
653 || [info exists opts(need-threads)]} {
654 untested "$errname execution from source compiled test"
655 untested "$errname output from source compiled test"
659 if {[info exists opts(shouldfail)]} {
660 fail "$errname compilation from source"
663 pass "$errname compilation from source"
665 # Set up the options the way they are expected by libjava_invoke.
666 if {[info exists opts(xfail-source-output)]} {
667 set opts(xfail-output) x
669 if {[libjava_invoke $errname "source compiled test" opts $executable \
670 $inpfile $resultfile]} {
671 # Everything ok, so clean up.
672 eval gcj_cleanup $removeList
677 # Run the test specified by srcfile and resultfile. compile_args and
678 # exec_args are options telling this proc how to work.
680 proc test_libjava_from_javac { options srcfile compile_args inpfile resultfile exec_args } {
684 global srcdir subdir objdir
686 global GCJ_UNDER_TEST
691 # Make opts into an array.
694 foreach item $exec_args {
698 # If we need threads and we don't have them then set the `no-exec'
699 # flag. This is case is also handled specially later.
700 if {[info exists opts(need-threads)]} {
701 global libjava_uses_threads
702 if {! $libjava_uses_threads} {
706 set errname [file rootname [file tail $srcfile]]
707 if {! [runtest_file_p $runtests $errname]} {
711 # bytecompile files with Sun's compiler for now.
712 set bc_ok [bytecompile_file $srcfile $objdir]
714 set javac [find_javac]
715 # This is an ugly heuristic but it will have to do.
716 if {[string match *gcj* $javac]} {
721 if {[info exists opts(xfail-$tag)]} {
725 if {[info exists opts(shouldfail)]} {
726 pass "$errname byte compilation"
729 fail "$errname byte compilation"
730 untested "$errname compilation from bytecode"
731 if {! [info exists opts(no-exec)]
732 || [info exists opts(need-threads)]} {
733 untested "$errname execution from bytecode->native test"
734 untested "$errname output from bytecode->native test"
738 if {[info exists opts(shouldfail)]} {
739 fail "$errname byte compilation"
742 pass "$errname byte compilation"
746 # Find name to use for --main, and name of all class files.
747 set jvscan [find_jvscan]
748 verbose "jvscan is $jvscan"
749 set main_name [string trim \
750 [libjava_prune_warnings \
751 [lindex [local_exec "$jvscan --encoding=UTF-8 $srcfile --print-main" "" "" 300] 1]]]
752 verbose "main name is $main_name"
753 set class_out [string trim \
754 [libjava_prune_warnings \
755 [lindex [local_exec "$jvscan --encoding=UTF-8 $srcfile --list-class" "" "" 300] 1]]]
756 verbose "class list is $class_out"
758 if {[string match "*parse error*" $main_name]
759 || [string match "*parse error*" $class_out]} {
760 untested "$errname compilation from bytecode"
761 if {! [info exists opts(no-exec)]
762 || [info exists opts(need-threads)]} {
763 untested "$errname execution from bytecode->native test"
764 untested "$errname output from bytecode->native test"
769 # Turn "a b" into "a.class b.class".
770 # Also, turn "foo.bar" into "foo/bar.class".
772 foreach file [split [string trim $class_out]] {
773 set file [join [split $file .] /]
774 lappend class_files $objdir/$file.class
777 eval lappend removeList $class_files
779 # Usually it is an error for a test program not to have a `main'
780 # method. However, for no-exec tests it is ok. Treat no-link
782 if {[info exists opts(no-link)]} {
787 if {[info exists opts(no-exec)]} {
790 } elseif {$main_name == ""} {
791 perror "No `main' given in program $errname"
795 lappend largs "additional_flags=--main=$main_name"
796 # DOS/win32 targets default to .exe if no suffix is given
797 # We then try to delete a file that doesn't exist. It is
798 # simpler to add the suffix everywhere.
799 set executable "${objdir}/${main_name}.exe"
803 # We purposely ignore errors here; we still want to run the other
805 set gij [libjava_find_gij]
806 # libjava_find_gij will return `gij' if it couldn't find the
807 # program; in this case we want to skip the test.
808 if {$INTERPRETER == "yes" && $gij != "gij"} {
809 libjava_invoke $errname "gij test" opts $gij \
810 $inpfile $resultfile $main_name
814 set args [libjava_arguments $mode]
815 eval lappend args $largs
817 if { $compile_args != "" } {
818 lappend args "additional_flags=$compile_args"
821 if { $compile_args != "" } {
822 set errname "$errname $compile_args"
825 verbose "compilation command = $args" 2
826 # When compiling and not linking, we have to build each .o
827 # separately. We do this because DejaGNU's target_compile won't
828 # accept an empty "destfile" argument when the mode is "compile".
829 if {$mode == "compile"} {
830 foreach c_file $class_files {
831 set executable [file rootname [file tail $c_file]].o
832 # Don't write files which contain $ chars.
833 regsub -all "\\$" $executable "\^" executable
834 set x [libjava_prune_warnings \
835 [libjava_tcompile '$c_file' "$executable" $type $args]]
836 lappend removeList $executable
842 # This is so evil: we de-listify CLASS_FILES so that we can
843 # turn around and quote the `$' in it for the shell. I really
844 # hate DejaGNU. It is so !@#$!@# unpredictable.
846 foreach stupid $class_files {
847 set hack "$hack $stupid"
849 lappend removeList $executable
850 set x [libjava_prune_warnings \
851 [libjava_tcompile $hack "$executable" $type $args]]
853 if {[info exists opts(xfail-byte)]} {
857 verbose "target_compile failed: $x" 2
858 fail "$errname compilation from bytecode"
859 if {! [info exists opts(no-exec)]
860 || [info exists opts(need-threads)]} {
861 untested "$errname execution from bytecode->native test"
862 untested "$errname output from bytecode->native test"
866 pass "$errname compilation from bytecode"
868 # Set up the options the way they are expected by libjava_invoke.
869 if {[info exists opts(xfail-byte-output)]} {
870 set opts(xfail-output) x
872 if {[libjava_invoke $errname "bytecode->native test" opts $executable \
873 $inpfile $resultfile]} {
874 # Everything ok, so clean up.
875 eval gcj_cleanup $removeList
880 # Run the test specified by srcfile and resultfile. compile_args and
881 # exec_args are options telling this proc how to work.
882 # `no-link' don't try to link the program
883 # `no-exec' don't try to run the test
884 # `xfail-gcj' compilation from source will fail
885 # `xfail-javac' compilation with javac will fail
886 # `xfail-gcjC' compilation with gcj -C will fail
887 # `shouldfail' compilation from source is supposed to fail
888 # This is different from xfail, which marks a known
889 # failure that we just haven't fixed.
890 # A compilation marked this way should fail with any
892 # `xfail-byte' compilation from bytecode will fail
893 # `xfail-exec' exec will fail
895 # output will be wrong
896 # `xfail-byte-output'
897 # output will be wrong when compiled from bytecode
898 # `xfail-source-output'
899 # output will be wrong when compiled from source code
901 # test relies on thread support
903 proc test_libjava { options srcfile compile_args inpfile resultfile exec_args } {
904 test_libjava_from_source $options $srcfile $compile_args $inpfile $resultfile $exec_args
905 test_libjava_from_javac $options $srcfile $compile_args $inpfile $resultfile $exec_args
909 # libjava_version -- extract and print the version number of libjavap
911 proc default_libjava_version {} {
914 proc default_libjava_start { } {
917 # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
918 # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
919 # (for the 64-bit ABI). The right way to do this would be to modify
920 # unix.exp -- but that's not an option since it's part of DejaGNU
921 # proper, so we do it here, by trickery. We really only need to do
922 # this on IRIX, but it shouldn't hurt to do it anywhere else.
924 proc ${tool}_set_ld_library_path { name element op } {
925 setenv LD_LIBRARYN32_PATH [getenv LD_LIBRARY_PATH]
926 setenv LD_LIBRARY64_PATH [getenv LD_LIBRARY_PATH]
929 trace variable env(LD_LIBRARY_PATH) w ${tool}_set_ld_library_path