From: Nick Alcock Date: Tue, 11 Feb 2025 15:33:51 +0000 (+0000) Subject: ld, testsuite, ctf: really test -gctf even if the compiler warns X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8ab2fdda02b070528ecbb776b87f275c4c9f3c8c;p=thirdparty%2Fbinutils-gdb.git ld, testsuite, ctf: really test -gctf even if the compiler warns Commit a12c988767e5bd6b6a15dd6ca5e3b277f5627c64 endeavoured to improve the CTF-availability test by having it try to create CTF even if the compiler appears not to be working, checking for the presence of likely-valid generated assembler instead. Unfortunately this commit didn't remove the actual call to check_compiler_available, so it didn't really improve anything. Remove that call to induce proper testing on platforms in which the compiler emits warnings. ld/ * testsuite/lib/ld-lib.exp (check_ctf_available): Don't require a working compiler before testing. --- diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index 96152718d6f..d4fd8f6ba77 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -1627,25 +1627,23 @@ proc check_ctf_available { } { # compiler is available but emits warnings. An unavailable # compiler will fail this test anyway. - if ([check_compiler_available]) { - set basename "tmpdir/ctf_available[pid]" - set src ${basename}.c - set output ${basename}.s - set f [open $src "w"] - puts $f "int main() { return 0; }" - close $f - compile_one_cc $src $output "-gctf -S -c" - remote_file host delete $src - if {! [remote_file host exists $output] } { + set basename "tmpdir/ctf_available[pid]" + set src ${basename}.c + set output ${basename}.s + set f [open $src "w"] + puts $f "int main() { return 0; }" + close $f + compile_one_cc $src $output "-gctf -S -c" + remote_file host delete $src + if {! [remote_file host exists $output] } { file delete $src return 0 - } - set status [remote_exec host fgrep ".ctf $output"] - remote_file host delete $output - file delete $src - if { [lindex $status 0] == 0 } { + } + set status [remote_exec host fgrep ".ctf $output"] + remote_file host delete $output + file delete $src + if { [lindex $status 0] == 0 } { set ctf_available_saved 1 - } } } return $ctf_available_saved