public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "weiguo.zhou at spreadtrum dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/67286] asan doen't work on Android(32bit ARM)
Date: Thu, 20 Aug 2015 10:24:00 -0000	[thread overview]
Message-ID: <bug-67286-4-zf2yoYyDT1@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-67286-4@http.gcc.gnu.org/bugzilla/>

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)


      parent reply	other threads:[~2015-08-20 10:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-20  6:09 [Bug sanitizer/67286] New: " 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
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
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
2015-08-20  9:37 ` weiguo.zhou at spreadtrum dot com
2015-08-20 10:24 ` weiguo.zhou at spreadtrum dot com [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-67286-4-zf2yoYyDT1@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).