From 17f4e599c2d41c8b3965dccdb6735b3e8f288fa8 Mon Sep 17 00:00:00 2001 From: Thomas Grenier Date: Thu, 12 Dec 2024 11:06:48 +0100 Subject: [PATCH] Fix calls to jnidispatch on Android with 16KB page size --- CHANGES.md | 1 + native/Makefile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index ef944fcbb..d3fd49345 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,7 @@ Features Bug Fixes --------- +* [#1618](https://github.com/java-native-access/jna/issues/1618): Fix calls to jnidispatch on Android with 16KB page size - [@Thomyrock](https://github.com/Thomyrock) Release 5.15.0 ============== diff --git a/native/Makefile b/native/Makefile index 49240421e..79a7b0e3d 100644 --- a/native/Makefile +++ b/native/Makefile @@ -176,12 +176,12 @@ CPP=$(PREFIX)cpp LD=$(CC) RANLIB=$(PREFIX)ranlib STRIP=$(PREFIX)strip -x -CDEFINES=-DFFI_STATIC_BUILD -DNO_JAWT -DNO_WEAK_GLOBALS -DFFI_MMAP_EXEC_WRIT=1 -DFFI_MMAP_EXEC_SELINUX=0 +CDEFINES=-DFFI_STATIC_BUILD -DNO_JAWT -DNO_WEAK_GLOBALS -DFFI_MMAP_EXEC_WRIT=1 -DFFI_MMAP_EXEC_SELINUX=0 -Dmalloc_getpagesize='getpagesize()' COPT+=-fpic -ffunction-sections -funwind-tables -fno-short-enums JAVA_INCLUDES= CINCLUDES+=-I"$(NDK_PLATFORM)/arch-$(AARCH)/usr/include" # -I/usr/include LIBS=-nostdlib -L"$(NDK_PLATFORM)/arch-$(AARCH)$(ALIBDIR)/" -lgcc -lc -ldl -lm -LDFLAGS+=-Wl,-shared,-Bsymbolic -Wl,--build-id=sha1 +LDFLAGS+=-Wl,-shared,-Bsymbolic -Wl,--build-id=sha1 -Wl,-z,max-page-size=16384 FFI_ENV=CPP="$(CPP)" CC="$(CC)" CFLAGS="$(COPT) $(CDEBUG) $(CINCLUDES)" CPPFLAGS="$(CDEFINES) $(CINCLUDES)" LIBS="$(LIBS)" RANLIB="$(RANLIB)" FFI_CONFIG=--enable-static --disable-shared --with-pic=yes --host=$(HOST) endif