From 1d41ce6faf271097cf5e7ffb77f1b48571f73acf Mon Sep 17 00:00:00 2001 From: "Dongkyun, Son" Date: Tue, 25 Oct 2016 20:21:42 +0900 Subject: [PATCH] Modify LD_PRELOAD for ASan error ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD. Change-Id: If7f439c7652f7ccdfa48a68f363e0f8129f754db Signed-off-by: Maxim Ostapenko Signed-off-by: Dongkyun Son Signed-off-by: DongHun Kwak --- Makefile.SH | 2 +- packaging/perl.spec | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile.SH b/Makefile.SH index b65a7f3..b9b591d 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -147,7 +147,7 @@ true) #! /bin/sh lib=$1 shift -test -r $lib && export LD_PRELOAD="$lib $LD_PRELOAD" +test -r $lib && export LD_PRELOAD="$LD_PRELOAD $lib" exec "$@" EOT chmod 755 preload diff --git a/packaging/perl.spec b/packaging/perl.spec index f879eb0..4b6d5e6 100644 --- a/packaging/perl.spec +++ b/packaging/perl.spec @@ -99,6 +99,9 @@ cp -p %{S:3} . %build RPM_OPT_FLAGS=$(echo $RPM_OPT_FLAGS | sed -e "s/--param=ssp-buffer-size=4//g" ) +%if "%{asan}" == "1" +export LD_PRELOAD+=" libasan.so " +%endif export RPM_OPT_FLAGS cp -a lib savelib export LD_AS_NEEDED=0 -- 2.7.4