|
|
|
@ -41,73 +41,73 @@ load_generic_config "sim" |
|
|
|
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 :] |
|
|
|
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]" |
|
|
|
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" |
|
|
|
global board |
|
|
|
set compiler "[board_info $board compiler]" |
|
|
|
set mflags "[board_info $board multilib_flags]" |
|
|
|
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 libgomp.so} { |
|
|
|
set result [remote_exec host "$compiler $mflags --print-file-name=$i"] |
|
|
|
set output [lindex $result 1] |
|
|
|
set rpathdir [file dirname $output] |
|
|
|
# If testing an installed compiler, --print-file-name will find the |
|
|
|
# libraries, if testing a built but not installed compiler it will not |
|
|
|
# find libraries like libstdc++.so or libgfortran.so so we add the |
|
|
|
# extra hack/search so it can work. |
|
|
|
if [string match "." $rpathdir] { |
|
|
|
if [string match $i "libstdc++.so"] { |
|
|
|
if [file exists "$gccpath/libstdc++-v3/src/.libs/libstdc++.so"] { |
|
|
|
set rpathflags "$rpathflags -Wl,-rpath=$gccpath/libstdc++-v3/src/.libs" |
|
|
|
} |
|
|
|
} |
|
|
|
if [string match $i "libgfortran.so"] { |
|
|
|
if [file exists "$gccpath/libgfortran/.libs/libgfortran.so"] { |
|
|
|
set rpathflags "$rpathflags -Wl,-rpath=$gccpath/libgfortran/.libs" |
|
|
|
} |
|
|
|
} |
|
|
|
if [string match $i "libatomic.so"] { |
|
|
|
if [file exists "$gccpath/libatomic/.libs/libatomic.so"] { |
|
|
|
set rpathflags "$rpathflags -Wl,-rpath=$gccpath/libatomic/.libs" |
|
|
|
} |
|
|
|
} |
|
|
|
if [string match $i "libgomp.so"] { |
|
|
|
if [file exists "$gccpath/libgomp/.libs/libgomp.so"] { |
|
|
|
set rpathflags "$rpathflags -Wl,-rpath=$gccpath/libgomp/.libs" |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
set rpathflags "$rpathflags -Wl,-rpath=$rpathdir" |
|
|
|
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 libgomp.so} { |
|
|
|
set result [remote_exec host "$compiler $mflags --print-file-name=$i"] |
|
|
|
set output [lindex $result 1] |
|
|
|
set rpathdir [file dirname $output] |
|
|
|
# If testing an installed compiler, --print-file-name will find the |
|
|
|
# libraries, if testing a built but not installed compiler it will not |
|
|
|
# find libraries like libstdc++.so or libgfortran.so so we add the |
|
|
|
# extra hack/search so it can work. |
|
|
|
if [string match "." $rpathdir] { |
|
|
|
if [string match $i "libstdc++.so"] { |
|
|
|
if [file exists "$gccpath/libstdc++-v3/src/.libs/libstdc++.so"] { |
|
|
|
set rpathflags "$rpathflags -Wl,-rpath=$gccpath/libstdc++-v3/src/.libs" |
|
|
|
} |
|
|
|
} |
|
|
|
if [string match $i "libgfortran.so"] { |
|
|
|
if [file exists "$gccpath/libgfortran/.libs/libgfortran.so"] { |
|
|
|
set rpathflags "$rpathflags -Wl,-rpath=$gccpath/libgfortran/.libs" |
|
|
|
} |
|
|
|
} |
|
|
|
if [string match $i "libatomic.so"] { |
|
|
|
if [file exists "$gccpath/libatomic/.libs/libatomic.so"] { |
|
|
|
set rpathflags "$rpathflags -Wl,-rpath=$gccpath/libatomic/.libs" |
|
|
|
} |
|
|
|
} |
|
|
|
if [string match $i "libgomp.so"] { |
|
|
|
if [file exists "$gccpath/libgomp/.libs/libgomp.so"] { |
|
|
|
set rpathflags "$rpathflags -Wl,-rpath=$gccpath/libgomp/.libs" |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
set rpathflags "$rpathflags -Wl,-rpath=$rpathdir" |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
foreach i [get_library_dirlist] { |
|
|
|
set rpathflags "$rpathflags -Wl,-rpath=$i" |
|
|
|
} |
|
|
|
verbose "rpath_flags: $rpathflags" |
|
|
|
return $rpathflags |
|
|
|
foreach i [get_library_dirlist] { |
|
|
|
set rpathflags "$rpathflags -Wl,-rpath=$i" |
|
|
|
} |
|
|
|
verbose "rpath_flags: $rpathflags" |
|
|
|
return $rpathflags |
|
|
|
} |
|
|
|
|
|
|
|
# The TCL SIM variable takes precedence over the DEJAGNU_SIM env. variable |
|
|
|
@ -152,6 +152,6 @@ if {[info exists env(DEJAGNU_SIM_OPTIONS)]} { |
|
|
|
|
|
|
|
if {[info exists env(DEJAGNU_SIM_BOARD_INFO)]} { |
|
|
|
foreach e $env(DEJAGNU_SIM_BOARD_INFO) { |
|
|
|
set_board_info [lindex $e 0] [lindex $e 1] |
|
|
|
} |
|
|
|
set_board_info [lindex $e 0] [lindex $e 1] |
|
|
|
} |
|
|
|
} |
|
|
|
|