<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 11, 2014 at 2:27 PM, Christophe Lyon <span dir="ltr"><<a href="mailto:christophe.lyon@linaro.org" target="_blank">christophe.lyon@linaro.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><br>
<br>
================<br>
Comment at: libsanitizer/sanitizer_common/sanitizer_linux.cc:96<br>
@@ -95,1 +95,3 @@<br>
 uptr internal_open(const char *filename, int flags) {<br>
+#ifdef __aarch64__<br>
+  return internal_syscall(__NR_openat, AT_FDCWD, (uptr)filename, flags);<br>
----------------<br>
</div><div class="">Kostya Serebryany wrote:<br>
> OMG, these ifdefs again...<br>
> What is so special about AArch64 that it needs other syscalls<br>
> (where ARM/PowerPC/SPARC/MIPS doesn't need them)?<br>
> If there is no way to avoid these ifdefs, they at least deserve a top-level comment in this file.<br>
><br>
</div>I discussed that a while ago with AArch64 maintainers, here is what they said:<br>
<br>
> The AArch64 linux port uses the canonical syscall set as mandated by<br>
> the upstream linux community for all new ports.  The system calls are<br>
> not missing, rather, other architectures are using legacy syscalls ;-)<br></blockquote><div><br></div><div>Good to know. instead of using #ifdef __aarch64__ we can </div><div>use #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS </div>
<div>and define it in sanitizer_common/sanitizer_platform.h:</div><div><br></div>// The AArch64 linux port uses the canonical syscall set as mandated by</div><div class="gmail_quote">// the upstream linux community for all new ports. Other ports may still </div>
<div class="gmail_quote">// use legacy syscalls. <or something like this><br><div>#ifndef SANITIZER_USES_CANONICAL_LINUX_SYSCALLS</div><div>#ifdef __aarch64__</div><div>#define SANITIZER_USES_CANONICAL_LINUX_SYSCALLS 1<br>
</div><div>#else</div><div>#define SANITIZER_USES_CANONICAL_LINUX_SYSCALLS 0<br></div><div>#endif</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class=""><br>
<br>
<br>
================<br>
Comment at: libsanitizer/sanitizer_common/sanitizer_platform.h:80<br>
@@ -75,2 +79,3 @@<br>
 // but will consume more memory for TwoLevelByteMap.<br>
-#define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 47)<br>
+#if defined(__aarch64__)<br>
+# define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 39)<br>
----------------<br>
</div><div class="">Kostya Serebryany wrote:<br>
> (begging pardon for my ignorance)<br>
> Is __aarch64__ available in 32-bit mode? Or is it __arm__ then?<br>
> Why not just<br>
> #define SANITIZER_MMAP_RANGE_SIZE (1ULL << 39)<br>
> ?<br>
</div>I think it depends :-)<br>
There is an ILP32 mode on AArch64 (which I haven't tested... oops).<br></blockquote><div>ok </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
But in fact the ARMv8 architectures supports two modes of operation: AArch64 and AArch32, both of which are supported by two different compilers (at least in GCC): aarch64-gcc and arm-XXX-gcc, where you want to use -march=armv8-a for instance.<br>

<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D2732" target="_blank">http://llvm-reviews.chandlerc.com/D2732</a><br>
</blockquote></div><br></div></div>