Skip to content

Commit

Permalink
Update native libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
md-5 committed Apr 13, 2024
1 parent 25cf8d6 commit bc528d5
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion native/compile-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ echo "Compiling mbedtls"
echo "Compiling zlib"
(cd zlib && CFLAGS=-fPIC ./configure --static && make)

CXX="g++ -shared -fPIC -Wl,--wrap=memcpy -O3 -Wall -Werror -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/"
CXX="g++ -shared -fPIC -O3 -Wall -Werror -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/"

$CXX -Imbedtls/include src/main/c/NativeCipherImpl.cpp -o src/main/resources/native-cipher.so mbedtls/library/libmbedcrypto.a
$CXX -Izlib src/main/c/NativeCompressImpl.cpp -o src/main/resources/native-compress.so zlib/libz.a
2 changes: 1 addition & 1 deletion native/mbedtls
6 changes: 0 additions & 6 deletions native/src/main/c/NativeCipherImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
#include <mbedtls/aes.h>
#include "net_md_5_bungee_jni_cipher_NativeCipherImpl.h"

// Support for CentOS 6
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
extern "C" void *__wrap_memcpy(void *dest, const void *src, size_t n) {
return memcpy(dest, src, n);
}

typedef unsigned char byte;

struct crypto_context {
Expand Down
6 changes: 0 additions & 6 deletions native/src/main/c/NativeCompressImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
#include <zlib.h>
#include "net_md_5_bungee_jni_zlib_NativeCompressImpl.h"

// Support for CentOS 6
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
extern "C" void *__wrap_memcpy(void *dest, const void *src, size_t n) {
return memcpy(dest, src, n);
}

typedef unsigned char byte;

static jfieldID consumedID;
Expand Down
Binary file modified native/src/main/resources/native-cipher.so
Binary file not shown.
Binary file modified native/src/main/resources/native-compress.so
Binary file not shown.
2 changes: 1 addition & 1 deletion native/zlib
Submodule zlib updated 78 files
+6 −2 .github/workflows/cmake.yml
+3 −1 .github/workflows/make.yml
+19 −0 .github/workflows/rust.yml
+4 −0 .gitignore
+42 −26 CMakeLists.txt
+27 −0 Cargo.toml
+4 −4 ChangeLog
+1 −1 FAQ
+22 −0 LICENSE
+13 −7 Makefile.in
+11 −9 README
+9 −0 README.md
+12 −27 adler32.c
+1 −1 amiga/Makefile.sas
+0 −215 as400/bndsrc
+0 −110 as400/compile.clp
+0 −115 as400/readme.txt
+0 −451 as400/zlib.inc
+52 −0 benches/bench.rs
+74 −1 chunkcopy.h
+29 −34 compress.c
+132 −23 configure
+46 −67 crc32.c
+90 −159 deflate.c
+5 −2 deflate.h
+6 −6 doc/txtvsbin.txt
+5 −0 examples/README.examples
+385 −360 examples/enough.c
+3 −3 examples/fitblk.c
+2 −2 examples/gun.c
+3 −3 examples/gzappend.c
+5 −3 examples/gzlog.c
+1 −1 examples/gzlog.h
+470 −0 examples/gznorm.c
+15 −11 examples/zlib_how.html
+164 −94 examples/zran.c
+40 −0 examples/zran.h
+1 −3 gzclose.c
+28 −19 gzguts.h
+39 −84 gzlib.c
+31 −64 gzread.c
+115 −105 gzwrite.c
+19 −28 infback.c
+16 −19 inffast.c
+1 −1 inffast.h
+61 −42 inffast_chunk.c
+22 −6 inffast_chunk.h
+83 −104 inflate.c
+6 −4 inflate.h
+13 −20 inftrees.c
+4 −4 inftrees.h
+3 −3 make_vms.com
+1 −1 msdos/Makefile.dj2
+1 −1 msdos/Makefile.emx
+1 −1 old/Makefile.emx
+1 −1 old/os2/Makefile.os2
+6 −0 rust/README.md
+87 −0 rust/build.rs
+246 −0 rust/lib.rs
+ rust/test_files/test1
+47 −78 test/example.c
+12 −11 test/infcover.c
+39 −81 test/minigzip.c
+1 −1 treebuild.xml
+79 −133 trees.c
+62 −36 uncompr.c
+0 −1 win32/Makefile.bor
+1 −6 win32/Makefile.gcc
+1 −1 win32/README-WIN32.txt
+1 −1 win32/zlib1.rc
+26 −26 zconf.h
+24 −24 zconf.h.cmakein
+24 −24 zconf.h.in
+416 −352 zlib.h
+4 −0 zlib.map
+0 −152 zlib2ansi
+21 −52 zutil.c
+44 −34 zutil.h

0 comments on commit bc528d5

Please sign in to comment.