Compiling XNU with HWASan (KASAN) on macOS arm64e

Hello,

I'm trying to build XNU with KASAN support. However I get error:

clang: error: unsupported option '-fsanitize=kernel-hwaddress' for target 'arm64e-apple-darwin23.2.0'

If I try to compile a non-kernel C code with -fsanitize=hwaddress, I get the same target error.

But Apple ships HWASan kernels with KDK, which shows there is a clang which is capable of compiling hwasan code for arm64e.

How can we compile hwasan sanitized code ourselves? Is it a private toolchain or released somewhere?

Compiling XNU with HWASan (KASAN) on macOS arm64e
 
 
Q