From de5b386157c7f86df3f0a93cd01172ff84781459 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 30 Nov 2015 14:50:21 -0500 Subject: [PATCH] =?utf8?q?misc/cgo/testsanitizers:=20do=20not=20run=20with?= =?utf8?q?=20clang=20<=203.8=20and=20Linux=20=E2=89=A5=204.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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/17254 Reviewed-by: Ian Lance Taylor --- misc/cgo/testsanitizers/test.bash | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/misc/cgo/testsanitizers/test.bash b/misc/cgo/testsanitizers/test.bash index 0c28249c1b..bc25617b6c 100755 --- a/misc/cgo/testsanitizers/test.bash +++ b/misc/cgo/testsanitizers/test.bash @@ -29,10 +29,24 @@ if $CC --version | grep clang >& /dev/null; then ver=$($CC --version | sed -e 's/.* version \([0-9.-]*\).*/\1/') major=$(echo $ver | sed -e 's/\([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 - echo "skipping msan test; clang version $major.$minor older than 3.6" + 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)" exit 0 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 status=0 -- 2.50.0