Skip to content

Commit

Permalink
ld/testsuite: don't output to /dev/null
Browse files Browse the repository at this point in the history
Mingw doesn't have /dev/null and thus "-o /dev/null" will fail.
Currently, all the options are checked using this "-o /dev/null",
resulting in them being disabled on mingw hosts.
Fix that by outputting to a real file for all targets.

ld/ChangeLog:

	* testsuite/config/default.exp: Replace "-o /dev/null" by a
	file.
  • Loading branch information
Helflym committed Feb 21, 2023
1 parent 284e8cb commit fd7f742
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ld/testsuite/config/default.exp
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ proc compiler_supports { flag args } {
append flags " [board_info [target_info name] ldflags]"
}
set fn "cs[pid].c"
set rfno "cs[pid].exe"
set f [open $fn "w"]
if { [llength $args] > 0 } {
puts $f [lindex $args 0]
Expand All @@ -391,7 +392,8 @@ proc compiler_supports { flag args } {
}
close $f
set rfn [remote_download host $fn]
set avail [run_host_cmd_yesno "$CC_FOR_TARGET" "$flags $flag $rfn -o /dev/null"]
set avail [run_host_cmd_yesno "$CC_FOR_TARGET" "$flags $flag $rfn -o $rfno"]
remote_file host delete $rfno
remote_file host delete $rfn
file delete $fn
return $avail
Expand Down

0 comments on commit fd7f742

Please sign in to comment.