This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sanitizer/67286] asan doen't work on Android(32bit ARM)


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]