Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openjdk-17: Add workaround for tagged pointers #10347

Merged
merged 1 commit into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/openjdk-17/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Java development kit and runtime"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=17.0
TERMUX_PKG_REVISION=19
TERMUX_PKG_REVISION=20
TERMUX_PKG_SRCURL=https://github.com/termux/openjdk-mobile-termux/archive/ec285598849a27f681ea6269342cf03cf382eb56.tar.gz
TERMUX_PKG_SHA256=d7c6ead9d80d0f60d98d0414e9dc87f5e18a304e420f5cd21f1aa3210c1a1528
TERMUX_PKG_DEPENDS="freetype, giflib, libandroid-shmem, libandroid-spawn, libiconv, zlib, xorgproto, libx11, libxcursor, libxext, cups, fontconfig, libjpeg-turbo, libpng, libxrender, libxtst, libxrandr, libxt, libxi"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff -uNr mobile-ec285598849a27f681ea6269342cf03cf382eb56/src/java.base/share/native/libjli/java.c mobile-ec285598849a27f681ea6269342cf03cf382eb56.mod/src/java.base/share/native/libjli/java.c
--- mobile-ec285598849a27f681ea6269342cf03cf382eb56/src/java.base/share/native/libjli/java.c 2021-07-06 14:29:24.000000000 +0300
+++ mobile-ec285598849a27f681ea6269342cf03cf382eb56.mod/src/java.base/share/native/libjli/java.c 2021-07-30 15:23:39.352949077 +0300
@@ -54,6 +54,24 @@
@@ -54,6 +54,32 @@
#include "java.h"
#include "jni.h"

Expand All @@ -11,6 +11,14 @@ diff -uNr mobile-ec285598849a27f681ea6269342cf03cf382eb56/src/java.base/share/na
+static void android_disable_tags() {
+ void *lib_handle = dlopen("libc.so", RTLD_LAZY);
+ if (lib_handle) {
+ if (android_get_device_api_level() >= 31) {
+ int (*mallopt_func)(int, int) = dlsym(lib_handle, "mallopt");
+ if (mallopt_func) {
+ mallopt_func(M_BIONIC_SET_HEAP_TAGGING_LEVEL, 0);
+ }
+ return;
+ }
+ /* android_get_device_api_level() < 31 */
+ bool (*android_mallopt)(int opcode, void* arg, size_t arg_size) = dlsym(lib_handle, "android_mallopt");
+ if (android_mallopt) {
+ int android_malloc_tag_level = 0;
Expand Down