Skip to content

Commit c49ef04

Browse files
SendaoYanshipilev
authored andcommitted
8341806: Gcc version detection failure on Alinux3
Backport-of: ace44e5
1 parent 0be27bf commit c49ef04

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

make/autoconf/toolchain.m4

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,11 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION],
358358
# Copyright (C) 2013 Free Software Foundation, Inc.
359359
# This is free software; see the source for copying conditions. There is NO
360360
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
361+
# or look like
362+
# gcc (GCC) 10.2.1 20200825 (Alibaba 10.2.1-3.8 2.32)
363+
# Copyright (C) 2020 Free Software Foundation, Inc.
364+
# This is free software; see the source for copying conditions. There is NO
365+
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
361366
COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1`
362367
# Check that this is likely to be GCC.
363368
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null
@@ -371,7 +376,8 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION],
371376
COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \
372377
$SED -e 's/ *Copyright .*//'`
373378
COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \
374-
$SED -e 's/^.* \(@<:@1-9@:>@<:@0-9@:>@*\.@<:@0-9.@:>@*\)@<:@^0-9.@:>@.*$/\1/'`
379+
$AWK -F ')' '{print [$]2}' | \
380+
$AWK '{print [$]1}'`
375381
elif test "x$TOOLCHAIN_TYPE" = xclang; then
376382
# clang --version output typically looks like
377383
# Apple clang version 15.0.0 (clang-1500.3.9.4)

0 commit comments

Comments
 (0)