[Tizen] Define -DHAS_ADDRESS_SANITIZER for ASan build 04/209904/2 accepted/tizen/unified/20190718.220406 submit/tizen/20190718.065523
authorSlava Barinov <v.barinov@samsung.com>
Thu, 11 Jul 2019 13:25:46 +0000 (16:25 +0300)
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>
Thu, 18 Jul 2019 06:38:18 +0000 (15:38 +0900)
This define turns on new and delete operators compatibility mode for build with
Address Sanitizer. It allows Tizen libasan to intercept operators and prevents
alloc-dealloc-mismatch errors.

Change-Id: If72b1d42dd99eaaf11d3cb1232006ee0e2e411c3
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
packaging/coreclr.spec

index ad23d10..5de40d1 100755 (executable)
@@ -144,9 +144,12 @@ done
 
 %build
 # disable asan build when global forced asan build
-%{?asan:export ASAN_OPTIONS=use_sigaltstack=false:`cat /ASAN_OPTIONS`}
-%{?asan:/usr/bin/gcc-unforce-options}
-%{?asan:export LD_LIBRARY_PATH=`pwd`/libicu-57.1}
+%{?asan:
+export ASAN_OPTIONS=use_sigaltstack=false:`cat /ASAN_OPTIONS`
+/usr/bin/gcc-unforce-options
+export LD_LIBRARY_PATH=`pwd`/libicu-57.1
+export CPPFLAGS+=" -DHAS_ADDRESS_SANITIZER "
+}
 
 export CFLAGS=" --target=%{_host} "
 export CXXFLAGS=" --target=%{_host} "