Skip to content

Commit 5048fe9

Browse files
committed
fix(ci): Add -fno-gpu-sanitize flag to HOST_ASAN builds
Recently HOST_ASAN is default for Multi-Arch CI to improve efficiency: (#7110) There is an issue with HOST_ASAN Multi-Arch CI. MIOpen uses -Werror and during HOST_ASAN this reports a warning that -fsanitize=address is not supported unless xnack+ is appended to the gfx target. Regular ASAN builds override the gfx942 target with gfx942:xnack+ and do not see this issue. -fno-gpu-sanitize is used to explicitly disable sanitizer checks for GPU device target compilations, but allows host sanitization to remain.
1 parent 69c37f9 commit 5048fe9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cmake/therock_sanitizers.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ function(therock_sanitizer_configure
4646
# so make the sanitizer imply shared linkage.
4747
string(APPEND _stanza "string(APPEND CMAKE_CXX_FLAGS_INIT \" -fsanitize=${_sanitizer_string} -fno-omit-frame-pointer -g\")\n")
4848
string(APPEND _stanza "string(APPEND CMAKE_C_FLAGS_INIT \" -fsanitize=${_sanitizer_string} -fno-omit-frame-pointer -g\")\n")
49+
# MIOpen uses -Werror and the HOST_ASAN path with non +xnack gfx target will throw a warning that -fsanitize=address
50+
# is not supported. This will fail the math-libs step during HOST_ASAN Multi-Arch CI. Passing -fno-gpu-sanitize supresses this warning.
51+
if(_sanitizer STREQUAL "HOST_ASAN")
52+
string(APPEND _stanza "string(APPEND CMAKE_CXX_FLAGS_INIT \" -fno-gpu-sanitize\")\n")
53+
string(APPEND _stanza "string(APPEND CMAKE_C_FLAGS_INIT \" -fno-gpu-sanitize\")\n")
54+
endif()
4955

5056
# Sharp edge: The -shared-libsan flag is compiler frontend specific:
5157
# gcc (and gfortran): defaults to shared sanitizer linkage

0 commit comments

Comments
 (0)