done
FLAGS=" -I../rtl -I../.. -I../../sanitizer_common -I../../../include -std=c++11 -Wall -fno-exceptions -fno-rtti -DSANITIZER_GO=1 -DSANITIZER_DEADLOCK_DETECTOR_VERSION=2 $OSCFLAGS $ARCHCFLAGS"
+DEBUG_FLAGS="$FLAGS -DSANITIZER_DEBUG=1 -g"
+FLAGS="$FLAGS -DSANITIZER_DEBUG=0 -O3 -fomit-frame-pointer"
+if [ "$SUFFIX" = "linux_ppc64le" ]; then
+ FLAGS="$FLAGS -mcpu=power8 -fno-function-sections"
+elif [ "$SUFFIX" = "linux_amd64" ]; then
+ FLAGS="$FLAGS -msse3"
+fi
+
if [ "$DEBUG" = "" ]; then
- FLAGS="$FLAGS -DSANITIZER_DEBUG=0 -O3 -fomit-frame-pointer"
- if [ "$SUFFIX" = "linux_ppc64le" ]; then
- FLAGS="$FLAGS -mcpu=power8 -fno-function-sections"
- elif [ "$SUFFIX" = "linux_amd64" ]; then
- FLAGS="$FLAGS -msse3"
- fi
+ # Do a build test with debug flags.
+ $CC $DIR/gotsan.cpp -c -o $DIR/race_debug_$SUFFIX.syso $DEBUG_FLAGS $CFLAGS
else
- FLAGS="$FLAGS -DSANITIZER_DEBUG=1 -g"
+ FLAGS="$DEBUG_FLAGS"
fi
if [ "$SILENT" != "1" ]; then
$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 race_$SUFFIX.syso | grep -q __libc_; 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
void ThreadClock::releaseStoreAcquire(ClockCache *c, SyncClock *sc) {
DCHECK_LE(nclk_, kMaxTid);
- DCHECK_LE(dst->size_, kMaxTid);
+ DCHECK_LE(sc->size_, kMaxTid);
if (sc->size_ == 0) {
// ReleaseStore will correctly set release_store_tid_,