]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld, testsuite, ctf: really test -gctf even if the compiler warns
authorNick Alcock <nick.alcock@oracle.com>
Tue, 11 Feb 2025 15:33:51 +0000 (15:33 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Fri, 28 Feb 2025 15:13:24 +0000 (15:13 +0000)
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.

ld/testsuite/lib/ld-lib.exp

index 96152718d6f2923a4e95142054b7cdb65cf8aab0..d4fd8f6ba7767b196258c93806b59d8a86689425 100644 (file)
@@ -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