diff --git a/native/compile-native.sh b/native/compile-native.sh index b5c011d8..a47bc812 100755 --- a/native/compile-native.sh +++ b/native/compile-native.sh @@ -8,7 +8,7 @@ echo "Compiling mbedtls" (cd mbedtls && CFLAGS="-fPIC -I$CWD/src/main/c -DMBEDTLS_USER_CONFIG_FILE=''" make no_test) echo "Compiling zlib" -(cd zlib && CFLAGS=-fPIC ./configure --static && make) +(cd zlib && CFLAGS="-fPIC -DNO_GZIP" ./configure --static && make) CC="gcc" CFLAGS="-c -fPIC -O3 -Wall -Werror -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/" diff --git a/native/src/main/c/cpuid_helper.h b/native/src/main/c/cpuid_helper.h index 2394ecd6..f44c8c72 100644 --- a/native/src/main/c/cpuid_helper.h +++ b/native/src/main/c/cpuid_helper.h @@ -1,4 +1,4 @@ -// Header to check for SSE 4.2 support in compression natives +// Header to check for SSE 2, SSSE 3, and SSE 4.2 support in compression natives // GCC only! #ifndef _INCLUDE_CPUID_HELPER_H @@ -8,12 +8,9 @@ #include static inline bool checkCompressionNativesSupport() { - unsigned int eax; - unsigned int ebx; - unsigned int ecx; - unsigned int edx; + unsigned int eax, ebx, ecx, edx; if(__get_cpuid(1, &eax, &ebx, &ecx, &edx)) { - return (ecx & bit_PCLMUL) != 0 && (ecx & bit_SSE4_2) != 0; + return (edx & bit_SSE2) != 0 && (ecx & bit_SSSE3) != 0 && (ecx & bit_SSE4_2) != 0; }else { return false; } diff --git a/native/src/main/resources/native-compress.so b/native/src/main/resources/native-compress.so index 181396f1..968bb06d 100755 Binary files a/native/src/main/resources/native-compress.so and b/native/src/main/resources/native-compress.so differ