mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-18 17:50:06 +02:00
201 lines
9.1 KiB
Plaintext
201 lines
9.1 KiB
Plaintext
From 509673bb73a3e2ba063d95973c82cda8306b73bf Mon Sep 17 00:00:00 2001
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
|
Date: Mon, 27 Mar 2023 11:16:13 +1000
|
|
Subject: Fix build for x86 arch
|
|
|
|
|
|
diff --git a/src/hotspot/cpu/x86/interp_masm_x86.cpp b/src/hotspot/cpu/x86/interp_masm_x86.cpp
|
|
index d92885d..eacc83a 100644
|
|
--- a/src/hotspot/cpu/x86/interp_masm_x86.cpp
|
|
+++ b/src/hotspot/cpu/x86/interp_masm_x86.cpp
|
|
@@ -1339,7 +1339,7 @@ void InterpreterMacroAssembler::unlock_object(Register lock_reg) {
|
|
movptr(obj_reg, Address(lock_reg, BasicObjectLock::obj_offset_in_bytes()));
|
|
|
|
// Free entry
|
|
- movptr(Address(lock_reg, BasicObjectLock::obj_offset_in_bytes()), (int32_t)NULL_WORD);
|
|
+ movptr(Address(lock_reg, BasicObjectLock::obj_offset_in_bytes()), NULL_WORD);
|
|
|
|
if (UseBiasedLocking) {
|
|
biased_locking_exit(obj_reg, header_reg, done);
|
|
diff --git a/src/hotspot/cpu/x86/interp_masm_x86.hpp b/src/hotspot/cpu/x86/interp_masm_x86.hpp
|
|
index 0aecb6b..779aea3 100644
|
|
--- a/src/hotspot/cpu/x86/interp_masm_x86.hpp
|
|
+++ b/src/hotspot/cpu/x86/interp_masm_x86.hpp
|
|
@@ -183,7 +183,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
|
void empty_expression_stack() {
|
|
movptr(rsp, Address(rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize));
|
|
// NULL last_sp until next java call
|
|
- movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD);
|
|
+ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD);
|
|
NOT_LP64(empty_FPU_stack());
|
|
}
|
|
|
|
diff --git a/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp b/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp
|
|
index 492ec59..1f9e7d7 100644
|
|
--- a/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp
|
|
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp
|
|
@@ -2054,13 +2054,13 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
|
|
|
if (CheckJNICalls) {
|
|
// clear_pending_jni_exception_check
|
|
- __ movptr(Address(thread, JavaThread::pending_jni_exception_check_fn_offset()), NULL_WORD);
|
|
+ __ movptr(Address(thread, JavaThread::pending_jni_exception_check_fn_offset()), (intptr_t)NULL_WORD);
|
|
}
|
|
|
|
if (!is_critical_native) {
|
|
// reset handle block
|
|
__ movptr(rcx, Address(thread, JavaThread::active_handles_offset()));
|
|
- __ movl(Address(rcx, JNIHandleBlock::top_offset_in_bytes()), NULL_WORD);
|
|
+ __ movl(Address(rcx, JNIHandleBlock::top_offset_in_bytes()), (int32_t)NULL_WORD);
|
|
|
|
// Any exception pending?
|
|
__ cmpptr(Address(thread, in_bytes(Thread::pending_exception_offset())), (int32_t)NULL_WORD);
|
|
diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp
|
|
index 654066a..848790d 100644
|
|
--- a/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp
|
|
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp
|
|
@@ -2781,7 +2781,7 @@ class StubGenerator: public StubCodeGenerator {
|
|
__ jcc(Assembler::equal, L_key256_top);
|
|
|
|
//key128 begins here
|
|
- __ movptr(pos, 0); // init pos before L_multiBlock_loopTop
|
|
+ __ movptr(pos, (intptr_t)0); // init pos before L_multiBlock_loopTop
|
|
|
|
#define CTR_DoFour(opc, src_reg) \
|
|
__ opc(xmm_result0, src_reg); \
|
|
@@ -2947,11 +2947,11 @@ class StubGenerator: public StubCodeGenerator {
|
|
__ ret(0);
|
|
|
|
__ BIND (L_key192_top);
|
|
- __ movptr(pos, 0); // init pos before L_multiBlock_loopTop
|
|
+ __ movptr(pos, (intptr_t)0); // init pos before L_multiBlock_loopTop
|
|
__ jmp(L_multiBlock_loopTop[1]); //key192
|
|
|
|
__ BIND (L_key256_top);
|
|
- __ movptr(pos, 0); // init pos before L_multiBlock_loopTop
|
|
+ __ movptr(pos, (intptr_t)0); // init pos before L_multiBlock_loopTop
|
|
__ jmp(L_multiBlock_loopTop[2]); //key192
|
|
|
|
return start;
|
|
diff --git a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp
|
|
index dcbb373..f024a6c 100644
|
|
--- a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp
|
|
+++ b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp
|
|
@@ -205,7 +205,7 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state,
|
|
// Restore stack bottom in case i2c adjusted stack
|
|
__ movptr(rsp, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize));
|
|
// and NULL it as marker that esp is now tos until next java call
|
|
- __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD);
|
|
+ __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (intptr_t)NULL_WORD);
|
|
|
|
__ restore_bcp();
|
|
__ restore_locals();
|
|
@@ -253,7 +253,7 @@ address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, i
|
|
#endif // _LP64
|
|
|
|
// NULL last_sp until next java call
|
|
- __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD);
|
|
+ __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (intptr_t)NULL_WORD);
|
|
__ restore_bcp();
|
|
__ restore_locals();
|
|
const Register thread = NOT_LP64(rcx) LP64_ONLY(r15_thread);
|
|
@@ -1434,7 +1434,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
|
|
Interpreter::_rethrow_exception_entry = __ pc();
|
|
// Restore sp to interpreter_frame_last_sp even though we are going
|
|
// to empty the expression stack for the exception processing.
|
|
- __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD);
|
|
+ __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (intptr_t)NULL_WORD);
|
|
// rax: exception
|
|
// rdx: return address/pc that threw exception
|
|
__ restore_bcp(); // r13/rsi points to call/send
|
|
@@ -1580,7 +1580,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
|
|
|
|
// Restore the last_sp and null it out
|
|
__ movptr(rsp, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize));
|
|
- __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD);
|
|
+ __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (intptr_t)NULL_WORD);
|
|
|
|
__ restore_bcp();
|
|
__ restore_locals();
|
|
diff --git a/src/hotspot/os_cpu/haiku_x86/haiku_x86_32.S b/src/hotspot/os_cpu/haiku_x86/haiku_x86_32.S
|
|
index e803056..9cbf35d 100644
|
|
--- a/src/hotspot/os_cpu/haiku_x86/haiku_x86_32.S
|
|
+++ b/src/hotspot/os_cpu/haiku_x86/haiku_x86_32.S
|
|
@@ -475,20 +475,6 @@ ci_CopyLeft:
|
|
# Support for void Copy::conjoint_jlongs_atomic(jlong* from,
|
|
# jlong* to,
|
|
# size_t count)
|
|
- #
|
|
- # 32-bit
|
|
- #
|
|
- # count treated as signed
|
|
- #
|
|
- # if (from > to) {
|
|
- # while (--count >= 0) {
|
|
- # *to++ = *from++;
|
|
- # }
|
|
- # } else {
|
|
- # while (--count >= 0) {
|
|
- # to[count] = from[count];
|
|
- # }
|
|
- # }
|
|
.p2align 4,,15
|
|
.type _Copy_conjoint_jlongs_atomic,@function
|
|
_Copy_conjoint_jlongs_atomic:
|
|
diff --git a/src/hotspot/os_cpu/haiku_x86/os_haiku_x86.cpp b/src/hotspot/os_cpu/haiku_x86/os_haiku_x86.cpp
|
|
index 5c9c4f9..878630d 100644
|
|
--- a/src/hotspot/os_cpu/haiku_x86/os_haiku_x86.cpp
|
|
+++ b/src/hotspot/os_cpu/haiku_x86/os_haiku_x86.cpp
|
|
@@ -214,16 +214,6 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
|
|
return true;
|
|
}
|
|
|
|
-#ifndef AMD64
|
|
- // Halt if SI_KERNEL before more crashes get misdiagnosed as Java bugs
|
|
- // This can happen in any running code (currently more frequently in
|
|
- // interpreter code but has been seen in compiled code)
|
|
- if (sig == SIGSEGV && info->si_addr == 0 && info->si_code == SI_KERNEL) {
|
|
- fatal("An irrecoverable SI_KERNEL SIGSEGV has occurred due "
|
|
- "to unstable signal handling in this distribution.");
|
|
- }
|
|
-#endif // AMD64
|
|
-
|
|
// Handle ALL stack overflow variations here
|
|
if (sig == SIGSEGV) {
|
|
address addr = (address) info->si_addr;
|
|
@@ -570,7 +560,7 @@ void os::print_register_info(outputStream *st, const void *context) {
|
|
|
|
void os::setup_fpu() {
|
|
#ifndef AMD64
|
|
- address fpu_cntrl = StubRoutines::addr_fpu_cntrl_wrd_std();
|
|
+ address fpu_cntrl = StubRoutines::x86::addr_fpu_cntrl_wrd_std();
|
|
__asm__ volatile ( "fldcw (%0)" :
|
|
: "r" (fpu_cntrl) : "memory");
|
|
#endif // !AMD64
|
|
--
|
|
2.37.3
|
|
|
|
|
|
From da915b3046e86de050144fc2101afcbfe8fc5ca3 Mon Sep 17 00:00:00 2001
|
|
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
|
Date: Sat, 1 Apr 2023 20:04:08 +1000
|
|
Subject: Fix build with clang
|
|
|
|
|
|
diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4
|
|
index 4999123..c7e176f 100644
|
|
--- a/make/autoconf/flags-cflags.m4
|
|
+++ b/make/autoconf/flags-cflags.m4
|
|
@@ -543,7 +543,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
|
# are sure to conform to the same standard. Unfortunately neither our sources nor
|
|
# our toolchains are in a condition to support that. But what we loosely aim for is
|
|
# C99 level.
|
|
- if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang || test "x$TOOLCHAIN_TYPE" = xxlc; then
|
|
+ if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xxlc; then
|
|
# Explicitly set C99. clang and xlclang support the same flag.
|
|
LANGSTD_CFLAGS="-std=c99"
|
|
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
|
--
|
|
2.37.3
|
|
|