[SWDEV-469495] Compile blit kernels with -fsanitize=address when asan is enabled.

Change-Id: I96e1abef43317cd58329c4a159f807878bc48cf4


[ROCm/clr commit: e76bf653fb]
이 커밋은 다음에 포함됨:
ksankisa
2024-06-19 21:08:30 +05:30
커밋한 사람 Krishna Sankisa
부모 aacf75f480
커밋 3bcd901f06
3개의 변경된 파일16개의 추가작업 그리고 0개의 파일을 삭제
+7
파일 보기
@@ -1275,6 +1275,13 @@ OPTION(OT_UINT32, \
5, 4, 5, NULL, \
"Specify code object ABI version. Allowed values are 4, and 5. Defaults to 5. (COMGR only)")
// -fsanitze=tool
NOPTION(OT_CSTRING, \
OA_RUNTIME|OVA_REQUIRED|OA_SEPARATOR_EQUAL|OFA_PREFIX_F, \
"sanitize", NULL, \
FSanitize, \
0, 0, 0, "address", \
"Enable sanitizer instrumentation")
/*
Do not remove the following line. Any option should be
added above this line.
+4
파일 보기
@@ -1005,6 +1005,10 @@ processOption(int OptDescTableIx, Options& Opts, const std::string& Value,
break;
case OID_FSanitize:
if (sval != NULL)
Opts.clangOptions.push_back("-fsanitize=" + std::string(sval));
break;
default:
break;
}
+5
파일 보기
@@ -576,6 +576,11 @@ bool Device::BlitProgram::create(amd::Device* device, const std::string& extraKe
if (device->settings().kernel_arg_opt_) {
opt += " -Wb,-amdgpu-kernarg-preload-count=8 ";
}
#if defined(__clang__)
#if __has_feature(address_sanitizer)
opt += " -fsanitize=address ";
#endif
#endif
if ((retval = program_->build(devices, opt.c_str(), nullptr, nullptr, GPU_DUMP_BLIT_KERNELS))
!= CL_SUCCESS) {
DevLogPrintfError("Build failed for Kernel: %s with error code %d\n",