diff options
Diffstat (limited to 'gcc/testsuite/lib/objc.exp')
-rw-r--r-- | gcc/testsuite/lib/objc.exp | 49 |
1 files changed, 33 insertions, 16 deletions
diff --git a/gcc/testsuite/lib/objc.exp b/gcc/testsuite/lib/objc.exp index 7bd03cacf82..a1431a116ec 100644 --- a/gcc/testsuite/lib/objc.exp +++ b/gcc/testsuite/lib/objc.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1992, 1993, 1994, 1996, 1997, 2000, 2001 +# Copyright (C) 1992, 1993, 1994, 1996, 1997, 2000, 2001, 2002 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -85,12 +85,14 @@ proc objc_version { } { set objc_initialized 0 proc objc_init { args } { + global rootme global tmpdir global libdir global gluefile wrap_flags global objc_initialized global OBJC_UNDER_TEST global TOOL_EXECUTABLE + global objc_libgcc_s_path if { $objc_initialized == 1 } { return; } @@ -115,6 +117,22 @@ proc objc_init { args } { unset gluefile } } + + set objc_libgcc_s_path "${rootme}" + set compiler [lindex $OBJC_UNDER_TEST 0] + if { [is_remote host] == 0 && [which $compiler] != 0 } { + foreach i "[exec $compiler --print-multi-lib]" { + set mldir "" + regexp -- "\[a-z0-9=/\.-\]*;" $i mldir + set mldir [string trimright $mldir "\;@"] + if { "$mldir" == "." } { + continue + } + if { [llength [glob -nocomplain ${rootme}/${mldir}/libgcc_s*.so.*]] == 1 } { + append objc_libgcc_s_path ":${rootme}/${mldir}" + } + } + } } proc objc_target_compile { source dest type options } { @@ -124,8 +142,9 @@ proc objc_target_compile { source dest type options } { global OBJC_UNDER_TEST global TOOL_OPTIONS global ld_library_path + global objc_libgcc_s_path - set ld_library_path ".:${rootme}" + set ld_library_path ".:${objc_libgcc_s_path}" lappend options "libs=-lobjc" if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } { @@ -157,6 +176,18 @@ proc objc_target_compile { source dest type options } { append ld_library_path ":${libobjc_dir}" } lappend options "compiler=$OBJC_UNDER_TEST" + + # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but + # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH + # (for the 64-bit ABI). The right way to do this would be to modify + # unix.exp -- but that's not an option since it's part of DejaGNU + # proper, so we do it here. We really only need to do + # this on IRIX, but it shouldn't hurt to do it anywhere else. + setenv LD_LIBRARY_PATH $ld_library_path + setenv SHLIB_PATH $ld_library_path + setenv LD_LIBRARYN32_PATH $ld_library_path + setenv LD_LIBRARY64_PATH $ld_library_path + return [target_compile $source $dest $type $options] } @@ -241,20 +272,6 @@ if { [info procs prune_warnings] == "" } then { } } -# On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but -# called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH -# (for the 64-bit ABI). The right way to do this would be to modify -# unix.exp -- but that's not an option since it's part of DejaGNU -# proper, so we do it here, by trickery. We really only need to do -# this on IRIX, but it shouldn't hurt to do it anywhere else. - -proc ${tool}_set_ld_library_path { name element op } { - setenv LD_LIBRARYN32_PATH [getenv LD_LIBRARY_PATH] - setenv LD_LIBRARY64_PATH [getenv LD_LIBRARY_PATH] -} - -trace variable env(LD_LIBRARY_PATH) w ${tool}_set_ld_library_path - # Utility used by mike-gcc.exp and c-torture.exp. # Check the compiler(/assembler/linker) output for text indicating that # the testcase should be marked as "unsupported". |