forked from Imagelibrary/binutils-gdb
Re: gas: Move gas_sframe_check to binutils-common.exp
PR ld/33146 Correct TCL errors trying to access error output file in commitef7a634dc0. In fact, get rid of the output file test entirely since gas exit status is sufficient. Also there is no need to firstly check for ELF support. Set check_as_sframe_result, and remove ld-lib.exp check_as_sframe. (cherry picked from commita57a3a169e)
This commit is contained in:
@@ -482,10 +482,6 @@ proc supports_dt_relr {} {
|
||||
|
||||
# Whether a target assembler supports --gsframe.
|
||||
proc gas_sframe_check {} {
|
||||
if { ![is_elf_format] } then {
|
||||
return 0;
|
||||
}
|
||||
|
||||
global check_as_sframe_result
|
||||
global AS
|
||||
global ASFLAGS
|
||||
@@ -502,23 +498,16 @@ proc gas_sframe_check {} {
|
||||
remote_download host $as_file
|
||||
verbose -log "Checking SFrame support in AS:"
|
||||
|
||||
set old_ASFLAGS "$ASFLAGS"
|
||||
set ASFLAGS "$ASFLAGS --gsframe"
|
||||
set status [remote_exec host "$AS $ASFLAGS --gsframe $as_file"]
|
||||
|
||||
global comp_output
|
||||
|
||||
set output_file "tmpdir/check_as_sframe.out"
|
||||
set status [remote_exec host "$AS $ASFLAGS $as_file" "2> $output_file"]
|
||||
set comp_output [file_contents "$output_file"]
|
||||
set ASFLAGS "$old_ASFLAGS"
|
||||
|
||||
if { ![string match "" $comp_output] } then {
|
||||
if { [lindex $status 0] != 0 } then {
|
||||
verbose -log "SFrame not supported in AS"
|
||||
return 0
|
||||
set check_as_sframe_result 0
|
||||
} else {
|
||||
verbose -log "SFrame supported in AS"
|
||||
return 1
|
||||
set check_as_sframe_result 1
|
||||
}
|
||||
return $check_as_sframe_result
|
||||
}
|
||||
|
||||
# get_relative_path FROM TO
|
||||
|
||||
@@ -1668,36 +1668,6 @@ proc skip_ctf_tests { } {
|
||||
return 1
|
||||
}
|
||||
|
||||
# Check if the assembler supports SFrame.
|
||||
|
||||
proc check_as_sframe { } {
|
||||
global check_as_sframe_result
|
||||
global as
|
||||
if [info exists check_as_sframe_result] {
|
||||
return $check_as_sframe_result
|
||||
}
|
||||
|
||||
# SFrame generation needs CFI support
|
||||
if { ![check_as_cfi] } {
|
||||
set check_as_sframe_result 0;
|
||||
return 0
|
||||
}
|
||||
|
||||
set as_file "tmpdir/check_as_sframe.s"
|
||||
set as_fh [open $as_file w 0666]
|
||||
puts $as_fh "# Generated file. DO NOT EDIT"
|
||||
puts $as_fh "\t.cfi_sections \".sframe\""
|
||||
puts $as_fh "\t.cfi_startproc"
|
||||
puts $as_fh "\t.cfi_endproc"
|
||||
close $as_fh
|
||||
remote_download host $as_file
|
||||
verbose -log "Checking SFrame:"
|
||||
set success [ld_assemble $as $as_file "/dev/null"]
|
||||
#remote_file host delete $as_file
|
||||
set check_as_sframe_result $success
|
||||
return $success
|
||||
}
|
||||
|
||||
proc skip_sframe_tests { } {
|
||||
# FIXME TODO
|
||||
# global enable_libsframe
|
||||
@@ -1706,7 +1676,7 @@ proc skip_sframe_tests { } {
|
||||
# return 1
|
||||
# }
|
||||
|
||||
if [check_as_sframe] {
|
||||
if [gas_sframe_check] {
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user