mimalloc
mimalloc copied to clipboard
Linux + ASAN + MI_TRACK_ASAN + MI_OVERRIDE + static linking
Hi! Is this use-case supported? If I enable ASAN + MI_OVERRIDE, I seem to not be able to compile executable b.c. of such errors:
[1] ld.lld: error: duplicate symbol: operator delete[](void*)
[1] >>> defined at asan_new_delete.cpp.o:(operator delete[](void*)) in archive /usr/lib/llvm-12/lib/clang/12.0.1/lib/linux/libclang_rt.asan_cxx-x86_64.a
[1] >>> defined at alloc-override.c:193 (mimalloc/src/alloc-override.c:193)
[1] >>> CMakeFiles/mimalloc-static.dir/src/alloc.c.o:(.text+0x750) in archive mimalloc/libmimalloc-asan-optimized.a
Seems like libclang_rt.asan_cxx-x86_64.a is linked by clang itself. I tried work-around it by linking to the mimalloc's object file (as opposed to the static lib), but also didn't work when combined with "-fsanitize=address".