tsan: don't check libc dependency on FreeBSD

This check fails on FreeBSD:
https://github.com/golang/go/issues/14481#issuecomment-607471193
It is meant to prevent regressions, so disable it on FreeBSD.
diff --git a/compiler-rt/lib/tsan/go/buildgo.sh b/compiler-rt/lib/tsan/go/buildgo.sh
index f85cad5..6133421 100755
--- a/compiler-rt/lib/tsan/go/buildgo.sh
+++ b/compiler-rt/lib/tsan/go/buildgo.sh
@@ -66,6 +66,10 @@
 		ARCHCFLAGS=""
 	fi
 elif [ "`uname -a | grep FreeBSD`" != "" ]; then
+	# The resulting object still depends on libc.
+	# We removed this dependency for Go runtime for other OSes,
+	# and we should remove it for FreeBSD as well, but there is no pressing need.
+	DEPENDS_ON_LIBC=1
 	SUFFIX="freebsd_amd64"
 	OSCFLAGS="-fno-strict-aliasing -fPIC -Werror"
 	ARCHCFLAGS="-m64"
@@ -172,10 +176,12 @@
 
 $CC $OSCFLAGS $ARCHCFLAGS test.c $DIR/race_$SUFFIX.syso -g -o $DIR/test $OSLDFLAGS $LDFLAGS
 
-# Verify that no glibc specific code is present
-if nm $DIR/race_$SUFFIX.syso | grep -q __libc_; then
-	printf -- '%s seems to link to libc\n' "race_$SUFFIX.syso"
-	exit 1
+# Verify that no libc specific code is present.
+if [ "$DEPENDS_ON_LIBC" != "1" ]; then
+	if nm $DIR/race_$SUFFIX.syso | grep -q __libc_; then
+		printf -- '%s seems to link to libc\n' "race_$SUFFIX.syso"
+		exit 1
+	fi
 fi
 
 export GORACE="exitcode=0 atexit_sleep_ms=0"