From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6452 invoked by alias); 20 Aug 2015 09:09:50 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 6244 invoked by uid 48); 20 Aug 2015 09:09:45 -0000 From: "weiguo.zhou at spreadtrum dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/67286] asan doen't work on Android(32bit ARM) Date: Thu, 20 Aug 2015 09:09:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: weiguo.zhou at spreadtrum dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-08/txt/msg01405.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67286 --- Comment #6 from weiguo.zhou --- (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