From f1868ad7d598cf4f194680a5e8d116744d8227cc Mon Sep 17 00:00:00 2001
From: John Cox <jc@kynesim.co.uk>
Date: Tue, 30 Jan 2024 16:20:53 +0000
Subject: [PATCH 06/14] conf_native: Add --tsan option

---
 pi-util/conf_native.sh | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/pi-util/conf_native.sh b/pi-util/conf_native.sh
index f0ed159594..0dbaa53e97 100755
--- a/pi-util/conf_native.sh
+++ b/pi-util/conf_native.sh
@@ -10,6 +10,8 @@ RPI_KEEPS=""
 NOSHARED=
 MMAL=
 USR_PREFIX=
+TOOLCHAIN=
+R=rel
 
 while [ "$1" != "" ] ; do
     case $1 in
@@ -22,6 +24,10 @@ while [ "$1" != "" ] ; do
 	--usr)
 	    USR_PREFIX=/usr
 	    ;;
+	--tsan)
+	    TOOLCHAIN="--toolchain=gcc-tsan"
+	    R=tsan
+	    ;;
 	*)
 	    echo "Usage $0: [--noshared] [--mmal] [--usr]"
 	    echo "  noshared  Build static libs and executable - good for testing"
@@ -82,11 +88,11 @@ V=`cat RELEASE`
 SHARED_LIBS="--enable-shared"
 if [ $NOSHARED ]; then
   SHARED_LIBS="--disable-shared"
-  OUT=$BUILDBASE/$B-$C-$V-static-rel
+  OUT=$BUILDBASE/$B-$C-$V-static-$R
   echo Static libs
 else
   echo Shared libs
-  OUT=$BUILDBASE/$B-$C-$V-shared-rel
+  OUT=$BUILDBASE/$B-$C-$V-shared-$R
 fi
 
 if [ ! $USR_PREFIX ]; then
@@ -106,6 +112,7 @@ $FFSRC/configure \
  --libdir=$LIB_PREFIX\
  --incdir=$INC_PREFIX\
  $MCOPTS\
+ $TOOLCHAIN\
  --disable-stripping\
  --disable-thumb\
  --enable-sand\
-- 
2.34.1

