Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ASan][ROCm][Staging] Disable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR. #909

Open
wants to merge 1 commit into
base: amd-staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions bin/build_offload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,14 @@ fi

if [ "$AOMP_BUILD_SANITIZER" == 1 ]; then
ASAN_LIB_PATH=$($INSTALL_PREFIX/llvm/bin/clang --print-runtime-dir)
if [ ! -d "$ASAN_LIB_PATH" ]; then
CLANG_RES_DIR=$($INSTALL_PREFIX/llvm/bin/clang --print-resource-dir)
ASAN_LIB_PATH="$CLANG_RES_DIR/lib/linux"
fi
ASAN_RPATH_FLAGS="-Wl,-rpath=$ASAN_LIB_PATH -L$ASAN_LIB_PATH"
CXXFLAGS="$CXXFLAGS $ASAN_RPATH_FLAGS -I$ROCM_DIR/include -I$ROCM_DIR/include/hsa"
CFLAGS="$CFLAGS $ASAN_RPATH_FLAGS -I$ROCM_DIR/include -I$ROCM_DIR/include/hsa"
LDFLAGS=$LDFLAGS
fi

if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then
Expand Down Expand Up @@ -161,7 +166,7 @@ if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then
fi

if [ "$AOMP_BUILD_SANITIZER" == 1 ]; then
ASAN_CMAKE_OPTS="$MYCMAKEOPTS -DSANITIZER_AMDGPU=1 -DOFFLOAD_LIBDIR_SUFFIX=/asan"
ASAN_CMAKE_OPTS="$MYCMAKEOPTS -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF -DSANITIZER_AMDGPU=1 -DOFFLOAD_LIBDIR_SUFFIX=/asan"
mkdir -p $BUILD_DIR/build/offload/asan
cd $BUILD_DIR/build/offload/asan
echo " ------Running offload-asan cmake ---- "
Expand Down Expand Up @@ -195,7 +200,7 @@ if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then

# Only use CMAKE_CXX/C_FLAGS on non-asan builds as these will overwrite the asan flags
if [ "$AOMP_BUILD_SANITIZER" == 1 ]; then
ASAN_CMAKE_OPTS="$MYCMAKEOPTS -DSANITIZER_AMDGPU=1 -DOFFLOAD_LIBDIR_SUFFIX=-debug/asan"
ASAN_CMAKE_OPTS="$MYCMAKEOPTS -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF -DSANITIZER_AMDGPU=1 -DOFFLOAD_LIBDIR_SUFFIX=-debug/asan"
fi

MYCMAKEOPTS="$MYCMAKEOPTS -DOFFLOAD_LIBDIR_SUFFIX=-debug"
Expand Down
9 changes: 7 additions & 2 deletions bin/build_openmp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,14 @@ fi

if [ "$AOMP_BUILD_SANITIZER" == 1 ]; then
ASAN_LIB_PATH=$($INSTALL_PREFIX/llvm/bin/clang --print-runtime-dir)
if [ ! -d "$ASAN_LIB_PATH" ]; then
CLANG_RES_DIR=$($INSTALL_PREFIX/llvm/bin/clang --print-resource-dir)
ASAN_LIB_PATH="$CLANG_RES_DIR/lib/linux"
fi
ASAN_RPATH_FLAGS="-Wl,-rpath=$ASAN_LIB_PATH -L$ASAN_LIB_PATH"
CXXFLAGS="$CXXFLAGS $ASAN_RPATH_FLAGS -I$ROCM_DIR/include -I$ROCM_DIR/include/hsa"
CFLAGS="$CFLAGS $ASAN_RPATH_FLAGS -I$ROCM_DIR/include -I$ROCM_DIR/include/hsa"
LDFLAGS="$LDFLAGS"
fi

if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then
Expand Down Expand Up @@ -161,7 +166,7 @@ if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then
fi

if [ "$AOMP_BUILD_SANITIZER" == 1 ]; then
ASAN_CMAKE_OPTS="$MYCMAKEOPTS -DSANITIZER_AMDGPU=1 -DLLVM_LIBDIR_SUFFIX=/asan"
ASAN_CMAKE_OPTS="$MYCMAKEOPTS -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF -DSANITIZER_AMDGPU=1 -DLLVM_LIBDIR_SUFFIX=/asan"
mkdir -p $BUILD_DIR/build/openmp/asan
cd $BUILD_DIR/build/openmp/asan
echo " ------Running openmp-asan cmake ---- "
Expand Down Expand Up @@ -195,7 +200,7 @@ if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then

# Only use CMAKE_CXX/C_FLAGS on non-asan builds as these will overwrite the asan flags
if [ "$AOMP_BUILD_SANITIZER" == 1 ]; then
ASAN_CMAKE_OPTS="$MYCMAKEOPTS -DSANITIZER_AMDGPU=1 -DLLVM_LIBDIR_SUFFIX=-debug/asan"
ASAN_CMAKE_OPTS="$MYCMAKEOPTS -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF -DSANITIZER_AMDGPU=1 -DLLVM_LIBDIR_SUFFIX=-debug/asan"
fi

MYCMAKEOPTS="$MYCMAKEOPTS -DLLVM_LIBDIR_SUFFIX=-debug"
Expand Down