This is an archive of the discontinued LLVM Phabricator instance.

[ASAN] Add support for mips/mips64 android
AbandonedPublic

Authored by slthakur on Mar 2 2016, 9:54 PM.

Details

Summary

Patch by Duane Sand

The mips32r2 build of asan_test runs cleanly with same result as for arm/arm64/x86: 3 failed subtests.
The mips64r6 asan_test fails early on a huge_malloc subtest without trying all tests. This is a bug in mips64 malloc, not in asan.

Diff Detail

Repository
rL LLVM

Event Timeline

slthakur updated this revision to Diff 49708.Mar 2 2016, 9:54 PM
slthakur retitled this revision from to [ASAN] Add support for mips/mips64 android.
slthakur updated this object.
slthakur added reviewers: kcc, samsonov.
slthakur set the repository for this revision to rL LLVM.
slthakur added subscribers: mohit.bhakkad, jaydeep.
samsonov added inline comments.
lib/sanitizer_common/sanitizer_linux.cc
595

You might introduce a separate #define that would tell you whether you're on 32-bit MIPS: it's better than
spraying defined(__mips__) && !defined(__mips64) and its negation throughout the code.

lib/sanitizer_common/sanitizer_platform_limits_posix.h
82

const unsigned struct_kernel_stat_sz = (SANITIZER_WORDSIZE == 64) ? 128 : 104;

you can use the same construct below.

527

Use #if defined() form where possible.

549

That's incredibly hard to understand. Can you keep one level of nested #if's somehow?

eugenis added inline comments.Mar 3 2016, 11:20 AM
lib/sanitizer_common/sanitizer_linux.cc
595

Yes. We don't really do that now, but we can start.
Smth like SANITIZER_MIPS (for either variant), SANITIZER_MIPS32, SANITIZER_MIPS64. In sanitizer_platform.h.

lib/sanitizer_common/sanitizer_platform_limits_posix.h
549

If mips32 is special, it could be worth duplicating the entire __sanitizer_sigaction definition just for that.

sagar is not available for a week, request you to please review this at D17883

slthakur abandoned this revision.Mar 17 2016, 11:03 PM