mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 12:10:06 +02:00
openjdk16: fix build for x86 arch
This commit is contained in:
@@ -10,7 +10,7 @@ license. OpenJDK is the official Java SE 8 reference implementation."
|
||||
HOMEPAGE="https://openjdk.java.net/"
|
||||
COPYRIGHT="2007-2021 Oracle and/or its affiliates."
|
||||
LICENSE="GNU GPL v2"
|
||||
REVISION="1"
|
||||
REVISION="2"
|
||||
jdkBuild="jdk-${portVersion%.*}+${portVersion##*.}"
|
||||
srcGitRev="4fbbaceca70c873b81bf121e9b0e05c18b29900a"
|
||||
SOURCE_URI="https://github.com/zelenoviy/jdk16u/archive/$srcGitRev.tar.gz"
|
||||
@@ -20,6 +20,7 @@ SOURCE_FILENAME="jdk16u-$jdkBuild-$srcGitRev.tar.gz"
|
||||
SOURCE_URI_2="https://ftp.osuosl.org/pub/blfs/conglomeration/openjdk/jtreg-4.2-b13-433.tar.gz"
|
||||
CHECKSUM_SHA256_2="ddf76660d4f519302b9c6310febcde3ff45313c435fff4e157854d1ff50785b1"
|
||||
SOURCE_DIR_2="jtreg"
|
||||
PATCHES="openjdk16-$portVersion.patchset"
|
||||
ADDITIONAL_FILES="
|
||||
elf.h
|
||||
"
|
||||
@@ -152,8 +153,6 @@ BUILD()
|
||||
freeTypeHeaders=$(finddir B_SYSTEM_HEADERS_DIRECTORY)$secondaryArchSubDir/freetype2
|
||||
freeTypeLib=$(finddir B_SYSTEM_DEVELOP_DIRECTORY)/lib$secondaryArchSubDir
|
||||
|
||||
extraFlags="-Wno-maybe-uninitialized -Wno-misleading-indentation -Wno-array-bounds -Wno-stringop-truncation -Wno-stringop-overflow -Wno-format"
|
||||
|
||||
bash ./configure \
|
||||
--with-freetype-include="${freeTypeHeaders}" \
|
||||
--with-freetype-lib="${freeTypeLib}" \
|
||||
@@ -165,8 +164,8 @@ BUILD()
|
||||
--with-memory-size=3072 \
|
||||
--enable-javac-server \
|
||||
--disable-warnings-as-errors \
|
||||
--with-extra-cflags="$extraFlags" \
|
||||
--with-extra-cxxflags="$extraFlags"
|
||||
--with-extra-cflags="-w" \
|
||||
--with-extra-cxxflags="-w"
|
||||
|
||||
make images LOG=info
|
||||
}
|
||||
|
||||
145
dev-lang/openjdk/patches/openjdk16-16.0.2.7.patchset
Normal file
145
dev-lang/openjdk/patches/openjdk16-16.0.2.7.patchset
Normal file
@@ -0,0 +1,145 @@
|
||||
From 3597d47444352a5b5d69844c9a8bddbee466f0c6 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Sun, 26 Mar 2023 15:35:18 +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 19c7f49..969f3b8 100644
|
||||
--- a/src/hotspot/cpu/x86/interp_masm_x86.cpp
|
||||
+++ b/src/hotspot/cpu/x86/interp_masm_x86.cpp
|
||||
@@ -1338,7 +1338,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 288b1bd..0473feb 100644
|
||||
--- a/src/hotspot/cpu/x86/interp_masm_x86.hpp
|
||||
+++ b/src/hotspot/cpu/x86/interp_masm_x86.hpp
|
||||
@@ -182,7 +182,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 5c1056e..856ea80 100644
|
||||
--- a/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp
|
||||
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp
|
||||
@@ -1813,7 +1813,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
}
|
||||
|
||||
// Load immediate 1 into swap_reg %rax,
|
||||
- __ movptr(swap_reg, 1);
|
||||
+ __ movptr(swap_reg, (intptr_t)1);
|
||||
|
||||
// Load (object->mark() | 1) into swap_reg %rax,
|
||||
__ orptr(swap_reg, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
|
||||
@@ -2044,7 +2044,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
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 681db40..5ba79bc 100644
|
||||
--- a/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp
|
||||
+++ b/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp
|
||||
@@ -2765,7 +2765,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); \
|
||||
@@ -2931,11 +2931,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 2025f41..2067b24 100644
|
||||
--- a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp
|
||||
+++ b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp
|
||||
@@ -204,7 +204,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), NULL_WORD);
|
||||
|
||||
__ restore_bcp();
|
||||
__ restore_locals();
|
||||
@@ -252,7 +252,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), NULL_WORD);
|
||||
__ restore_bcp();
|
||||
__ restore_locals();
|
||||
const Register thread = NOT_LP64(rcx) LP64_ONLY(r15_thread);
|
||||
@@ -1497,7 +1497,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), NULL_WORD);
|
||||
// rax: exception
|
||||
// rdx: return address/pc that threw exception
|
||||
__ restore_bcp(); // r13/rsi points to call/send
|
||||
@@ -1643,7 +1643,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), NULL_WORD);
|
||||
|
||||
__ restore_bcp();
|
||||
__ restore_locals();
|
||||
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 105eaf3..b00cf2b 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;
|
||||
--
|
||||
2.37.3
|
||||
|
||||
Reference in New Issue
Block a user