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.
I feel like I'm still missing something here. The comment above says to change it to 31 when that is available. Making this a number where it doesn't work will break our NDK release process until 31 is available (next year). I'm not ok with that. If you have features that you're testing for the future, that testing should be the one reverting/modifying patches, not the NDK itself (which is what I would likely have to do if I accept this patch based on the explanation in the comment).