[Bug sanitizer/67286] asan doen't work on Android(32bit ARM)
weiguo.zhou at spreadtrum dot com
gcc-bugzilla@gcc.gnu.org
Thu Aug 20 09:09:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67286
--- Comment #6 from weiguo.zhou <weiguo.zhou at spreadtrum dot com> ---
(In reply to Dmitry Vyukov from comment #4)
> Yes, asan should work on android/arm32. There is some ongoing work on arm64.
> +eugeni can provide more details.
according to official documents on Google's site:
https://code.google.com/p/address-sanitizer/wiki/Android
Android
How to use AddressSanitizer on Android
Updated Jul 20, 2015 by euge...@google.com
NOTE: this document is about running Android applications built with the NDK
under AddressSanitizer. For information about using AddressSanitizer on Android
platform components, see AndroidPlatform.
NOTE: ASan is broken on Android L. Use a K* build. This will be fixed in one of
the future L updates (or the current AOSP master branch).
NOTE: AddressSanitizer on Android requires a rooted device (either -eng or
-userdebug build, or any other setup that allows editing the contents of the
/system partition).
Android NDK supports AddressSanitizer on arm, armv7 and x86 ABIs starting with
version r10d.
It seems Google's official docs indicate the asan only supported on Android
with LLVM-based clang toolchain. in the fact, it should be supported "well" on
Android with gcc-based toolchain.
the keypoint to enable asan running well with gcc-based toolchain on Android as
following:
1)build a cross-compile toolchain for ARM-32 Android system;
2)disable -Os optimization options in Android build system; becase the asan
pass
must be called in the GCC's internal to handle GENERIC/GIMPLY transformation;
3)modify the code in the gcc-4.9.2/config/arm/arm.c
More information about the Gcc-bugs
mailing list