I’ve recently found that in order to use ASAN on MLIR python extensions, I have to link the common CAPI .so with -shared-asan
(and then do the dance to LD_PRELOAD the right library when invoking Python) in order to avoid link errors in MLIR. While just hacking privately, I did this by adding this to add_mlir_aggregate
:
target_link_options(${name} PRIVATE -shared-libasan)
I could have sworn this used to work (without that). I went searching through the codebase to see where else we add -shared-libasan
and couldn’t find anything. I know @mehdi_amini has gotten this working before and I wonder if there is any state I am missing?
I’m on clang12. I’ve only previously used ASAN with Python extensions with gcc, so I suspect that might be part of the different experience. I’m not an ASAN expert…