Skip to content

Commit

Permalink
Merge pull request #315 from aakanksha555/master
Browse files Browse the repository at this point in the history
[HIPIFY] Address sanitizer support
  • Loading branch information
emankov authored May 19, 2021
2 parents c74c82c + eee820c commit e258be1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,15 @@ else()
string(APPEND StdCpp "11")
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${StdCpp} -DHIPIFY_CLANG_RES=\\\"${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}\\\"")
# Address Sanitize Flag
if (ADDRESS_SANITIZER)
set(addr_var -fsanitize=address)
else()
set(addr_var )
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${addr_var}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${StdCpp} -DHIPIFY_CLANG_RES=\\\"${LLVM_LIBRARY_DIRS}/clang/${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}\\\" ${addr_var}")

set(INSTALL_PATH_DOC_STRING "hipify-clang Installation Path")
set(HIPIFY_INSTALL_PATH ${CMAKE_INSTALL_PREFIX})
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Run `Visual Studio 16 2019`, open the generated `LLVM.sln`, build all, build pro
-DCMAKE_INSTALL_PREFIX=../dist \
-DLLVM_SOURCE_DIR=../llvm-project \
-DLLVM_TARGETS_TO_BUILD="X86;NVPTX" \
-DLLVM_ENABLE_PROJECTS="clang" \
-DLLVM_ENABLE_PROJECTS="clang;compiler-rt" \
-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \
-DCMAKE_BUILD_TYPE=Release \
../llvm-project/llvm
Expand All @@ -276,7 +276,7 @@ Run `Visual Studio 16 2019`, open the generated `LLVM.sln`, build all, build pro
-DCMAKE_INSTALL_PREFIX=../dist \
-DLLVM_SOURCE_DIR=../llvm-project \
-DLLVM_TARGETS_TO_BUILD="NVPTX" \
-DLLVM_ENABLE_PROJECTS="clang" \
-DLLVM_ENABLE_PROJECTS="clang;compiler-rt" \
-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \
-DCMAKE_BUILD_TYPE=Release \
-Thost=x64 \
Expand Down

0 comments on commit e258be1

Please sign in to comment.