diff --git a/.gitmodules b/.gitmodules index c950c4c5d..e7b20a5fe 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "native/mbedtls"] path = native/mbedtls - url = https://github.com/ARMmbed/mbedtls.git + url = https://github.com/Mbed-TLS/mbedtls.git [submodule "native/zlib"] path = native/zlib - url = https://github.com/cloudflare/zlib.git + url = https://github.com/zlib-ng/zlib-ng.git diff --git a/native/compile-native-arm.sh b/native/compile-native-arm.sh index f3e2fd594..cec164d94 100755 --- a/native/compile-native-arm.sh +++ b/native/compile-native-arm.sh @@ -4,11 +4,20 @@ set -eu CWD=$(pwd) +if [ -n "${1:+x}" ]; then + if [ "$1" = "clean" ]; then + echo "Cleaning mbedtls" + (cd mbedtls && git reset --hard && git clean -fdx && cd framework && git reset --hard && git clean -fdx) + echo "Cleaning zlib" + (cd zlib && git reset --hard && git clean -fdx) + fi +fi + echo "Compiling mbedtls" (cd mbedtls && CFLAGS="-fPIC -I$CWD/src/main/c -DMBEDTLS_USER_CONFIG_FILE=''" make CC=aarch64-linux-gnu-gcc AR=aarch64-linux-gnu-ar no_test) echo "Compiling zlib" -(cd zlib && CFLAGS="-fPIC -DNO_GZIP" CC=aarch64-linux-gnu-gcc CHOST=arm64 ./configure --target="aarch64" --static && make CFLAGS="-fPIC -march=armv8-a+crc" CC=aarch64-linux-gnu-gcc AR=aarch64-linux-gnu-ar) +(cd zlib && CFLAGS="-fPIC -DNO_GZIP" CC=aarch64-linux-gnu-gcc CHOST=arm64 ./configure --static && make CFLAGS="-fPIC -march=armv8-a+crc" CC=aarch64-linux-gnu-gcc AR=aarch64-linux-gnu-ar) CC="aarch64-linux-gnu-gcc" CFLAGS="-c -fPIC -O3 -Wall -Werror -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/" @@ -23,7 +32,7 @@ echo "Linking native-cipher-arm.so" $CC $LDFLAGS -o src/main/resources/native-cipher-arm.so shared.o NativeCipherImpl.o mbedtls/library/libmbedcrypto.a echo "Linking native-compress-arm.so" -$CC $LDFLAGS -o src/main/resources/native-compress-arm.so shared.o NativeCompressImpl.o zlib/libz.a +$CC $LDFLAGS -o src/main/resources/native-compress-arm.so shared.o NativeCompressImpl.o zlib/libz-ng.a echo "Cleaning up" rm shared.o NativeCipherImpl.o NativeCompressImpl.o diff --git a/native/compile-native.sh b/native/compile-native.sh index a47bc812e..08157a8fc 100755 --- a/native/compile-native.sh +++ b/native/compile-native.sh @@ -4,6 +4,15 @@ set -eu CWD=$(pwd) +if [ -n "${1:+x}" ]; then + if [ "$1" = "clean" ]; then + echo "Cleaning mbedtls" + (cd mbedtls && git reset --hard && git clean -fdx && cd framework && git reset --hard && git clean -fdx) + echo "Cleaning zlib" + (cd zlib && git reset --hard && git clean -fdx) + fi +fi + echo "Compiling mbedtls" (cd mbedtls && CFLAGS="-fPIC -I$CWD/src/main/c -DMBEDTLS_USER_CONFIG_FILE=''" make no_test) @@ -23,7 +32,7 @@ echo "Linking native-cipher.so" $CC $LDFLAGS -o src/main/resources/native-cipher.so shared.o NativeCipherImpl.o mbedtls/library/libmbedcrypto.a echo "Linking native-compress.so" -$CC $LDFLAGS -o src/main/resources/native-compress.so shared.o NativeCompressImpl.o zlib/libz.a +$CC $LDFLAGS -o src/main/resources/native-compress.so shared.o NativeCompressImpl.o zlib/libz-ng.a echo "Cleaning up" rm shared.o NativeCipherImpl.o NativeCompressImpl.o diff --git a/native/mbedtls b/native/mbedtls index 2ca6c285a..e185d7fd8 160000 --- a/native/mbedtls +++ b/native/mbedtls @@ -1 +1 @@ -Subproject commit 2ca6c285a0dd3f33982dd57299012dacab1ff206 +Subproject commit e185d7fd85499c8ce5ca2a54f5cf8fe7dbe3f8df diff --git a/native/src/main/resources/native-cipher-arm.so b/native/src/main/resources/native-cipher-arm.so index 512c82b4a..82587e839 100755 Binary files a/native/src/main/resources/native-cipher-arm.so and b/native/src/main/resources/native-cipher-arm.so differ diff --git a/native/src/main/resources/native-cipher.so b/native/src/main/resources/native-cipher.so index 45afa5f87..1d8aa6538 100755 Binary files a/native/src/main/resources/native-cipher.so and b/native/src/main/resources/native-cipher.so differ diff --git a/native/src/main/resources/native-compress-arm.so b/native/src/main/resources/native-compress-arm.so index abbc69139..7caee0f91 100755 Binary files a/native/src/main/resources/native-compress-arm.so and b/native/src/main/resources/native-compress-arm.so differ diff --git a/native/src/main/resources/native-compress.so b/native/src/main/resources/native-compress.so index 968bb06d6..b0f7538f0 100755 Binary files a/native/src/main/resources/native-compress.so and b/native/src/main/resources/native-compress.so differ diff --git a/native/zlib b/native/zlib index 92530568d..127310929 160000 --- a/native/zlib +++ b/native/zlib @@ -1 +1 @@ -Subproject commit 92530568d2c128b4432467b76a3b54d93d6350bd +Subproject commit 12731092979c6d07f42da27da673a9f6c7b13586