From c27ee21dd919170df1720a257494a6401f3a081e Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Sun, 30 Nov 2014 01:07:12 -0600 Subject: [PATCH] [AArch64] Workaround builtin byteswap bug. The builtin byteswap routines cause critical failure on AArch64 when built with the Android toolchain. I didn't experience this issue when building for Linux using a local qemu chroot. Seems to be only an issue with the Android toolchain when building AArch64. Use our generic version instead. --- Source/Core/Common/CommonFuncs.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Core/Common/CommonFuncs.h b/Source/Core/Common/CommonFuncs.h index cf197ef660..91d24ec775 100644 --- a/Source/Core/Common/CommonFuncs.h +++ b/Source/Core/Common/CommonFuncs.h @@ -194,7 +194,9 @@ inline u64 swap64(u64 _data) {return _byteswap_uint64(_data);} inline u16 swap16 (u16 _data) { u32 data = _data; __asm__ ("rev16 %0, %1\n" : "=l" (data) : "l" (data)); return (u16)data;} inline u32 swap32 (u32 _data) {__asm__ ("rev %0, %1\n" : "=l" (_data) : "l" (_data)); return _data;} inline u64 swap64(u64 _data) {return ((u64)swap32(_data) << 32) | swap32(_data >> 32);} -#elif __linux__ +#elif __linux__ && !(ANDROID && _M_ARM_64) +// Android NDK r10c has broken builtin byte swap routines +// Disabled for now. inline u16 swap16(u16 _data) {return bswap_16(_data);} inline u32 swap32(u32 _data) {return bswap_32(_data);} inline u64 swap64(u64 _data) {return bswap_64(_data);}