Created attachment 8375235 [details] [diff] [review] Patch The patch is contributed by Sylvain Defresne of Google. The original changelist is at https://codereview.chromium.org/159893002/.
pr/src/misc/prdtoa.c also contains some __arm__ code: http://mxr.mozilla.org/nspr/ident?i=IEEE_ARM We should review that code to see if it needs to be extended with __aarch64__.
Created attachment 8376618 [details] [diff] [review] First tested patch by Sylvain Defresne Sylvain Defresne tested these changes, so I checked them in first: https://hg.mozilla.org/projects/nspr/rev/645a941272f1 He also reported the following about two files he didn't change: nspr/pr/src/misc/prdtoa.c: Do not define IEEE_ARM when building for aarch64, as the IEEE implementation behaves as IEEE_8087 (setting IEEE_ARM cause the function PR_strtod to return incorrect values). nspr/pr/include/pratom.h: Do not use intrisincs __sync_add_and_fetch, __sync_sub_and_fetch and __sync_lock_test_and_set when building for aarch64 as support for those intrisics has not been tested (but it should be).
Created attachment 8376619 [details] [diff] [review] Patch for prbit.h I think this change to prbit.h should work, but it hasn't been tested. As for the PR_ATOMIC_* macros in pratom.h, I now think it may be better to define them using Apple's OSAtomic* functions rather than using compiler intrinsics. Apple recommends that we "Use the Built-in Synchronization Primitives" in the 64-Bit Transition Guide for Cocoa Touch: https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/ConvertingYourAppto64-Bit/ConvertingYourAppto64-Bit.html#//apple_ref/doc/uid/TP40013501-CH3-SW1