[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
committed by Krishna Sankisa
コミット 3bcd901f06
3個のファイルの変更、16行の追加、0行の削除
+7
ファイルの表示
@@ -1275,6 +1275,13 @@ OPTION(OT_UINT32, \
5, 4, 5, NULL, \ 5, 4, 5, NULL, \
"Specify code object ABI version. Allowed values are 4, and 5. Defaults to 5. (COMGR only)") "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 Do not remove the following line. Any option should be
added above this line. added above this line.
+4
ファイルの表示
@@ -1005,6 +1005,10 @@ processOption(int OptDescTableIx, Options& Opts, const std::string& Value,
break; break;
case OID_FSanitize:
if (sval != NULL)
Opts.clangOptions.push_back("-fsanitize=" + std::string(sval));
break;
default: default:
break; break;
} }
+5
ファイルの表示
@@ -576,6 +576,11 @@ bool Device::BlitProgram::create(amd::Device* device, const std::string& extraKe
if (device->settings().kernel_arg_opt_) { if (device->settings().kernel_arg_opt_) {
opt += " -Wb,-amdgpu-kernarg-preload-count=8 "; 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)) if ((retval = program_->build(devices, opt.c_str(), nullptr, nullptr, GPU_DUMP_BLIT_KERNELS))
!= CL_SUCCESS) { != CL_SUCCESS) {
DevLogPrintfError("Build failed for Kernel: %s with error code %d\n", DevLogPrintfError("Build failed for Kernel: %s with error code %d\n",