2018-03-03 21:14 GMT+08:00 Hans-Peter Nilsson <hans-peter.nils...@axis.com>:

> > From: Jean Lee <xiaoyur...@gmail.com>
> > Date: Fri, 2 Mar 2018 13:29:39 +0800
>
> > 2018-03-02 7:53 GMT+08:00 Hans-Peter Nilsson <
> hans-peter.nils...@axis.com>:
> >
> > > There's no address-sanitizer support for MIPS (in particular for
> > > O32) on trunk, at least not when building for
> > > mipsisa32r2el-linux-gnu and libsanitizer/configure.tgt seems
> > > to support that observation.  There's a set of patches "floating
> > > around", but the last sign of work-in-progress was more than
> > > four years ago, according to a well-known search engine.
> > >
> > > Is there something holding it up getting it into trunk gcc?
> > > Is it just that someone needs to go the last mile?
> > >
> > > I can do that.  I can even go two miles!  Maybe even a merge
> > > from compiler-rt and MIPS port hacking (to be merged post
> > > gcc-8-branch to trunk, I presume).
> > >
> > > I'm a little worried that the "patches floating around" have
> > > unclear copyright status, so I haven't looked at them yet.  I'd
> > > rather not re-do MIPS ASAN on the gcc-side from scratch, but if
> > > it comes to that, so be it.
> > >
> > > brgds, H-P
> > >
> >
> > It is great to go the last mile. I had done the port  to
> > mipsel-linux-uclibc gcc for GCC 4.9/5.0/6.0.
> > Maybe I can give some help for you.
>
> That would be great, thanks in advance!
>
> First a few troublesome questions:
>
> Are you the sole copyright owner of the patches to gcc that you
> know of?  (Not including compiler-rt patches, those are for the
> compiler-rt people to worry about; I don't know their process.)
>
> If so, have you copyright assignment paper work in progress
> done or in progress with the FSF for gcc?  (From what I can
> tell, if so, it's not completed.)  If not, it'd be great if you
> can get that started, it takes quite a while.
>
> I believe that's necessary for gcc-specific parts, but I don't
> really decide that.  But, if those patches are small enough to
> not requiring paperwork they're probably also uninteresting
> enough that I add them as I go by.
>

My port of MIPS uclibc libsanitizer of gcc-6.x is now put in github.
https://github.com/xiaoyur347/sanitizer/
Much work was done to fix uclibc not MIPS.
If you just need MIPS, maybe two patches are needed.

1.
https://github.com/xiaoyur347/sanitizer/commit/016a8187c47f58de9b059eb77aa00e066aae309c
for gcc/config
2. libsanitizer/configure.tgt
+ mipsel-*-linux*)
    ;;
3.  Other works are for stack unwind, if the stack unwind doesn't call
malloc() at all, it will be easy.


> > Let's do the last mile.
> > To do this, I have some questions.
> > Should we port to the upstream LLVM first and port them back to GCC?
>
> I have no interest in LLVM at present, and can't wait, so:
> no, not on my behalf.
>
> But the question makes me wonder: are you implying that ASAN
> support for MIPS (O32 little-endian) isn't in upstream
> Clang/LLVM *too* or do I misunderstand you?  I'm not sure how to
> tell myself (save for building it from scratch and trying it,
> which I haven't done).
>
> *searches the web again...*
>
> It's not mentioned on
> <http://clang.llvm.org/docs/AddressSanitizer.html>, but that
> page seems out-of-date (known working platforms not mentioned).
> It's mentioned on
> <https://github.com/google/sanitizers/wiki/AddressSanitizer> so
> maybe I concluded that since MIPS O32 support is not yet in GCC,
> it must have been developed using LLVM.  I thought I saw reviews
> for 3+ year accepted patches, but looking closer that must have
> been mips64 support.
>
> Thanks again for your support!
>
> brgds, H-P
>

Reply via email to