From b911741252d042ce84df83b002daa5a993daffe6 Mon Sep 17 00:00:00 2001 From: halx99 Date: Wed, 2 Dec 2020 21:18:13 -0800 Subject: [PATCH] fix libjpeg-turbo can't build with combined archs --- external/jpeg/simd/CMakeLists.txt | 3 ++- external/jpeg/simd/arm/jsimd_neon.S | 3 --- external/jpeg/simd/jsimd.c | 8 ++++++++ external/jpeg/simd/jsimd_neon.S | 8 ++++++++ 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 external/jpeg/simd/jsimd.c create mode 100644 external/jpeg/simd/jsimd_neon.S diff --git a/external/jpeg/simd/CMakeLists.txt b/external/jpeg/simd/CMakeLists.txt index 7376e67395..a3c1498a8b 100644 --- a/external/jpeg/simd/CMakeLists.txt +++ b/external/jpeg/simd/CMakeLists.txt @@ -222,7 +222,8 @@ message(STATUS "CMAKE_ASM_FLAGS = ${EFFECTIVE_ASM_FLAGS}") # so we remove TurboJPEG official complex check logic which not properly works with # Apple xcode11+ clang message(STATUS "GAS is working properly") -add_library(simd OBJECT ${CPU_TYPE}/jsimd_neon.S ${CPU_TYPE}/jsimd.c) +# add_library(simd OBJECT ${CPU_TYPE}/jsimd_neon.S ${CPU_TYPE}/jsimd.c) +add_library(simd OBJECT jsimd.c jsimd_neon.S) if(CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED) set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1) diff --git a/external/jpeg/simd/arm/jsimd_neon.S b/external/jpeg/simd/arm/jsimd_neon.S index 5917784e50..345e060c3f 100644 --- a/external/jpeg/simd/arm/jsimd_neon.S +++ b/external/jpeg/simd/arm/jsimd_neon.S @@ -25,7 +25,6 @@ * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. */ -#if defined(__arm__) #if defined(__linux__) && defined(__ELF__) .section .note.GNU-stack, "", %progbits /* mark stack as non-executable */ @@ -2879,5 +2878,3 @@ asm_function jsimd_huff_encode_one_block_neon .purgem emit_byte .purgem put_bits .purgem checkbuf15 - -#endif diff --git a/external/jpeg/simd/jsimd.c b/external/jpeg/simd/jsimd.c new file mode 100644 index 0000000000..436c8f25ba --- /dev/null +++ b/external/jpeg/simd/jsimd.c @@ -0,0 +1,8 @@ +// By halx99, This file is only workaround for build ios combined archs +#if defined(__APPLE__) + #if defined(__arm__) + #include "arm/jsimd.c" + #elif defined(__arm64__) + #include "arm64/jsimd.c" + #endif +#endif diff --git a/external/jpeg/simd/jsimd_neon.S b/external/jpeg/simd/jsimd_neon.S new file mode 100644 index 0000000000..297fddeaba --- /dev/null +++ b/external/jpeg/simd/jsimd_neon.S @@ -0,0 +1,8 @@ +// By halx99, This file is only workaround for build ios combined archs +#if defined(__APPLE__) + #if defined(__arm__) + #include "arm/jsimd_neon.S" + #elif defined(__arm64__) + #include "arm64/jsimd_neon.S" + #endif +#endif