This produces a seemingly-working dynamic (x64-only) asan dylib on macOS and static libraries on Linux.
I've had this sitting in a branch for a long time and wanted to get check-asan working before landing it, but smaller patches and fewer local branches is probably better.