As we discussed in the last meeting, we reset the ports tree and began from scratch, even though this change involves porting all the packages. Starting small and growing gradually, this approach will reduce build times and consequently lower energy consumption in a world affected by climate change. We will add new ports as users needs arise; ok h3artbl33d@

This commit is contained in:
purplerain 2024-05-26 03:08:12 +00:00
parent 83a0aaf92c
commit 9a3af55370
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
59377 changed files with 98673 additions and 4712155 deletions

View file

@ -1,21 +0,0 @@
Index: common/autoconf/generated-configure.sh
--- common/autoconf/generated-configure.sh.orig
+++ common/autoconf/generated-configure.sh
@@ -41217,7 +41217,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld requires -z wxneeded" >&5
$as_echo_n "checking if ld requires -z wxneeded... " >&6; }
PUSHED_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -Wl,-z,wxneeded"
+ LDFLAGS="$LDFLAGS -Wl,-z,wxneeded -Wl,-z,nobtcfi"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main() { }
@@ -41227,7 +41227,7 @@ if ac_fn_cxx_try_link "$LINENO"; then :
if $READELF -l conftest$ac_exeext | $GREP OPENBSD_WXNEED > /dev/null; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-z,wxneeded"
+ LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-z,wxneeded -Wl,-z,nobtcfi"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }

View file

