summaryrefslogtreecommitdiff
path: root/baseboards
diff options
context:
space:
mode:
authorSteve Ellcey <sellcey@imgtec.com>2015-05-14 16:29:00 +1000
committerBen Elliston <bje@gnu.org>2015-05-14 16:29:00 +1000
commit4b6f509bece0562402731d80cba96cfd7411744e (patch)
tree274800e4805280872cee0632ee975de8392d4a55 /baseboards
parentdca68a01f903ff2e1eaa9ef0d6e19d3bbcf68876 (diff)
downloaddejagnu-4b6f509bece0562402731d80cba96cfd7411744e.tar.gz
dejagnu-4b6f509bece0562402731d80cba96cfd7411744e.tar.bz2
dejagnu-4b6f509bece0562402731d80cba96cfd7411744e.zip
* baseboards/multi-sim.exp (get_library_dirlist): New.
(dynamic_linker_flag): Use get_library_dirlist to find dynamic linker. (rpath_flags): Use get_library_dirlist to set rpath. Signed-off-by: Ben Elliston <bje@gnu.org>
Diffstat (limited to 'baseboards')
-rw-r--r--baseboards/multi-sim.exp27
1 files changed, 21 insertions, 6 deletions
diff --git a/baseboards/multi-sim.exp b/baseboards/multi-sim.exp
index c588fd7..0f33242 100644
--- a/baseboards/multi-sim.exp
+++ b/baseboards/multi-sim.exp
@@ -40,25 +40,37 @@ load_generic_config "sim"
# basic-sim.exp is a basic description for the standard Cygnus simulator.
load_base_board_description "basic-sim"
+proc get_library_dirlist { args } {
+ global board
+ set compiler "[board_info $board compiler]"
+ set mflags "[board_info $board multilib_flags]"
+ set result [remote_exec host "$compiler $mflags --print-search-dirs"]
+ set regresult [regexp {(libraries: =)(\S*)} $result dummy1 dummy2 libdirlist]
+ if {$regresult == 0} {
+ perror "Could not find compilers library search path."
+ }
+ return [split $libdirlist :]
+}
+
proc dynamic_linker_flag { args } {
global board
set compiler "[board_info $board compiler]"
set mflags "[board_info $board multilib_flags]"
- set result [remote_exec host "$compiler $mflags --print-sysroot"]
- set output [lindex $result 1]
- set toutput [string trimright $output]
- set dynlinkerdir "$toutput/usr/lib"
- set dynlinker [glob -directory $dynlinkerdir ld-*.so]
+ foreach i [get_library_dirlist] {
+ set dynlinker [glob -nocomplain -directory $i ld-*.so]
+ if { $dynlinker != "" } break
+ }
verbose "dynamic_linker_flag: -Wl,--dynamic-linker=$dynlinker"
return "-Wl,--dynamic-linker=$dynlinker"
}
+
proc rpath_flags { args } {
global board
set compiler "[board_info $board compiler]"
set mflags "[board_info $board multilib_flags] [libgloss_include_flags] [newlib_include_flags] [libgloss_link_flags] [libgloss_link_flags]"
set rpathflags ""
set gccpath [get_multilibs]
- foreach i {libgcc_s.so libstdc++.so libgfortran.so libatomic.so libc.so} {
+ foreach i {libgcc_s.so libstdc++.so libgfortran.so libatomic.so} {
set result [remote_exec host "$compiler $mflags --print-file-name=$i"]
set output [lindex $result 1]
set rpathdir [file dirname $output]
@@ -86,6 +98,9 @@ proc rpath_flags { args } {
set rpathflags "$rpathflags -Wl,-rpath=$rpathdir"
}
}
+ foreach i [get_library_dirlist] {
+ set rpathflags "$rpathflags -Wl,-rpath=$i"
+ }
verbose "rpath_flags: $rpathflags"
return $rpathflags
}