Browse Source

2002-10-21 Adam Nemet <anemet@lnxw.com>

* libgloss.exp (get_multilibs): Don't use the first argument
        passed to this function as the multilib option unless it is in
        fact a multilib option.
dejagnu-1.4
Rob Savoye 24 years ago
parent
commit
b32796502b
  1. 5
      ChangeLog
  2. 89
      lib/libgloss.exp

5
ChangeLog

@ -1,3 +1,8 @@
2002-10-21 Adam Nemet <anemet@lnxw.com>
* libgloss.exp (get_multilibs): Don't use the first argument
passed to this function as the multilib option unless it is in
fact a multilib option.
2002-11-13 Matt Bemis <bemis@iol.unh.edu>
* Fixed input/output to check for empty.

89
lib/libgloss.exp

@ -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 ""

Loading…
Cancel
Save