|
|
|
@ -18,7 +18,7 @@ |
|
|
|
# Please email any bugs, comments, and/or additions to this file to: |
|
|
|
# bug-dejagnu@prep.ai.mit.edu |
|
|
|
|
|
|
|
# This file was written by Rob Savoye. (rob@cygnus.com) |
|
|
|
# This file was written by Rob Savoye. (rob@cygnus.com) (now rob@welcomehome.org) |
|
|
|
|
|
|
|
# this contains a list of gcc options and their respective directories. |
|
|
|
|
|
|
|
@ -424,14 +424,50 @@ proc get_multilibs { args } { |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
set mopts "" |
|
|
|
if { [llength $args] > 0 } { |
|
|
|
set mopts [lindex $args 0]; |
|
|
|
|
|
|
|
regexp "/.* " $compiler compiler |
|
|
|
set compiler [string trimright $compiler " "] |
|
|
|
verbose "compiler is $compiler" |
|
|
|
|
|
|
|
if { [which $compiler] == 0 } { |
|
|
|
return ""; |
|
|
|
} |
|
|
|
|
|
|
|
if { [board_info $target_board exists multilib_flags] } { |
|
|
|
set mopts [board_info $target_board multilib_flags]; |
|
|
|
} else { |
|
|
|
if { [board_info $target_board exists multilib_flags] } { |
|
|
|
set mopts [board_info $target_board multilib_flags]; |
|
|
|
} else { |
|
|
|
set mopts "" |
|
|
|
set mopts "" |
|
|
|
} |
|
|
|
|
|
|
|
set default_multilib [exec $compiler --print-multi-lib] |
|
|
|
set default_multilib [lindex $default_multilib 0]; |
|
|
|
set extra [string trimleft $default_multilib ".;@@"] |
|
|
|
|
|
|
|
# extract the options and their directory names as know by gcc |
|
|
|
foreach i "[exec $compiler --print-multi-lib]" { |
|
|
|
if {$extra != ""} { |
|
|
|
# string trimright would do the wrong thing if we included |
|
|
|
# the leading @@ in $extra |
|
|
|
set i [string trimright $i $extra] |
|
|
|
set i [string trimright $i "@@"] |
|
|
|
} |
|
|
|
set opts "" |
|
|
|
set dir "" |
|
|
|
regexp -- "\[a-z0-9=/\.-\]*;" $i dir |
|
|
|
set dir [string trimright $dir "\;@"] |
|
|
|
regexp -- "\;@*\[\@a-zA-Z0-9=/\.-\]*" $i opts |
|
|
|
set opts [split [string trimleft $opts "\;@@"] "@@"] |
|
|
|
lappend multilibs "$dir {$opts }" |
|
|
|
|
|
|
|
# If args contains arguments don't use the first one as |
|
|
|
# multilib option unless it qualifies as a multilib option. |
|
|
|
if { [llength $args] > 0 } { |
|
|
|
set override_opt [lindex $args 0] |
|
|
|
foreach j $opts { |
|
|
|
if {$j == $override_opt} { |
|
|
|
set mopts $override_opt |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -444,14 +480,6 @@ proc get_multilibs { args } { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
regexp "/.* " $compiler compiler |
|
|
|
set compiler [string trimright $compiler " "] |
|
|
|
verbose "compiler is $compiler" |
|
|
|
|
|
|
|
if { [which $compiler] == 0 } { |
|
|
|
return ""; |
|
|
|
} |
|
|
|
|
|
|
|
if ![info exists comp_base_dir] { |
|
|
|
set comp_base_dir [file dirname [file dirname [file dirname [file dirname [file dirname [exec $compiler --print-prog-name=cc1]]]]]]; |
|
|
|
} |
|
|
|
@ -480,28 +508,6 @@ proc get_multilibs { args } { |
|
|
|
return "$multitop/$gccpath"; |
|
|
|
} |
|
|
|
|
|
|
|
# set output [exec $objdump_name --file-headers objfmtst.o ] |
|
|
|
set default_multilib [exec $compiler --print-multi-lib] |
|
|
|
set default_multilib [lindex $default_multilib 0]; |
|
|
|
set extra [string trimleft $default_multilib ".;@@"] |
|
|
|
|
|
|
|
# extract the options and their directory names as know by gcc |
|
|
|
foreach i "[exec $compiler --print-multi-lib]" { |
|
|
|
if {$extra != ""} { |
|
|
|
# string trimright would do the wrong thing if we included |
|
|
|
# the leading @@ in $extra |
|
|
|
set i [string trimright $i $extra"] |
|
|
|
set i [string trimright $i "@@"] |
|
|
|
} |
|
|
|
set opts "" |
|
|
|
set dir "" |
|
|
|
regexp -- "\[a-z0-9=/\.-\]*;" $i dir |
|
|
|
set dir [string trimright $dir "\;@"] |
|
|
|
regexp -- "\;@*\[\@a-zA-Z0-9=/\.-\]*" $i opts |
|
|
|
set opts [split [string trimleft $opts "\;@@"] "@@"] |
|
|
|
lappend multilibs "$dir {$opts }" |
|
|
|
} |
|
|
|
|
|
|
|
# extract the MULTILIB_MATCHES from dumpspecs |
|
|
|
set multimatches "" |
|
|
|
set lines [split [exec $compiler -dumpspecs] "\n"] |
|
|
|
@ -815,6 +821,7 @@ proc find_ld { } { |
|
|
|
|
|
|
|
proc build_wrapper { gluefile } { |
|
|
|
global libdir |
|
|
|
global tool |
|
|
|
|
|
|
|
if [target_info exists wrap_m68k_aout] { |
|
|
|
set flags "additional_flags=-DWRAP_M68K_AOUT"; |
|
|
|
@ -826,14 +833,16 @@ proc build_wrapper { gluefile } { |
|
|
|
set flags ""; |
|
|
|
if [target_info exists is_vxworks] { |
|
|
|
set flags "additional_flags=-DVXWORKS"; |
|
|
|
set result "-Wl,-wrap,exit -Wl,-wrap,main -Wl,-wrap,abort"; |
|
|
|
} else { |
|
|
|
set result "-Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort"; |
|
|
|
} |
|
|
|
set result "-Wl,-wrap,exit -Wl,-wrap,main -Wl,-wrap,abort"; |
|
|
|
} |
|
|
|
if [target_info exists wrap_compile_flags] { |
|
|
|
lappend flags "additional_flags=[target_info wrap_compile_flags]"; |
|
|
|
} |
|
|
|
if { [target_compile ${libdir}/testglue.c ${gluefile} object $flags] == "" } { |
|
|
|
set gluefile [remote_download host ${gluefile} testglue.o]; |
|
|
|
set gluefile [remote_download host ${gluefile} ${tool}_tg.o]; |
|
|
|
return [list $gluefile $result]; |
|
|
|
} else { |
|
|
|
return "" |
|
|
|
|