Please see: https://marc.info/?l=wine-devel&m=174715050805731 as well as the commit messages for more information.
grrr, i forgot one thing in the email. all the asan runtime does is basically reading and writing the shadow memory. crossing the unix call boundary just to read/write memory seems to costly, so the same code is compiled once for each side. this is done by putting it in headers then include them from PE and unix. i don't know if there is a better option.
It's probably not a good idea to add asan exports unconditionally: it might conflict with userland apps for example.
It's probably better to add `__asan_` thunks to winecrt0, which will discover corresponding ntdll functions via some hidden channel and dispatch to them as necessary.
On Tue May 13 21:20:04 2025 +0000, Jinoh Kang wrote:
It's probably not a good idea to add asan exports unconditionally: it might conflict with userland apps for example. It's probably better to add `__asan_` thunks to winecrt0, which will discover corresponding ntdll functions via some hidden channel and dispatch to them as necessary.
For DLLs that don't link to winecrt0 due to -nostartfiles, I'm guessing we could add the thunk source directly to SOURCES. Either that, or we could make our own asan thunk static library (like `clang_rt.asan_dll_thunk-i386.lib` but our own).