Commit de5b3861 authored by Russ Cox's avatar Russ Cox

misc/cgo/testsanitizers: do not run with clang < 3.8 and Linux ≥ 4.1

These are simply incompatible. Clang fixed the bug but not in older versions.

Fixes #12898.

Change-Id: I74a3fd9134dadab6d0f074f8fd09e00d64558d7a
Reviewed-on: https://go-review.googlesource.com/17254Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 92b02e31
...@@ -29,10 +29,24 @@ if $CC --version | grep clang >& /dev/null; then ...@@ -29,10 +29,24 @@ if $CC --version | grep clang >& /dev/null; then
ver=$($CC --version | sed -e 's/.* version \([0-9.-]*\).*/\1/') ver=$($CC --version | sed -e 's/.* version \([0-9.-]*\).*/\1/')
major=$(echo $ver | sed -e 's/\([0-9]*\).*/\1/') major=$(echo $ver | sed -e 's/\([0-9]*\).*/\1/')
minor=$(echo $ver | sed -e 's/[0-9]*\.\([0-9]*\).*/\1/') minor=$(echo $ver | sed -e 's/[0-9]*\.\([0-9]*\).*/\1/')
if test $major -lt 3 || test $major -eq 3 -a $minor -lt 6; then if test "$major" -lt 3 || test "$major" -eq 3 -a "$minor" -lt 6; then
echo "skipping msan test; clang version $major.$minor older than 3.6" echo "skipping msan test; clang version $major.$minor (older than 3.6)"
exit 0 exit 0
fi fi
# Clang before 3.8 does not work with Linux at or after 4.1.
# golang.org/issue/12898.
if test "$major" -lt 3 || test "$major" -eq 3 -a "$minor" -lt 8; then
if test "$(uname)" = Linux; then
linuxver=$(uname -r)
linuxmajor=$(echo $ver | sed -e 's/\([0-9]*\).*/\1/')
linuxminor=$(echo $ver | sed -e 's/[0-9]*\.\([0-9]*\).*/\1/')
if test "$linuxmajor" -gt 4 || test "$linuxmajor" -eq 4 -a "$linuxminor" -ge 1; then
echo "skipping msan test; clang version $major.$minor (older than 3.8) incompatible with linux version $linuxmajor.$linuxminor (4.1 or newer)"
exit 0
fi
fi
fi
fi fi
status=0 status=0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment