aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2024-07-31 08:02:24 +0930
committerAlan Modra <amodra@gmail.com>2024-07-31 10:43:05 +0930
commit52ff9e9d54d1f528eb7645706bb3a67fc535050b (patch)
tree7cdc4a8bcfe54766fd50efd7834b2da40383593f /ld
parent762f95fdc65f9fb138d77bed44d77b8fd947dc44 (diff)
downloadgdb-52ff9e9d54d1f528eb7645706bb3a67fc535050b.zip
gdb-52ff9e9d54d1f528eb7645706bb3a67fc535050b.tar.gz
gdb-52ff9e9d54d1f528eb7645706bb3a67fc535050b.tar.bz2
fix the framework error
Running the testsuite for an x86_64-w64-mingw32 target using the Ubuntu package gcc-mingw-w64-x86-64 version 13.2.0-6ubuntu1+26.1 results in a number of messages: ERROR: can't decipher gcc version number, fix the framework! Someone in their wisdom decided this compiler should advertise itself with a version of 13-win32, breaking the ld testsuite version checks. (It is also configured using --with-as=/usr/bin/x86_64-w64-mingw32-as --with-ld=/usr/bin/x86_64-w64-mingw32-ld which renders the -B flag inoperative for testing the newly built gas and ld. You'd need to install binutils over the top of the Ubuntu versions before testing, a rather unsatisfactory process.) * testsuite/lib/ld-lib.exp (at_least_gcc_version): Use preprocessor test of __GNUC__ and __GNUC_MINOR__ rather than output of gcc --version. Correct removal of -Wl options.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/lib/ld-lib.exp23
1 files changed, 5 insertions, 18 deletions
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index aeef82a..5d5905d 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -33,27 +33,14 @@ proc at_least_gcc_version { major minor } {
return 0
}
# Filter out -Wl, options.
- regsub -all -- "-Wl,\[^ ^\t\]+" $CC_FOR_TARGET "" cc_cmd
- set state [remote_exec host $cc_cmd --version]
+ regsub -all -- {-Wl,[^ \t]+} $CC_FOR_TARGET {} cc_cmd
+ set prog "\"#if $major < __GNUC__ + ($minor <= __GNUC_MINOR__)\nyes\n#endif\""
+ set cmd "echo $prog | $cc_cmd -E -"
+ set state [remote_exec host [concat sh -c [list "$cmd 2>/dev/null"]]]
if { [lindex $state 0] != 0 } {
return 0;
}
- set tmp "[lindex $state 1]\n"
- # Look for (eg) 4.6.1 in the version output.
- set ver_re "\[^\\.0-9\]+(\[1-9\]\[0-9\]*)\\.(\[0-9\]+)(?:\\.\[0-9\]+)?"
- regexp $ver_re $tmp fred maj min
- verbose "gcc version: $tmp"
- if { ![info exists maj] || ![info exists min] } then {
- perror "can't decipher gcc version number, fix the framework!"
- return 0
- }
- verbose "major gcc version is $maj, want at least $major"
- if { $maj == $major } then {
- verbose "minor gcc version is $min, want at least $minor"
- return [expr $min >= $minor]
- } else {
- return [expr $maj > $major]
- }
+ return [regexp {(?x)yes} [lindex $state 1]]
}
# Extract and print the version number of ld.