Skip to content

Commit

Permalink
tsan: don't check libc dependency on FreeBSD
Browse files Browse the repository at this point in the history
This check fails on FreeBSD:
golang/go#14481 (comment)
It is meant to prevent regressions, so disable it on FreeBSD.
  • Loading branch information
dvyukov committed Apr 2, 2020
1 parent 2a645ab commit 0fb8a53
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions compiler-rt/lib/tsan/go/buildgo.sh
Expand Up @@ -66,6 +66,10 @@ if [ "`uname -a | grep Linux`" != "" ]; then
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"
Expand Down Expand Up @@ -172,10 +176,12 @@ $CC $DIR/gotsan.cpp -c -o $DIR/race_$SUFFIX.syso $FLAGS $CFLAGS

$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"
Expand Down

0 comments on commit 0fb8a53

Please sign in to comment.