From 8d6f41350af108d357dbf4210400b3bc51fd1968 Mon Sep 17 00:00:00 2001 From: Gefei Jiang Date: Fri, 9 Oct 2020 18:00:02 -0700 Subject: [PATCH] CMakeList.txt -- Support Address Sanitize ROCMOPS-1249 append address sanitize flag Change-Id: Ie5d1e5b8b93022b80e0ca74106a16d53d52e41af Signed-off-by: Gefei Jiang [ROCm/ROCR-Runtime commit: f0e6e7ae17a5c1ccbebafea0e800d6eafc796f49] --- projects/rocr-runtime/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/projects/rocr-runtime/CMakeLists.txt b/projects/rocr-runtime/CMakeLists.txt index 01b02dbf8d..c868d8f9ff 100644 --- a/projects/rocr-runtime/CMakeLists.txt +++ b/projects/rocr-runtime/CMakeLists.txt @@ -90,6 +90,11 @@ else () set ( HSAKMT_C_FLAGS "${HSAKMT_C_FLAGS}" -g ) endif () +## Address Sanitize Flag +if (DEFINED $ENV{ADDRESS_SANITIZER}) + set ( HSAKMT_C_FLAGS "${HSAKMT_C_FLAGS}" -fsanitizer=address ) +endif () + set ( HSAKMT_LINKER_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/src/libhsakmt.ver" ) ## Linker Flags