* [Bug sanitizer/67286] asan doen't work on Android(32bit ARM)
2015-08-20 6:09 [Bug sanitizer/67286] New: asan doen't work on Android(32bit ARM) zhouweiguo2008 at gmail dot com
@ 2015-08-20 6:13 ` zhouweiguo2008 at gmail dot com
2015-08-20 6:23 ` zhouweiguo2008 at gmail dot com
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: zhouweiguo2008 at gmail dot com @ 2015-08-20 6:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67286
--- Comment #1 from zhouweiguo2008 at gmail dot com ---
this bug had been fixed and validated with gcc 4.9.2 and gcc 5.2.0.
and the testcases (from external/compiler-rt/test/asan/TestCases) could be
running
normally on the 32-bit Android 5.0 phone.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug sanitizer/67286] asan doen't work on Android(32bit ARM)
2015-08-20 6:09 [Bug sanitizer/67286] New: asan doen't work on Android(32bit ARM) zhouweiguo2008 at gmail dot com
2015-08-20 6:13 ` [Bug sanitizer/67286] " zhouweiguo2008 at gmail dot com
@ 2015-08-20 6:23 ` zhouweiguo2008 at gmail dot com
2015-08-20 7:13 ` y.gribov at samsung dot com
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: zhouweiguo2008 at gmail dot com @ 2015-08-20 6:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67286
weiguo.zhou <zhouweiguo2008 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
--- Comment #2 from weiguo.zhou <zhouweiguo2008 at gmail dot com> ---
validated with gcc 4.9.2 and gcc 5.2.0.
and the testcases (from external/compiler-rt/test/asan/TestCases) could be
running
normally on the 32-bit Android 5.0 phone.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug sanitizer/67286] asan doen't work on Android(32bit ARM)
2015-08-20 6:09 [Bug sanitizer/67286] New: asan doen't work on Android(32bit ARM) zhouweiguo2008 at gmail dot com
2015-08-20 6:13 ` [Bug sanitizer/67286] " zhouweiguo2008 at gmail dot com
2015-08-20 6:23 ` zhouweiguo2008 at gmail dot com
@ 2015-08-20 7:13 ` y.gribov at samsung dot com
2015-08-20 8:53 ` dvyukov at google dot com
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: y.gribov at samsung dot com @ 2015-08-20 7:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67286
Yury Gribov <y.gribov at samsung dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |y.gribov at samsung dot com
--- Comment #3 from Yury Gribov <y.gribov at samsung dot com> ---
Does GCC even support ASan on Android i.e. builds libasan.so? That's news to
me.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug sanitizer/67286] asan doen't work on Android(32bit ARM)
2015-08-20 6:09 [Bug sanitizer/67286] New: asan doen't work on Android(32bit ARM) zhouweiguo2008 at gmail dot com
` (2 preceding siblings ...)
2015-08-20 7:13 ` y.gribov at samsung dot com
@ 2015-08-20 8:53 ` dvyukov at google dot com
2015-08-20 8:58 ` y.gribov at samsung dot com
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: dvyukov at google dot com @ 2015-08-20 8:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67286
--- Comment #4 from Dmitry Vyukov <dvyukov at google dot com> ---
Yes, asan should work on android/arm32. There is some ongoing work on arm64.
+eugeni can provide more details.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug sanitizer/67286] asan doen't work on Android(32bit ARM)
2015-08-20 6:09 [Bug sanitizer/67286] New: asan doen't work on Android(32bit ARM) zhouweiguo2008 at gmail dot com
` (3 preceding siblings ...)
2015-08-20 8:53 ` dvyukov at google dot com
@ 2015-08-20 8:58 ` y.gribov at samsung dot com
2015-08-20 9:09 ` weiguo.zhou at spreadtrum dot com
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: y.gribov at samsung dot com @ 2015-08-20 8:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67286
--- Comment #5 from Yury Gribov <y.gribov at samsung dot com> ---
(In reply to Dmitry Vyukov from comment #4)
> +eugeni can provide more details.
Please! E.g. how do you build compiler and runtime?
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug sanitizer/67286] asan doen't work on Android(32bit ARM)
2015-08-20 6:09 [Bug sanitizer/67286] New: asan doen't work on Android(32bit ARM) zhouweiguo2008 at gmail dot com
` (4 preceding siblings ...)
2015-08-20 8:58 ` y.gribov at samsung dot com
@ 2015-08-20 9:09 ` weiguo.zhou at spreadtrum dot com
2015-08-20 9:14 ` y.gribov at samsung dot com
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: weiguo.zhou at spreadtrum dot com @ 2015-08-20 9:09 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug sanitizer/67286] asan doen't work on Android(32bit ARM)
2015-08-20 6:09 [Bug sanitizer/67286] New: asan doen't work on Android(32bit ARM) zhouweiguo2008 at gmail dot com
` (5 preceding siblings ...)
2015-08-20 9:09 ` weiguo.zhou at spreadtrum dot com
@ 2015-08-20 9:14 ` y.gribov at samsung dot com
2015-08-20 9:17 ` weiguo.zhou at spreadtrum dot com
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: y.gribov at samsung dot com @ 2015-08-20 9:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67286
--- Comment #7 from Yury Gribov <y.gribov at samsung dot com> ---
(In reply to weiguo.zhou from comment #6)
> It seems Google's official docs indicate the asan only supported on Android
> with LLVM-based clang toolchain.
That was my impression as well.
> in the fact, it should be supported "well"
> on Android with gcc-based toolchain.
I'm not sure what you mean. Is ASan runtime (libasan.so) built when you build
Android cross-compiler? If it's not, then ASan is not supported by GCC on
Android.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug sanitizer/67286] asan doen't work on Android(32bit ARM)
2015-08-20 6:09 [Bug sanitizer/67286] New: asan doen't work on Android(32bit ARM) zhouweiguo2008 at gmail dot com
` (6 preceding siblings ...)
2015-08-20 9:14 ` y.gribov at samsung dot com
@ 2015-08-20 9:17 ` weiguo.zhou at spreadtrum dot com
2015-08-20 9:20 ` weiguo.zhou at spreadtrum dot com
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: weiguo.zhou at spreadtrum dot com @ 2015-08-20 9:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67286
--- Comment #8 from weiguo.zhou <weiguo.zhou at spreadtrum dot com> ---
(In reply to Yury Gribov from comment #5)
> (In reply to Dmitry Vyukov from comment #4)
> > +eugeni can provide more details.
>
> Please! E.g. how do you build compiler and runtime?
the keypoint to generate a gcc-based cross-compiler toolchain for android/arm32
as following:
1) generate an stage-1 cross-compile gcc toolchain with the existing native
gcc;
2) build the sysroot from scratch with the stage-1 cross-compile toolchain;
3) generate the final cross-compile gcc_toolchain with the corresponding
sysroot.
you can see the keypoint is that we should "create a right sysroot" for the
final cross-compile gcc-toolchain for android/arm32.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug sanitizer/67286] asan doen't work on Android(32bit ARM)
2015-08-20 6:09 [Bug sanitizer/67286] New: asan doen't work on Android(32bit ARM) zhouweiguo2008 at gmail dot com
` (7 preceding siblings ...)
2015-08-20 9:17 ` weiguo.zhou at spreadtrum dot com
@ 2015-08-20 9:20 ` weiguo.zhou at spreadtrum dot com
2015-08-20 9:26 ` y.gribov at samsung dot com
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: weiguo.zhou at spreadtrum dot com @ 2015-08-20 9:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67286
--- Comment #9 from weiguo.zhou <weiguo.zhou at spreadtrum dot com> ---
(In reply to Yury Gribov from comment #7)
> (In reply to weiguo.zhou from comment #6)
> > It seems Google's official docs indicate the asan only supported on Android
> > with LLVM-based clang toolchain.
>
> That was my impression as well.
>
> > in the fact, it should be supported "well"
> > on Android with gcc-based toolchain.
>
> I'm not sure what you mean. Is ASan runtime (libasan.so) built when you
> build Android cross-compiler? If it's not, then ASan is not supported by GCC
> on Android.
as I explained just now, after generate the final cross-compile toolchain for
android/arm32 successfully, the last step is generate the libasasn.so.2
with the final cross-compile toolchain(because the runtime detection asan
library should be running on real ARM32 board).
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug sanitizer/67286] asan doen't work on Android(32bit ARM)
2015-08-20 6:09 [Bug sanitizer/67286] New: asan doen't work on Android(32bit ARM) zhouweiguo2008 at gmail dot com
` (8 preceding siblings ...)
2015-08-20 9:20 ` weiguo.zhou at spreadtrum dot com
@ 2015-08-20 9:26 ` y.gribov at samsung dot com
2015-08-20 9:37 ` weiguo.zhou at spreadtrum dot com
2015-08-20 10:24 ` weiguo.zhou at spreadtrum dot com
11 siblings, 0 replies; 13+ messages in thread
From: y.gribov at samsung dot com @ 2015-08-20 9:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67286
--- Comment #10 from Yury Gribov <y.gribov at samsung dot com> ---
(In reply to weiguo.zhou from comment #9)
> as I explained just now, after generate the final cross-compile toolchain
> for android/arm32 successfully, the last step is generate the libasasn.so.2
How do you generate libasan.so?
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug sanitizer/67286] asan doen't work on Android(32bit ARM)
2015-08-20 6:09 [Bug sanitizer/67286] New: asan doen't work on Android(32bit ARM) zhouweiguo2008 at gmail dot com
` (9 preceding siblings ...)
2015-08-20 9:26 ` y.gribov at samsung dot com
@ 2015-08-20 9:37 ` weiguo.zhou at spreadtrum dot com
2015-08-20 10:24 ` weiguo.zhou at spreadtrum dot com
11 siblings, 0 replies; 13+ messages in thread
From: weiguo.zhou at spreadtrum dot com @ 2015-08-20 9:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67286
--- Comment #11 from weiguo.zhou <weiguo.zhou at spreadtrum dot com> ---
you can got the dynamic libasan.so.2 with following step:
../gcc-4.9.2-sprd/libsanitizer/configure --host=arm-linux-androideabi
--prefix=/tmp/toolchain-build-linux-4.9.2/prefix --enabl
e-shared --disable-static
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Bug sanitizer/67286] asan doen't work on Android(32bit ARM)
2015-08-20 6:09 [Bug sanitizer/67286] New: asan doen't work on Android(32bit ARM) zhouweiguo2008 at gmail dot com
` (10 preceding siblings ...)
2015-08-20 9:37 ` weiguo.zhou at spreadtrum dot com
@ 2015-08-20 10:24 ` weiguo.zhou at spreadtrum dot com
11 siblings, 0 replies; 13+ messages in thread
From: weiguo.zhou at spreadtrum dot com @ 2015-08-20 10:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67286
--- Comment #12 from weiguo.zhou <weiguo.zhou at spreadtrum dot com> ---
(In reply to weiguo.zhou from comment #8)
> (In reply to Yury Gribov from comment #5)
> > (In reply to Dmitry Vyukov from comment #4)
> > > +eugeni can provide more details.
> >
> > Please! E.g. how do you build compiler and runtime?
>
>
> the keypoint to generate a gcc-based cross-compiler toolchain for
> android/arm32 as following:
>
> 1) generate an stage-1 cross-compile gcc toolchain with the existing native
> gcc;
> 2) build the sysroot from scratch with the stage-1 cross-compile toolchain;
> 3) generate the final cross-compile gcc_toolchain with the corresponding
> sysroot.
>
>
> you can see the keypoint is that we should "create a right sysroot" for the
> final cross-compile gcc-toolchain for android/arm32.
1) generate an stage-1 cross-compile gcc toolchain with the existing native
gcc;
2) build the sysroot from scratch with the stage-1 cross-compile toolchain;
3) generate the final cross-compile gcc_toolchain (with --enable-libsanitizer
option) with the corresponding sysroot;so the final cross-compile could
instrument the check code according to the excellent paper
<<address_sanity_checker.pdf>>;
4) reset the PATH environment variable, the generate the libasan.so.2 with the
final cross-compile gcc-toolchain:
mkdir libasan-for-android-build
cd libasan-for-android-build
../gcc-source-tree/libsanitizer/configure --host=arm-linux-androideabi
--prefix=/tmp/toolchain-build-linux-4.9.2/prefix --enable-shared
--disable-static
don't use any cross-tool like utility here. we should "create anything we need
from scratch".
Thanks to great Google, the powerful AddressSanitizer, and the excellent
creator of the AddressSantizer.(kcc and other greate engineer in Google)
^ permalink raw reply [flat|nested] 13+ messages in thread