MinGW-w64's gcc and Address Sanitizer

2020-02-25 07:46发布

问题:

Installing MinGW-w64 5.1 I find -fsanitize=address is available. It compiles fine, and when it starts linking I get thousands of:

undefined reference to '__asan_report_load1'
undefined reference to '__asan_report_load4'

I googled and found libasan referenced various places, but also comments that when you include -fsanitize=address it automatically includes that library for linking. I searched the MinGW-w64 5.1 install dirctory for "asan" and it was not found anywhere.

What do I need to add on to use address sanitizing features in MinGW-w64? Thank you.

回答1:

I've looked quickly into release notes for 4.8, 4.9 and 5.1 - ASAN is not available for Windows