aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-09-15 11:57:59 +0200
committerChristian Grothoff <christian@grothoff.org>2019-09-15 11:57:59 +0200
commitf552d0c8fb2fee103c9d746cf84db537841887d8 (patch)
tree6bcd9877b352faee74df0686185c89b8e6fae25d /src/util
parent13707999f1c3d9b4ca67da1e428993a37de23b52 (diff)
add libasan to the LD_PRELOAD path if it was in gnunet-config
Diffstat (limited to 'src/util')
-rw-r--r--src/util/taler-config.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/util/taler-config.in b/src/util/taler-config.in
index 5c997688c..beea2540e 100644
--- a/src/util/taler-config.in
+++ b/src/util/taler-config.in
@@ -1,5 +1,7 @@
#!/usr/bin/env bash
+set -eu
+
if ! type gnunet-config >/dev/null; then
echo "$0 needs gnunet-config to be installed"
exit 1
@@ -8,5 +10,8 @@ fi
# FIXME: not very portable ...
# FIXME: should use "libdir" instead of prefix/lib, but somehow
# the recursive expansion does not work ;-(.
-export LD_PRELOAD=@prefix@/lib/libtalerutil.so
+GC=`which gnunet-config`
+ASAN=""
+A=`ldd $GC | grep libasan` && ASAN=`echo $A | awk '{print $3 ":"}'`
+export LD_PRELOAD=${ASAN}${LD_PRELOAD:-}:@prefix@/lib/libtalerutil.so
exec gnunet-config "$@"