[PATCH] AArch64 sanitizer support
Christophe Lyon
christophe.lyon at linaro.org
Tue Feb 11 02:27:50 PST 2014
================
Comment at: libsanitizer/sanitizer_common/sanitizer_linux.cc:96
@@ -95,1 +95,3 @@
uptr internal_open(const char *filename, int flags) {
+#ifdef __aarch64__
+ return internal_syscall(__NR_openat, AT_FDCWD, (uptr)filename, flags);
----------------
Kostya Serebryany wrote:
> OMG, these ifdefs again...
> What is so special about AArch64 that it needs other syscalls
> (where ARM/PowerPC/SPARC/MIPS doesn't need them)?
> If there is no way to avoid these ifdefs, they at least deserve a top-level comment in this file.
>
I discussed that a while ago with AArch64 maintainers, here is what they said:
> The AArch64 linux port uses the canonical syscall set as mandated by
> the upstream linux community for all new ports. The system calls are
> not missing, rather, other architectures are using legacy syscalls ;-)
================
Comment at: libsanitizer/sanitizer_common/sanitizer_platform.h:80
@@ -75,2 +79,3 @@
// but will consume more memory for TwoLevelByteMap.
-#define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 47)
+#if defined(__aarch64__)
+# define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 39)
----------------
Kostya Serebryany wrote:
> (begging pardon for my ignorance)
> Is __aarch64__ available in 32-bit mode? Or is it __arm__ then?
> Why not just
> #define SANITIZER_MMAP_RANGE_SIZE (1ULL << 39)
> ?
I think it depends :-)
There is an ILP32 mode on AArch64 (which I haven't tested... oops).
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.
http://llvm-reviews.chandlerc.com/D2732
More information about the llvm-commits
mailing list