diff options
Diffstat (limited to 'crypto/aes/CMakeLists.txt')
-rw-r--r-- | crypto/aes/CMakeLists.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crypto/aes/CMakeLists.txt b/crypto/aes/CMakeLists.txt index 04705856..7ec24b48 100644 --- a/crypto/aes/CMakeLists.txt +++ b/crypto/aes/CMakeLists.txt @@ -1,4 +1,5 @@ include_directories(../../include) +option(ENABLE_NDK_ARM_WORKAROUND "Enable workaround for clang compiler in NDK r18+ failing to compile aes-armv4.S" OFF) if (${ARCH} STREQUAL "x86_64") set( @@ -29,6 +30,22 @@ if (${ARCH} STREQUAL "arm") bsaes-armv7.${ASM_EXT} aesv8-armx.${ASM_EXT} ) +if (ENABLE_NDK_ARM_WORKAROUND) + # + # This isn't really *for* Apple, it's for clang in general, but somebody sometime + # ago chose to use __APPLE__ because back then clang was used by default only on + # macOS. Android NDK r18 and newer dropped gcc and uses only clang, thus the need + # to work around the build issue if the symbol is not defined: + # + # [...]sdks/builds/android-armeabi-v7a-debug/mono/btls/build-shared/boringssl/crypto/aes/aes-armv4.S:363:2: error: out of range immediate fixup value + # sub r10,r3,#asm_AES_encrypt-AES_Te @ Te + # ^ + # [...]sdks/builds/android-armeabi-v7a-debug/mono/btls/build-shared/boringssl/crypto/aes/aes-armv4.S:1010:2: error: out of range immediate fixup value + # sub r10,r3,#asm_AES_decrypt-AES_Td @ Td + # ^ + # + add_definitions(-D__APPLE__) + endif() endif() if (${ARCH} STREQUAL "aarch64") |