<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 5, 2015 at 8:13 AM, Adhemerval Zanella <span dir="ltr"><<a href="mailto:adhemerval.zanella@linaro.org" target="_blank">adhemerval.zanella@linaro.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: azanella<br>
Date: Wed Aug  5 10:13:33 2015<br>
New Revision: 244054<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=244054&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=244054&view=rev</a><br>
Log:<br>
[asan] Enable asan for aarch64<br>
<br>
This patch enables asan for aarch64/linux.  It marks it as 'unstable-release',<br>
since some tests are failing due either kernel missing support of non-executable<br>
pages in mmap or environment instability (infinite loop in juno reference<br>
boards).<br>
<br>
It sets decorate_proc_maps test to require stable-release, since the test expects<br>
the shadow memory to not be executable and the support for aarch64 is only<br>
added recently by Linux (da141706aea52c1a9 - 4.0).<br>
<br>
It also XFAIL static_tls test for aarch64 linker may omit the __tls_get_addr call<br>
as a TLS optimization.<br>
<br>
Modified:<br>
    compiler-rt/trunk/cmake/config-ix.cmake<br>
    compiler-rt/trunk/lib/asan/asan_mapping.h<br>
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform.h<br>
    compiler-rt/trunk/test/asan/TestCases/Linux/read_binary_name_regtest.c<br>
    compiler-rt/trunk/test/asan/TestCases/Linux/static_tls.cc<br>
    compiler-rt/trunk/test/asan/lit.cfg<br>
    compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/decorate_proc_maps.cc<br>
<br>
Modified: compiler-rt/trunk/cmake/config-ix.cmake<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/config-ix.cmake?rev=244054&r1=244053&r2=244054&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/config-ix.cmake?rev=244054&r1=244053&r2=244054&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/cmake/config-ix.cmake (original)<br>
+++ compiler-rt/trunk/cmake/config-ix.cmake Wed Aug  5 10:13:33 2015<br>
@@ -254,10 +254,7 @@ filter_available_targets(LSAN_COMMON_SUP<br>
 filter_available_targets(UBSAN_COMMON_SUPPORTED_ARCH<br>
   ${SANITIZER_COMMON_SUPPORTED_ARCH})<br>
 filter_available_targets(ASAN_SUPPORTED_ARCH<br>
-  x86_64 i386 i686 powerpc64 powerpc64le arm mips mipsel mips64 mips64el)<br>
-if(ANDROID)<br>
-  filter_available_targets(ASAN_SUPPORTED_ARCH aarch64)<br>
-endif()<br>
+  x86_64 i386 i686 powerpc64 powerpc64le arm mips mipsel mips64 mips64el aarch64)<br>
 filter_available_targets(DFSAN_SUPPORTED_ARCH x86_64 mips64 mips64el aarch64)<br>
 filter_available_targets(LSAN_SUPPORTED_ARCH x86_64 mips64 mips64el)<br>
 filter_available_targets(MSAN_SUPPORTED_ARCH x86_64 mips64 mips64el)<br>
<br>
Modified: compiler-rt/trunk/lib/asan/asan_mapping.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_mapping.h?rev=244054&r1=244053&r2=244054&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_mapping.h?rev=244054&r1=244053&r2=244054&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/asan/asan_mapping.h (original)<br>
+++ compiler-rt/trunk/lib/asan/asan_mapping.h Wed Aug  5 10:13:33 2015<br>
@@ -73,6 +73,13 @@<br>
 // || `[0x2000000000, 0x23ffffffff]` || LowShadow  ||<br>
 // || `[0x0000000000, 0x1fffffffff]` || LowMem     ||<br>
 //<br>
+// Default Linux/AArch64 (39-bit VMA) mapping:<br>
+// || `[0x2000000000, 0x7fffffffff]` || highmem    ||<br>
+// || `[0x1400000000, 0x1fffffffff]` || highshadow ||<br>
+// || `[0x1200000000, 0x13ffffffff]` || shadowgap  ||<br>
+// || `[0x1000000000, 0x11ffffffff]` || lowshadow  ||<br>
+// || `[0x0000000000, 0x0fffffffff]` || lowmem     ||<br>
+//<br>
 // Shadow mapping on FreeBSD/x86-64 with SHADOW_OFFSET == 0x400000000000:<br>
 // || `[0x500000000000, 0x7fffffffffff]` || HighMem    ||<br>
 // || `[0x4a0000000000, 0x4fffffffffff]` || HighShadow ||<br>
