diff --git a/iree/compiler/Dialect/HAL/Target/LLVM/BUILD b/iree/compiler/Dialect/HAL/Target/LLVM/BUILD index 3224513f971e..252ac5a7ff15 100644 --- a/iree/compiler/Dialect/HAL/Target/LLVM/BUILD +++ b/iree/compiler/Dialect/HAL/Target/LLVM/BUILD @@ -74,6 +74,7 @@ cc_library( ":LLVMTargetOptions", "@llvm-project//llvm:Analysis", "@llvm-project//llvm:Core", + "@llvm-project//llvm:Instrumentation", "@llvm-project//llvm:Passes", "@llvm-project//llvm:Support", "@llvm-project//llvm:Target", diff --git a/iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt b/iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt index ed3cdd843110..9dd8681035dc 100644 --- a/iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt +++ b/iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt @@ -62,6 +62,7 @@ iree_cc_library( ::LLVMTargetOptions LLVMAnalysis LLVMCore + LLVMInstrumentation LLVMPasses LLVMSupport LLVMTarget diff --git a/iree/hal/local/loaders/BUILD b/iree/hal/local/loaders/BUILD index 6d95993477bb..8c711c3d258e 100644 --- a/iree/hal/local/loaders/BUILD +++ b/iree/hal/local/loaders/BUILD @@ -32,6 +32,7 @@ cc_library( ], deps = [ "//iree/base:api", + "//iree/base:core_headers", "//iree/base:dynamic_library", "//iree/base:flatcc", "//iree/base:tracing", diff --git a/iree/hal/local/loaders/CMakeLists.txt b/iree/hal/local/loaders/CMakeLists.txt index 217e6283fdb1..9c9ab4315bfc 100644 --- a/iree/hal/local/loaders/CMakeLists.txt +++ b/iree/hal/local/loaders/CMakeLists.txt @@ -23,6 +23,7 @@ iree_cc_library( "legacy_library_loader.cc" DEPS iree::base::api + iree::base::core_headers iree::base::dynamic_library iree::base::flatcc iree::base::internal::file_io diff --git a/iree/hal/local/loaders/legacy_library_loader.cc b/iree/hal/local/loaders/legacy_library_loader.cc index 7e59cfb3521d..c3e9cc7c8460 100644 --- a/iree/hal/local/loaders/legacy_library_loader.cc +++ b/iree/hal/local/loaders/legacy_library_loader.cc @@ -85,15 +85,20 @@ static iree_status_t iree_hal_dylib_executable_flatbuffer_verify( switch (iree_DyLibExecutableDef_sanitized_kind_get(executable_def)) { case iree_SanitizerKind_None: break; - case iree_SanitizerKind_Address: { - if (!IREE_SANITIZER_ADDRESS) { - return iree_make_status( - IREE_STATUS_UNAVAILABLE, - "Dynamic library executable is compiled with ASAN support, but " - "this host application failed to enable ASAN to load this " - "executable"); - } - } break; +#if !defined(IREE_SANITIZER_ADDRESS) + case iree_SanitizerKind_Address: + return iree_make_status( + IREE_STATUS_UNAVAILABLE, + "Executable library is compiled with ASAN support but the host " + "runtime is not compiled with it enabled; add -fsanitize=address to " + "the runtime compilation options"); +#endif // !IREE_SANITIZER_ADDRESS + default: + return iree_make_status( + IREE_STATUS_UNAVAILABLE, + "Executable library requires a sanitizer the host runtime is not " + "compiled to enable/understand: %u", + (uint32_t)iree_DyLibExecutableDef_sanitized_kind_get(executable_def)); } return iree_ok_status();