void-packages/srcpkgs/openjdk8/files/musl_001_hotspot.patch

136 lines
5.3 KiB
Diff
Raw Normal View History

diff --git icedtea/hotspot/src/os/linux/vm/jvm_linux.cpp icedtea/hotspot/src/os/linux/vm/jvm_linux.cpp
index ba84788..c22281f 100644
--- openjdk/hotspot/src/os/linux/vm/jvm_linux.cpp
+++ openjdk/hotspot/src/os/linux/vm/jvm_linux.cpp
@@ -154,7 +154,9 @@ struct siglabel siglabels[] = {
#ifdef SIGSTKFLT
"STKFLT", SIGSTKFLT, /* Stack fault. */
#endif
+#ifdef SIGCLD
"CLD", SIGCLD, /* Same as SIGCHLD (System V). */
+#endif
"CHLD", SIGCHLD, /* Child status has changed (POSIX). */
"CONT", SIGCONT, /* Continue (POSIX). */
"STOP", SIGSTOP, /* Stop, unblockable (POSIX). */
diff --git icedtea/hotspot/src/os/linux/vm/os_linux.cpp icedtea/hotspot/src/os/linux/vm/os_linux.cpp
index 89ba0ff..e84837a 100644
--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp
+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp
@@ -94,7 +94,6 @@
# include <string.h>
# include <syscall.h>
# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
# include <sys/ipc.h>
# include <sys/shm.h>
# include <link.h>
@@ -530,6 +529,13 @@ void os::Linux::hotspot_sigmask(Thread* thread) {
// detecting pthread library
void os::Linux::libpthread_init() {
+#if 1
+ // Hard code Alpine Linux supported musl compatible settings
+ os::Linux::set_glibc_version("glibc 2.9");
+ os::Linux::set_libpthread_version("NPTL");
+ os::Linux::set_is_NPTL();
+ os::Linux::set_is_floating_stack();
+#else
// Save glibc and pthread version strings. Note that _CS_GNU_LIBC_VERSION
// and _CS_GNU_LIBPTHREAD_VERSION are supported in glibc >= 2.3.2. Use a
// generic name for earlier versions.
@@ -588,6 +594,7 @@ void os::Linux::libpthread_init() {
if (os::Linux::is_NPTL() || os::Linux::supports_variable_stack_size()) {
os::Linux::set_is_floating_stack();
}
+#endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -2834,6 +2841,11 @@ extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
extern "C" JNIEXPORT void numa_error(char *where) { }
extern "C" JNIEXPORT int fork1() { return fork(); }
+static void *dlvsym(void *handle, const char *name, const char *ver)
+{
+ return dlsym(handle, name);
+}
+
// Handle request to load libnuma symbol version 1.1 (API v1). If it fails
// load symbol from base version instead.
void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
diff --git openjdk/hotspot/src/os/linux/vm/os_linux.inline.hpp openjdk/hotspot/src/os/linux/vm/os_linux.inline.hpp
index 10d56d8..b9b2b77 100644
--- openjdk/hotspot/src/os/linux/vm/os_linux.inline.hpp
+++ openjdk/hotspot/src/os/linux/vm/os_linux.inline.hpp
@@ -33,7 +33,7 @@
#include <unistd.h>
#include <sys/socket.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <netdb.h>
inline void* os::thread_local_storage_at(int index) {
diff --git openjdk/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp openjdk/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
index d2c10e0..20f657f 100644
--- openjdk/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
+++ openjdk/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
@@ -75,7 +75,7 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
+# include <linux/types.h> /* provides __u64 */
#ifdef BUILTIN_SIM
#define REG_SP REG_RSP
diff --git openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
index 38388cb..2505ba8 100644
--- openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
+++ openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
@@ -72,7 +72,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#ifdef AMD64
#define REG_SP REG_RSP
@@ -544,6 +543,9 @@ JVM_handle_linux_signal(int sig,
return true; // Mute compiler
}
+#define _FPU_GETCW(cw) __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw))
+#define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw))
+
void os::Linux::init_thread_fpu_state(void) {
#ifndef AMD64
// set fpu to 53 bit precision
diff --git openjdk/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp openjdk/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp
index f3f2f26..6b50cfa 100644
--- openjdk/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp
+++ openjdk/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp
@@ -32,7 +32,9 @@
// map stack pointer to thread pointer - see notes in threadLS_linux_x86.cpp
#define SP_BITLENGTH 32
#define PAGE_SHIFT 12
+ #ifndef PAGE_SIZE
#define PAGE_SIZE (1UL << PAGE_SHIFT)
+ #endif
static Thread* _sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)];
public:
diff --git openjdk/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp openjdk/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
index efa0b4e..6df2302 100644
--- openjdk/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
+++ openjdk/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
@@ -235,7 +235,7 @@ inline int g_isnan(double f) { return isnand(f); }
#elif defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
-inline int g_isnan(float f) { return isnanf(f); }
+inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"