From 70d3120f32281980105169dee74440146e97702e Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Tue, 5 Jan 2021 17:11:20 +0000 Subject: libctf, testsuite: don't run without a suitable compiler We never actually check to see if the compiler supports CTF, or even if a suitable compiler exists. libctf/ChangeLog 2021-01-05 Nick Alcock * Makefile.am (BASEDIR): New. (BFDDIR): Likewise. (check-DEJAGNU): Add development.exp to prerequisites. (development.exp): New. (CONFIG_STATUS_DEPENDENCIES): New. (EXTRA_DEJAGNU_SITE_CONFIG): Likewise. (DISTCLEANFILES): Likewise. * Makefile.in: Regenerated. * testsuite/lib/ctf-lib.exp (check_ctf_available): Return boolean. * testsuite/libctf-lookup/lookup.exp: Call check_ctf_available. * testsuite/libctf-regression/regression.exp: Likewise. --- libctf/testsuite/lib/ctf-lib.exp | 7 ++++++- libctf/testsuite/libctf-lookup/lookup.exp | 5 +++++ libctf/testsuite/libctf-regression/regression.exp | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'libctf/testsuite') diff --git a/libctf/testsuite/lib/ctf-lib.exp b/libctf/testsuite/lib/ctf-lib.exp index 796342b..fe02812 100644 --- a/libctf/testsuite/lib/ctf-lib.exp +++ b/libctf/testsuite/lib/ctf-lib.exp @@ -399,7 +399,12 @@ proc check_ctf_available { } { set f [open $src "w"] puts $f "int main() { return 0; }" close $f - set ctf_available_saved [compile_one_cc $src $output "-gt -c"] + set comp_output [compile_one_cc $src $output "-gt -c"] + if { $comp_output == ""} { + set ctf_available_saved 1 + } else { + set ctf_available_saved 0 + } remote_file host delete $src remote_file host delete $output file delete $src diff --git a/libctf/testsuite/libctf-lookup/lookup.exp b/libctf/testsuite/libctf-lookup/lookup.exp index 51ad257..84ff46c 100644 --- a/libctf/testsuite/libctf-lookup/lookup.exp +++ b/libctf/testsuite/libctf-lookup/lookup.exp @@ -23,6 +23,11 @@ if ![is_elf_format] { return 0 } +if {![check_ctf_available]} { + unsupported "no CTF format support in the compiler" + return 0 +} + if {[info exists env(LC_ALL)]} { set old_lc_all $env(LC_ALL) } diff --git a/libctf/testsuite/libctf-regression/regression.exp b/libctf/testsuite/libctf-regression/regression.exp index 51ad257..605d96f 100644 --- a/libctf/testsuite/libctf-regression/regression.exp +++ b/libctf/testsuite/libctf-regression/regression.exp @@ -18,6 +18,11 @@ # MA 02110-1301, USA. # +if {![check_ctf_available]} { + unsupported "no CTF format support in the compiler" + return 0 +} + if ![is_elf_format] { unsupported "CTF needs bfd changes to be emitted on non-ELF" return 0 -- cgit v1.1