@ -1,18 +0,0 @@
Index: common/autoconf/toolchain.m4
--- common/autoconf/toolchain.m4.orig
+++ common/autoconf/toolchain.m4
@@ -855,12 +855,12 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
if test "`uname -s`" = "OpenBSD"; then
AC_MSG_CHECKING([if ld requires -z wxneeded])
PUSHED_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -Wl,-z,wxneeded"
+ LDFLAGS="$LDFLAGS -Wl,-z,wxneeded -Wl,-z,nobtcfi"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { }]])],
[
if $READELF -l conftest$ac_exeext | $GREP OPENBSD_WXNEED > /dev/null; then
AC_MSG_RESULT([yes])
- LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-z,wxneeded"
+ LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-z,wxneeded -Wl,-z,nobtcfi"
else
AC_MSG_RESULT([yes])
fi

View file

@ -1,13 +0,0 @@
Reading from .text was not the intent here.
Index: hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp
--- hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp.orig
+++ hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp
@@ -1054,7 +1054,6 @@ address InterpreterGenerator::generate_native_entry(bo
__ ldr(r10, Address(rmethod, Method::native_function_offset()));
address unsatisfied = (SharedRuntime::native_method_throw_unsatisfied_link_error_entry());
__ mov(rscratch2, unsatisfied);
- __ ldr(rscratch2, rscratch2);
__ cmp(r10, rscratch2);
__ br(Assembler::NE, L);
__ call_VM(noreg,

View file

@ -1,29 +1,17 @@
Remove syscall(2) use.
Add support for detecting the primordial thread.
Use the correct number of cpus when hw.smt=0
Index: hotspot/src/os/bsd/vm/os_bsd.cpp
--- hotspot/src/os/bsd/vm/os_bsd.cpp.orig
+++ hotspot/src/os/bsd/vm/os_bsd.cpp
@@ -1285,7 +1285,7 @@ pid_t os::Bsd::gettid() {
return (pid_t)tid;
#endif
#elif defined(__OpenBSD__)
- retval = syscall(SYS_getthrid);
+ return ::getthrid();
#elif defined(__NetBSD__)
retval = (pid_t) _lwp_self();
#endif
@@ -4590,6 +4590,12 @@ void os::pause() {
"Could not open pause file '%s', continuing immediately.\n", filename);
}
}
+
+#ifdef __OpenBSD__
+bool os::is_primordial_thread() {
+ return (pthread_main_np() == 1);
+}
@@ -299,7 +299,11 @@ void os::Bsd::initialize_system_info() {
/* get processors count via hw.ncpus sysctl */
mib[0] = CTL_HW;
+#if defined(HW_NCPUONLINE)
+ mib[1] = HW_NCPUONLINE;
+#else
mib[1] = HW_NCPU;
+#endif
// Refer to the comments in os_solaris.cpp park-unpark.
len = sizeof(cpu_val);
if (sysctl(mib, 2, &cpu_val, &len, NULL, 0) != -1 && cpu_val >= 1) {
assert(len == sizeof(cpu_val), "unexpected data size");

View file

@ -1,24 +1,21 @@
Sync changes with os_linux_sparc.cpp
Support setting thread stack sizes on sparc64
Fix implicit FPE exceptions on sparc64
Index: hotspot/src/os_cpu/bsd_sparc/vm/os_bsd_sparc.cpp
--- hotspot/src/os_cpu/bsd_sparc/vm/os_bsd_sparc.cpp.orig
+++ hotspot/src/os_cpu/bsd_sparc/vm/os_bsd_sparc.cpp
@@ -618,7 +618,7 @@ JVM_handle_bsd_signal(int sig,
return 1;
}
@@ -608,6 +608,15 @@ JVM_handle_bsd_signal(int sig,
pc = address(SIG_PC(uc));
npc = address(SIG_NPC(uc));
- if (checkPrefetch(uc, pc)) {
+ if ((sig == SIGSEGV || sig == SIGBUS) && checkPrefetch(uc, pc)) {
return 1;
}
@@ -740,7 +740,7 @@ bool os::is_allocatable(size_t bytes) {
size_t os::Bsd::min_stack_allowed = 128 * K;
-bool os::Bsd::supports_variable_stack_size() { return false; }
+bool os::Bsd::supports_variable_stack_size() { return true; }
// return default stack size for thr_type
size_t os::Bsd::default_stack_size(os::ThreadType thr_type) {
+#ifdef __OpenBSD__
+ // the kernel advances ucontext_t pc and npc one instruction for FPE signals
+ // See /sys/arch/sparc64/sparc64/trap.c
+ if (sig == SIGFPE) {
+ pc -= 4;
+ npc -= 4;
+ }
+#endif
+
// Check to see if we caught the safepoint code in the
// process of write protecting the memory serialization page.
// It write enables the page immediately after protecting it

View file

@ -1,14 +0,0 @@
Add support for detecting the primordial thread
Index: hotspot/src/share/vm/runtime/os.hpp
--- hotspot/src/share/vm/runtime/os.hpp.orig
+++ hotspot/src/share/vm/runtime/os.hpp
@@ -468,7 +468,7 @@ class os: AllStatic {
// need special-case handling of the primordial thread if it attaches
// to the VM.
static bool is_primordial_thread(void)
-#if defined(_WINDOWS) || defined(BSD)
+#if defined(_WINDOWS) || (defined(BSD) && !defined(__OpenBSD__))
// No way to identify the primordial thread.
{ return false; }
#else

View file

@ -1,19 +0,0 @@
Disable stack guarding on the primordial thread because its protections
are immutable. Note this will interfere with the primordial thread throwing
StackOverflowError exceptions.
Index: hotspot/src/share/vm/runtime/thread.cpp
--- hotspot/src/share/vm/runtime/thread.cpp.orig
+++ hotspot/src/share/vm/runtime/thread.cpp
@@ -2494,7 +2494,11 @@ void JavaThread::java_resume() {
void JavaThread::create_stack_guard_pages() {
if (!os::uses_stack_guard_pages() ||
_stack_guard_state != stack_guard_unused ||
+#ifdef __OpenBSD__
+ os::is_primordial_thread()) {
+#else
(DisablePrimordialThreadGuardPages && os::is_primordial_thread())) {
+#endif
if (TraceThreadEvents) {
tty->print_cr("Stack guard page creation for thread "
UINTX_FORMAT " disabled", os::current_thread_id());