13
0
geforkt von Mirrors/Velocity

Use Cloudflare zlib for more aggressive optimizations

Dieser Commit ist enthalten in:
Andrew Steinborn 2020-02-18 01:34:39 -05:00
Ursprung 496027f7c1
Commit b3ac73a51e
3 geänderte Dateien mit 11 neuen und 10 gelöschten Zeilen

1
.gitignore vendored
Datei anzeigen

@ -89,3 +89,4 @@ plugins/
### Natives stuff ### ### Natives stuff ###
native/mbedtls native/mbedtls
native/zlib-ng native/zlib-ng
native/zlib-cf

Datei anzeigen

@ -1,21 +1,21 @@
#!/bin/bash #!/bin/bash
if [ ! -d zlib-ng ]; then if [ ! -d zlib-cf ]; then
echo "Cloning zlib-ng..." echo "Cloning Cloudflare zlib..."
git clone https://github.com/zlib-ng/zlib-ng.git git clone -b gcc.amd64 https://github.com/cloudflare/zlib.git zlib-cf
fi fi
echo "Compiling zlib-ng..." #echo "Compiling Cloudflare zlib..."
cd zlib-ng #cd zlib-cf
CFLAGS="-fPIC -O3 -mtune=skylake -flto" AR=gcc-ar RANLIB=gcc-ranlib ./configure --zlib-compat --static #CFLAGS="-fPIC -O3 -mtune=skylake -flto" AR=gcc-ar RANLIB=gcc-ranlib ./configure --static
make clean && make #make clean && make
cd .. #cd ..
# Modify as you need. # Modify as you need.
MBEDTLS_ROOT=mbedtls MBEDTLS_ROOT=mbedtls
CFLAGS="-O3 -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/ -fPIC -shared -mtune=skylake -flto" CFLAGS="-O3 -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/ -fPIC -shared -mtune=skylake -flto"
gcc $CFLAGS -Izlib-ng src/main/c/jni_util.c src/main/c/jni_zlib_deflate.c src/main/c/jni_zlib_inflate.c \ gcc $CFLAGS -Izlib-cf src/main/c/jni_util.c src/main/c/jni_zlib_deflate.c src/main/c/jni_zlib_inflate.c \
src/main/c/jni_zlib_common.c zlib-ng/libz.a -o src/main/resources/linux_x64/velocity-compress.so src/main/c/jni_zlib_common.c zlib-cf/libz.a -Wl,-z,noexecstack -o src/main/resources/linux_x64/velocity-compress.so
gcc $CFLAGS -I $MBEDTLS_ROOT/include -shared $MBEDTLS_ROOT/library/aes.c $MBEDTLS_ROOT/library/aesni.c \ gcc $CFLAGS -I $MBEDTLS_ROOT/include -shared $MBEDTLS_ROOT/library/aes.c $MBEDTLS_ROOT/library/aesni.c \
$MBEDTLS_ROOT/library/platform.c $MBEDTLS_ROOT/library/platform_util.c src/main/c/jni_util.c src/main/c/jni_cipher.c \ $MBEDTLS_ROOT/library/platform.c $MBEDTLS_ROOT/library/platform_util.c src/main/c/jni_util.c src/main/c/jni_cipher.c \
-o src/main/resources/linux_x64/velocity-cipher.so -o src/main/resources/linux_x64/velocity-cipher.so