<br>
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform.h?rev=244054&r1=244053&r2=244054&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform.h?rev=244054&r1=244053&r2=244054&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform.h (original)<br>
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform.h Wed Aug  5 10:13:33 2015<br>
@@ -130,7 +130,7 @@<br>
 #define SANITIZER_USES_UID16_SYSCALLS 0<br>
 #endif<br>
<br>
-#ifdef __mips__<br>
+#if defined(__mips__) || defined(__aarch64__)<br>
 # define SANITIZER_POINTER_FORMAT_LENGTH FIRST_32_SECOND_64(8, 10)<br>
 #else<br>
 # define SANITIZER_POINTER_FORMAT_LENGTH FIRST_32_SECOND_64(8, 12)<br>
<br>
Modified: compiler-rt/trunk/test/asan/TestCases/Linux/read_binary_name_regtest.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/read_binary_name_regtest.c?rev=244054&r1=244053&r2=244054&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/read_binary_name_regtest.c?rev=244054&r1=244053&r2=244054&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/test/asan/TestCases/Linux/read_binary_name_regtest.c (original)<br>
+++ compiler-rt/trunk/test/asan/TestCases/Linux/read_binary_name_regtest.c Wed Aug  5 10:13:33 2015<br>
@@ -14,6 +14,10 @@<br>
 #include <linux/filter.h><br>
 #include <linux/seccomp.h><br>
<br>
+#ifndef __NR_readlink<br>
+# define __NR_readlink __NR_readlinkat<br>
+#endif<br>
+<br>
 #define syscall_nr (offsetof(struct seccomp_data, nr))<br>
<br>
 void corrupt() {<br>
<br>
Modified: compiler-rt/trunk/test/asan/TestCases/Linux/static_tls.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/static_tls.cc?rev=244054&r1=244053&r2=244054&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/static_tls.cc?rev=244054&r1=244053&r2=244054&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/test/asan/TestCases/Linux/static_tls.cc (original)<br>
+++ compiler-rt/trunk/test/asan/TestCases/Linux/static_tls.cc Wed Aug  5 10:13:33 2015<br>
@@ -9,7 +9,7 @@<br>
 // CHECK: __tls_get_addr: static tls<br>
 // CHECK: after<br>
<br>
-// XFAIL: powerpc64<br>
+// XFAIL: powerpc64, aarch64<br>
<br>
 #ifndef SHARED<br>
 #include <stdio.h><br>
<br>
Modified: compiler-rt/trunk/test/asan/lit.cfg<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/lit.cfg?rev=244054&r1=244053&r2=244054&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/lit.cfg?rev=244054&r1=244053&r2=244054&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/test/asan/lit.cfg (original)<br>
+++ compiler-rt/trunk/test/asan/lit.cfg Wed Aug  5 10:13:33 2015<br>
@@ -164,7 +164,7 @@ config.substitutions.append( ("%xdynamic<br>
<br>
 # Allow tests to use REQUIRES=stable-runtime.  For use when you cannot use XFAIL<br>
 # because the test hangs.<br>
-if config.target_arch != 'arm':<br>
+if config.target_arch != 'arm' or config.target_arch != 'aarch64':<br>
   config.available_features.add('stable-runtime')<br>
<br>
 # Turn on leak detection on 64-bit Linux.<br>
<br>
Modified: compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/decorate_proc_maps.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/decorate_proc_maps.cc?rev=244054&r1=244053&r2=244054&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/decorate_proc_maps.cc?rev=244054&r1=244053&r2=244054&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/decorate_proc_maps.cc (original)<br>
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/decorate_proc_maps.cc Wed Aug  5 10:13:33 2015<br>
@@ -1,5 +1,6 @@<br>
 // RUN: %clangxx -g %s -o %t<br>
 // RUN: %tool_options=decorate_proc_maps=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%tool_name<br>
+// REQUIRES: stable-release<br></blockquote><div><br></div><div>^^</div><div>Did you mean to write "stable-runtime" here?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 #include <errno.h><br>
 #include <fcntl.h><br>
 #include <pthread.h><br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div></div>
</div></div>