[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",