[PATCH 1/2] libctf, testsuite: don't run without a suitable compiler
Jan Beulich
jbeulich@suse.com
Wed Feb 3 13:22:48 GMT 2021
On 03.02.2021 14:19, Nick Alcock wrote:
> On 3 Feb 2021, Jan Beulich stated:
>> On 05.01.2021 20:52, Nick Alcock via Binutils wrote:
>>> 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 <nick.alcock@oracle.com>
>>>
>>> * 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.
>>
>> Is there any reason the same check didn't get added here to
>> testsuite/libctf-writable/writable.exp?
>
> Yes. The libctf-writable stuff exists to test *writable* dictionaries:
> these tests create CTF on the fly using ctf_create and then populate it
> using ctf_add_*(), rather than reading in .ctf sections in binaries
> created by the linker (with CTF ultimately generated by the compiler).
> So no compiler support is needed to run these (and they will happily run
> on non-ELF platforms for which I haven't got the linker emitting .ctf
> yet). The writable tsts still use run_lookup_test, but because none of
> the tests have any source: declared in their .lk files, we end up not
> calling GCC with -gt at all.
Ah yes, I meanwhile guessed along these lines, so thanks for
confirming.
>> because the Tcl there is 8.5, but "try" is available only
>> from 8.6. I think this dependency would also be nice to be
>> checked.
>
> Ah yeah, that's a quite different bug :) will fix soon. I guess I'll
> have to conditionalize out the entirety of check-DEJAGNU in
> libctf/Makefile.am if Tcl is too old. I could rewrite things to not use
> 'try' but honestly if you have a Tcl that old I guess a few tests
> getting skipped is not too much of a problem.
What I've done locally for now is:
--- 2.36/libctf/testsuite/libctf-lookup/lookup.exp
+++ 2.36/libctf/testsuite/libctf-lookup/lookup.exp
@@ -23,6 +23,11 @@ if ![is_elf_format] {
return 0
}
+if {![llength [info commands try]]} {
+ unsupported "Tcl / Tcllib too old / missing (no 'try')"
+ return 0
+}
+
if {![check_ctf_available]} {
unsupported "no CTF format support in the compiler"
return 0
--- 2.36/libctf/testsuite/libctf-regression/regression.exp
+++ 2.36/libctf/testsuite/libctf-regression/regression.exp
@@ -18,6 +18,11 @@
# MA 02110-1301, USA.
#
+if {![llength [info commands try]]} {
+ unsupported "Tcl / Tcllib too old / missing (no 'try')"
+ return 0
+}
+
if {![check_ctf_available]} {
unsupported "no CTF format support in the compiler"
return 0
--- 2.36/libctf/testsuite/libctf-writable/writable.exp
+++ 2.36/libctf/testsuite/libctf-writable/writable.exp
@@ -18,6 +18,11 @@
# MA 02110-1301, USA.
#
+if {![llength [info commands try]]} {
+ unsupported "Tcl / Tcllib too old / missing (no 'try')"
+ return 0
+}
+
if {[info exists env(LC_ALL)]} {
set old_lc_all $env(LC_ALL)
}
Jan
More information about the Binutils
mailing list