Skip to content

Commit

Permalink
Automatically preload asan runtime library
Browse files Browse the repository at this point in the history
  • Loading branch information
suokko committed Jul 5, 2018
1 parent d1a3f1a commit 05dfac2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion package/linux/dfhack
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ fi

export LD_LIBRARY_PATH="./hack/libs:./hack:$LD_LIBRARY_PATH"

PRELOAD_LIB="${PRELOAD_LIB:+$PRELOAD_LIB:}./hack/libdfhack.so"
LIB="./hack/libdfhack.so"
LIBSAN=""
if which objdump > /dev/null; then
LIBSAN="$(objdump -p $LIB | sed -n 's/^.*NEEDED.*\(lib[a-z]san[a-z.0-9]*\).*$/\1/p' | head -n1):"
fi
PRELOAD_LIB="${PRELOAD_LIB:+$PRELOAD_LIB:}${LIBSAN}${LIB}"

setarch_arch=$(cat hack/dfhack_setarch.txt || printf i386)

Expand Down

0 comments on commit 05dfac2

Please sign in to comment.