mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 05:47:26 +08:00
* lib/ld-lib.exp (at_least_gcc_version): Accept more version
number formats; avoid throwing exceptions in any case.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2012-08-03 Maciej W. Rozycki <macro@codesourcery.com>
|
||||||
|
|
||||||
|
* lib/ld-lib.exp (at_least_gcc_version): Accept more version
|
||||||
|
number formats; avoid throwing exceptions in any case.
|
||||||
|
|
||||||
2012-08-03 Maciej W. Rozycki <macro@codesourcery.com>
|
2012-08-03 Maciej W. Rozycki <macro@codesourcery.com>
|
||||||
|
|
||||||
* ld-mips-elf/mode-change-error-1.d: Update the error message.
|
* ld-mips-elf/mode-change-error-1.d: Update the error message.
|
||||||
|
@ -41,14 +41,19 @@ proc at_least_gcc_version { major minor } {
|
|||||||
set state [remote_exec host $CC --version]
|
set state [remote_exec host $CC --version]
|
||||||
set tmp "[lindex $state 1]\n"
|
set tmp "[lindex $state 1]\n"
|
||||||
# Look for (eg) 4.6.1 in the version output.
|
# Look for (eg) 4.6.1 in the version output.
|
||||||
regexp " .* (\[1-9\])\\.(\[0-9\])\\.\[0-9\]* .*" "$tmp" fred maj min
|
set ver_re "\[^\\.0-9\]+(\[1-9\]\[0-9\]*)\\.(\[0-9\]+)(?:\\.\[0-9\]+)?"
|
||||||
|
regexp $ver_re $tmp fred maj min
|
||||||
verbose "gcc version: $tmp"
|
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"
|
verbose "major gcc version is $maj, want at least $major"
|
||||||
if { $maj == $major } then {
|
if { $maj == $major } then {
|
||||||
verbose "minor gcc version is $min, want at least $minor"
|
verbose "minor gcc version is $min, want at least $minor"
|
||||||
return [expr $min >= $minor ]
|
return [expr $min >= $minor]
|
||||||
} else {
|
} else {
|
||||||
return [expr $maj > $major ]
|
return [expr $maj > $major]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user