0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-08-14 21:53:02 +00:00
Files
termux-packages/packages/openjdk-17/0015-Don-t-run-fpu_control-related-functions-on-Android.patch
alexytomi 8d30dd9550 fix(openjdk-17): Readd deleted comments to commit message
Also regenerates for 17.0.16-ga
2025-07-23 00:33:24 -05:00

76 lines
2.3 KiB
Diff

From 8160ad4e3e301914091a31db4fb2cd75af766cb9 Mon Sep 17 00:00:00 2001
From: Duy Tran Khanh <40482367+khanhduytran0@users.noreply.github.com>
Date: Sat, 12 Jun 2021 06:58:20 +0700
Subject: [PATCH 15/41] Don't run fpu_control related functions on Android
---
src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp | 2 ++
src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp | 10 +++++-----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp b/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp
index 785e767ef10..4812edd8314 100644
--- a/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp
+++ b/src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp
@@ -70,7 +70,9 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
+#ifndef __ANDROID__
# include <fpu_control.h>
+#endif
# include <asm/ptrace.h>
#define SPELL_REG_SP "sp"
diff --git a/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
index 34a02f74ded..8750b528c4b 100644
--- a/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
+++ b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
@@ -73,7 +73,7 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-#ifndef AMD64
+#if !defined(AMD64) && !defined(__ANDROID__)
# include <fpu_control.h>
#endif
@@ -424,14 +424,14 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
}
void os::Linux::init_thread_fpu_state(void) {
-#ifndef AMD64
+#if !defined(AMD64) && !defined(__ANDROID__)
// set fpu to 53 bit precision
set_fpu_control_word(0x27f);
#endif // !AMD64
}
int os::Linux::get_fpu_control_word(void) {
-#ifdef AMD64
+#if defined(AMD64) || defined(__ANDROID__)
return 0;
#else
int fpu_control;
@@ -441,7 +441,7 @@ int os::Linux::get_fpu_control_word(void) {
}
void os::Linux::set_fpu_control_word(int fpu_control) {
-#ifndef AMD64
+#if !defined(AMD64) && !defined(__ANDROID__)
_FPU_SETCW(fpu_control);
#endif // !AMD64
}
@@ -657,7 +657,7 @@ void os::print_register_info(outputStream *st, const void *context) {
}
void os::setup_fpu() {
-#ifndef AMD64
+#if !defined(AMD64) && !defined(__ANDROID__)
address fpu_cntrl = StubRoutines::x86::addr_fpu_cntrl_wrd_std();
__asm__ volatile ( "fldcw (%0)" :
: "r" (fpu_cntrl) : "memory");
--
2.50.1