Fix TRICK_HOST_CPU gcc version for Ubuntu 18.04+ (#1024) (#1026)

In later versions of gcc, gcc -dumpversion only shows the major version. You have to use gcc -dumpfullversion instead. This was first seen from a Trick user who is running on Ubuntu 18.04.
This commit is contained in:
Keith Vetter 2020-08-16 18:46:17 -05:00 committed by GitHub
parent ab2cfe1a34
commit cef656e80b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,21 +49,21 @@ sub gte (@) {
# remove possible ccache from TRICK_CC
$temp =~ s/.*?ccache\s+// ;
if ( -e $temp ) {
$ret = `$temp -dumpversion` ;
$ret = `$temp -dumpfullversion -dumpversion` ;
}
else {
printf STDERR "Cannot find TRICK_CC = $temp, using /usr/bin/gcc\n" ;
$ret = `/usr/bin/gcc -dumpversion` ;
$ret = `/usr/bin/gcc -dumpfullversion -dumpversion` ;
}
} else {
# remove possible ccache from TRICK_CC
my ($temp) = $ENV{TRICK_CC} ;
$temp =~ s/.*?ccache\s+// ;
$ret = `$temp -dumpversion` ;
$ret = `$temp --dumpfullversion dumpversion` ;
}
}
else {
$ret = `gcc -dumpversion` ;
$ret = `gcc -dumpfullversion -dumpversion` ;
}
($gcc_version) = $ret =~ /(\d+(?:\.\d+)?)/ ;