[binutils-gdb] [gdb/testsuite, Tcl 9.0] Fix Tcl version check

Tom de Vries via Gdb-cvs <[email protected]>
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=60a29b7155172bea55e9b506207b7a6e39cfec87

commit 60a29b7155172bea55e9b506207b7a6e39cfec87
Author: Tom de Vries <[email protected]>
Date:   Fri Mar 20 10:13:27 2026 +0100

    [gdb/testsuite, Tcl 9.0] Fix Tcl version check
    
    With Tcl 9.0, we get:
    ...
    ERROR: tcl error sourcing tool init file lib/gdb.exp.
    version conflict for package "Tcl": have 9.0.2, need 8.6.2
    version conflict for package "Tcl": have 9.0.2, need 8.6.2
        while executing
    "package require Tcl 8.6.2"
        (file "lib/gdb.exp" line 20)
    ...
    
    Fix this by using tcl_version_at_least.
    
    Approved-By: Tom Tromey <[email protected]>
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33948

Diff:
---
 gdb/testsuite/lib/gdb.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index dd12f665b98..5fdaa2f0ea6 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -17,8 +17,6 @@
 
 # tclint-disable redefined-builtin
 
-package require Tcl 8.6.2
-
 # Generic gdb subroutines that should work for any target.  If these
 # need to be modified for any target, it can be done with a variable
 # or by passing arguments.
@@ -11803,5 +11801,7 @@ proc dwz_version_at_least { ver } {
     return [version_compare [split $ver .] <= [dwz_version]]
 }
 
+require {tcl_version_at_least 8 6 2}
+
 # Always load compatibility stuff.
 load_lib future.exp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.