Correction. ASN means ASAN of course. :-)
--
You received this message because you are subscribed to the Google Groups "address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to address-sanitizer+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sagar, Simon,Could you please consult on ASAN for MIPS?
On Fri, Oct 14, 2016 at 3:04 PM, Park Kit <keite...@gmail.com> wrote:
Correction. ASN means ASAN of course. :-)
--
You received this message because you are subscribed to the Google Groups "address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to address-saniti...@googlegroups.com.
Hi Sagar,
Many thanks for a reply. Although I am seeking to have GCC cross compile working, it would be great to know that ASAN builds for mips on clang.
But "ninja install" does not copy the sanitizer runtime libs in the install directory. So you will have to copy them to the install directory manually.
Regarding GCC's ASAN support for MIPS, as Maxim said we will have to add support for it following the steps he mentioned.
Regards,
Sagar
Hi Sagar, Maxim,
Appreciated for your try and comments.
@Sagar, your steps are bit different from what I followed so will give it a try to build. This confirms at least ASAN works for cross-compile on MIPS and which is great.
@Maxim, you're right on 2) and that's what I did. Have you used the buildroot to build cross-compile GCC on MIPS or used GCC package only? What version have you used? Would you mind showing command lines to configure and to build it?
--
You received this message because you are subscribed to a topic in the Google Groups "address-sanitizer" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/address-sanitizer/A5iPCUDa7YM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to address-sanitizer+unsubscribe@googlegroups.com.
25 Ноя 2016 г. 20:23 пользователь "Park Kit" <keite...@gmail.com> написал:
>
> Hi Maxim,
Hi
>
> Really appreciated for the link which works for me when follows exactly. However, I am seeing two differences from you when trying to build ASAN:
>
> 1. Used the same glibc version but no error on a machine I use.
> 2. When either use a libsanitizer/configure.tgt tweak or --enable-libsanitizer, "make all-gcc" doesn't build "libsanitizer
Try to do "make -j12" instead of "make all-gcc". If that doesn't work, rebuild GCC from the scratch:
1) rm -rf *
2) configure ...
3) make -j12
Make sure you added 'mips-linux' entry in configure.tgt.
>> To unsubscribe from this group and all its topics, send an email to address-saniti...@googlegroups.com.
>> To unsubscribe from this group and all its topics, send an email to address-sanitizer+unsubscribe@googlegroups.com.
25 Ноя 2016 г. 21:41 пользователь "Park Kit" <keite...@gmail.com> написал:
>
> Hi Maxim,
>
> Still didn't build. The problem as far as I see, is "libgcc" since it should done in later steps(according to the reference) and it fails to build but when use all-gcc target, it didn't build libgcc so not a problem in this case. But "make" tries to build libgcc and failed.
Ah, no, you should do all 7 steps from the reference and just after that rebuild GCC like this:
1) rm - rf *
2) configure ... (from step 3)
3) make - j12
You should not have problems with libgcc on that step (after you did all 7 steps from the reference).
>
> The steps I did are:
>
> 946 2016-11-25 17:26:18 export PATH=~/asn/install-4.8.2/bin:$PATH # to add binutil to the path
> 947 2016-11-25 17:26:29 rm -rf *
> 949 2016-11-25 17:26:42 ../gcc-4.8.2/configure -C --prefix=/xx/asn/install-4.8.2 --target=mips-linux --enable-languages=c,c++ --disable-multilib --enable-libsanitizer
> 951 2016-11-25 17:26:57 make -j12
>
> Of course, have a tweak in configure.tgt.
>
> From configure log, ASAN wasn't filtered out but didn't get built.
>
> *** This configuration is not supported in the following subdirectories:
> target-libitm gnattools target-libada target-libgfortran target-libgo target-libffi target-libbacktrace target-zlib target-libjava target-libobjc target-boehm-gc
> (Any other directories should still work fine.)
>
> BTW, what did you mean by "rebuild GCC from the scratch"? Since use a separate build directory, step 1 and 2 in your reply would suffice. Anything missed or you meant something different?
>
I mean you can do step 3 replacing ' make -j4 all-gcc' with 'make -j4'.
>> >> To unsubscribe from this group and all its topics, send an email to address-saniti...@googlegroups.com.
>> >> To unsubscribe from this group and all its topics, send an email to address-sanitizer+unsubscribe@googlegroups.com.
You're right. Have managed to have ASAN in build step. Very appreciated for your advice up until now. However, found two things to check:1. You said you used GCC trunk and I am trying out GCC 4.8.2. See differences between them in applying patches you sent and build error such as
../../../../gcc-4.8.2/libsanitizer/asan/asan_linux.cc:90:3: error: #error "Unsupported arch"
# error "Unsupported arch"
^But think can do "back-port" this part from the trunk or 4.9.2.
2. As advised, when done build again in step 3 to build ASAN, shall I run the rest step again to install all such as step 4-7 as the reference or do install only in step 3? Checking before doing the former, full steps afterwards.
Hi Maxim,
Once done 3) make - j12 from step 3, run 'make install' which is different from step 2 in the reference. Have set rpath to dismiss link errors:
/home/NDS-UK/kyoupark/asn/install-4.8.2/bin/../lib/gcc/mips-linux/4.8.2/../../../../mips-linux/bin/ld: warning: libpthread.so.0, needed by /home/NDS-UK/kyoupark/asn/install-4.8.2/bin/../lib/gcc/mips-linux/4.
8.2/../../../../mips-linux/lib/libasan.so, not found (try using -rpath or -rpath-link)
/home/NDS-UK/kyoupark/asn/install-4.8.2/bin/../lib/gcc/mips-linux/4.8.2/../../../../mips-linux/bin/ld: warning: libdl.so.2, needed by /home/NDS-UK/kyoupark/asn/install-4.8.2/bin/../lib/gcc/mips-linux/4.8.2/.
./../../../mips-linux/lib/libasan.so, not found (try using -rpath or -rpath-link)
/home/NDS-UK/kyoupark/asn/install-4.8.2/bin/../lib/gcc/mips-linux/4.8.2/../../../../mips-linux/bin/ld: warning: libstdc++.so.6, needed by /home/NDS-UK/kyoupark/asn/install-4.8.2/bin/../lib/gcc/mips-linux/4.8
.2/../../../../mips-linux/lib/libasan.so, not found (try using -rpath or -rpath-link)
/home/NDS-UK/kyoupark/asn/install-4.8.2/bin/../lib/gcc/mips-linux/4.8.2/../../../../mips-linux/bin/ld: warning: libm.so.6, needed by /home/NDS-UK/kyoupark/asn/install-4.8.2/bin/../lib/gcc/mips-linux/4.8.2/..
/../../../mips-linux/lib/libasan.so, not found (try using -rpath or -rpath-link)
/home/NDS-UK/kyoupark/asn/install-4.8.2/bin/../lib/gcc/mips-linux/4.8.2/../../../../mips-linux/lib/libasan.so: undefined reference to `pthread_attr_getstack@GLIBC_2.2'
/home/NDS-UK/kyoupark/asn/install-4.8.2/bin/../lib/gcc/mips-linux/4.8.2/../../../../mips-linux/lib/libasan.so: undefined reference to `pthread_setspecific@GLIBC_2.0'
/home/NDS-UK/kyoupark/asn/install-4.8.2/bin/../lib/gcc/mips-linux/4.8.2/../../../../mips-linux/lib/libasan.so: undefined reference to `dlsym@GLIBC_2.0'
/home/NDS-UK/kyoupark/asn/install-4.8.2/bin/../lib/gcc/mips-linux/4.8.2/../../../../mips-linux/lib/libasan.so: undefined reference to `pthread_key_create@GLIBC_2.0'
/home/NDS-UK/kyoupark/asn/install-4.8.2/bin/../lib/gcc/mips-linux/4.8.2/../../../../mips-linux/lib/libasan.so: undefined reference to `pthread_getspecific@GLIBC_2.0'
/home/NDS-UK/kyoupark/asn/install-4.8.2/bin/../lib/gcc/mips-linux/4.8.2/../../../../mips-linux/lib/libasan.so: undefined reference to `pthread_getattr_np@GLIBC_2.2.3'
collect2: error: ld returned 1 exit statusHowever, still gets this when do:
$ ./bin/mips-linux-gcc-4.8.2 -fsanitize=address -Wl,-rpath=/home/NDS-UK/kyoupark/asn/install-4.8.2/mips-linux/lib ~/asn/x.c
/home/nds-uk/kyoupark/asn/x.c:1:0: warning: -fsanitize=address not supported for this target [enabled by default]
#include <stdio.h>
^
$
Щастлива Коледа
Kit
Hi Maxim,
Sorry for a slow response since I took some time to check ASAN's working on a target platform. Thanks to your help, have managed to build ASAN with uclibc and builds fine. However, gets a seg fault when runs it on a target:
#1 0x2aabf414 in __pthread_initialize_minimal_internal () from /home/xxx/asan/mips-libs-from-build/libpthread.so.0
#2 0x2ab36874 in __uClibc_init () from /home/xxx/asan/mips-libs-from-build/libc.so.0Tried different uclibc version but no luck yet. Will try more and keep you updated on that.
Many thanks andЩастлива Коледа
To unsubscribe from this group and stop receiving emails from it, send an email to address-sanitizer+unsubscribe@googlegroups.com.