diff --git a/js/src/jsapi-tests/testGCAllocator.cpp b/js/src/jsapi-tests/testGCAllocator.cpp index 229e56422fdf..ec5407e8cca1 100644 --- a/js/src/jsapi-tests/testGCAllocator.cpp +++ b/js/src/jsapi-tests/testGCAllocator.cpp @@ -315,7 +315,7 @@ mapMemoryAt(void* desired, size_t length) #if defined(__ia64__) || defined(__aarch64__) || \ (defined(__sparc__) && defined(__arch64__) && (defined(__NetBSD__) || defined(__linux__))) - MOZ_RELEASE_ASSERT(0xffff800000000000ULL & (uintptr_t(desired) + length - 1) == 0); + MOZ_RELEASE_ASSERT((0xffff800000000000ULL & (uintptr_t(desired) + length - 1)) == 0); #endif void* region = mmap(desired, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); if (region == MAP_FAILED) diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp index 570674c14a26..4c8df7995b60 100644 --- a/js/src/jsmath.cpp +++ b/js/src/jsmath.cpp @@ -66,6 +66,8 @@ # define GETRANDOM_NR 318 # elif defined(__i386__) # define GETRANDOM_NR 355 +# elif defined(__aarch64__) +# define GETRANDOM_NR 278 # elif defined(__arm__) # define GETRANDOM_NR 384 // Added other architectures: diff --git a/js/src/jsnativestack.cpp b/js/src/jsnativestack.cpp index 05928ea3dff3..40b680231726 100644 --- a/js/src/jsnativestack.cpp +++ b/js/src/jsnativestack.cpp @@ -16,7 +16,7 @@ # include # endif -# if defined(ANDROID) +# if defined(ANDROID) && !defined(__aarch64__) # include # include # endif @@ -120,11 +120,11 @@ js::GetNativeStackBaseImpl() rc = pthread_stackseg_np(pthread_self(), &ss); stackBase = (void*)((size_t) ss.ss_sp - ss.ss_size); stackSize = ss.ss_size; -# elif defined(ANDROID) +# elif defined(ANDROID) && !defined(__aarch64__) if (gettid() == getpid()) { - // bionic's pthread_attr_getstack doesn't tell the truth for the main - // thread (see bug 846670). So we scan /proc/self/maps to find the - // segment which contains the stack. + // bionic's pthread_attr_getstack prior to API 21 doesn't tell the truth + // for the main thread (see bug 846670). So we scan /proc/self/maps to + // find the segment which contains the stack. rc = -1; // Put the string on the stack, otherwise there is the danger that it diff --git a/js/src/vm/TraceLogging.cpp b/js/src/vm/TraceLogging.cpp index c7bc6a84b2e9..82fdf7c77e8a 100644 --- a/js/src/vm/TraceLogging.cpp +++ b/js/src/vm/TraceLogging.cpp @@ -61,7 +61,7 @@ rdtsc(void) return result; } -#elif defined(__arm__) +#elif defined(__arm__) || defined(__aarch64__) #include diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp index 3f65bbb44f99..1ab76eeb4bd9 100644 --- a/js/src/wasm/WasmSignalHandlers.cpp +++ b/js/src/wasm/WasmSignalHandlers.cpp @@ -1374,6 +1374,7 @@ ProcessHasSignalHandlers() sTriedInstallSignalHandlers = true; #if defined(ANDROID) +# if !defined(__aarch64__) // Before Android 4.4 (SDK version 19), there is a bug // https://android-review.googlesource.com/#/c/52333 // in Bionic's pthread_join which causes pthread_join to return early when @@ -1385,6 +1386,7 @@ ProcessHasSignalHandlers() if (atol(version_string) < 19) return false; } +# endif # if defined(MOZ_LINKER) // Signal handling is broken on some android systems. if (IsSignalHandlingBroken())