diff options
Diffstat (limited to 'gcc/testsuite/lib/gcc-defs.exp')
-rw-r--r-- | gcc/testsuite/lib/gcc-defs.exp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/lib/gcc-defs.exp b/gcc/testsuite/lib/gcc-defs.exp index 0a5d6a38d0d..53926a69a23 100644 --- a/gcc/testsuite/lib/gcc-defs.exp +++ b/gcc/testsuite/lib/gcc-defs.exp @@ -233,3 +233,35 @@ proc dg-additional-files-options { options source } { return $options } + +# Return a colon-separate list of directories to search for libraries +# for COMPILER, including multilib directories. + +proc gcc-set-multilib-library-path { compiler } { + global rootme + + # ??? rootme will not be set when testing an installed compiler. + # In that case, we should perhaps use some other method to find + # libraries. + if {![info exists rootme]} { + return "" + } + + set libpath ":${rootme}" + set compiler [lindex $compiler 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 libpath ":${rootme}/${mldir}" + } + } + } + + return $libpath +} |