Reland [lsan] Enable LSAN for Android

Authored by oontvoo on Nov 4 2020, 2:09 PM.


Reland [lsan] Enable LSAN for Android

Reland: a2291a58bf1c860d026581fee6fe96019dc25440.

New fixes for the breakages reported in D85927 include:

  • declare a weak decl for dl_iterate_phdr, because it does not exist on older APIs
  • Do not enable leak-sanitizer if api_level is less than 29, because of ld.lld: error: undefined symbol: __aeabi_read_tp for armv7, API level 16.
  • Put back the interceptor for memalign but still opt out intercepting __libc_memalign and cfree because both of these don't exist in Bionic.

Reviewed By: srhines, vitalybuka

Differential Revision: https://reviews.llvm.org/D89251