diff -Naur openjdk-8.265_p01/hotspot/src/os/linux/vm/jvm_linux.cpp openjdk-8.265_p01-copy/hotspot/src/os/linux/vm/jvm_linux.cpp --- openjdk-8.265_p01/hotspot/src/os/linux/vm/jvm_linux.cpp 2020-10-11 15:53:08.468010359 -0400 +++ openjdk-8.265_p01-copy/hotspot/src/os/linux/vm/jvm_linux.cpp 2020-10-11 20:42:02.152018764 -0400 @@ -154,7 +154,9 @@ #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 -Naur openjdk-8.265_p01/hotspot/src/os/linux/vm/os_linux.cpp openjdk-8.265_p01-copy/hotspot/src/os/linux/vm/os_linux.cpp --- openjdk-8.265_p01/hotspot/src/os/linux/vm/os_linux.cpp 2020-10-11 15:53:08.468010359 -0400 +++ openjdk-8.265_p01-copy/hotspot/src/os/linux/vm/os_linux.cpp 2020-10-11 20:43:52.252018818 -0400 @@ -95,7 +95,6 @@ # include # include # include -# include # include # include # include @@ -581,6 +580,13 @@ // 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. @@ -639,6 +645,7 @@ if (os::Linux::is_NPTL() || os::Linux::supports_variable_stack_size()) { os::Linux::set_is_floating_stack(); } +#endif } ///////////////////////////////////////////////////////////////////////////// @@ -2968,6 +2975,11 @@ 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 -Naur openjdk-8.265_p01/hotspot/src/os/linux/vm/os_linux.inline.hpp openjdk-8.265_p01-copy/hotspot/src/os/linux/vm/os_linux.inline.hpp --- openjdk-8.265_p01/hotspot/src/os/linux/vm/os_linux.inline.hpp 2020-10-11 15:53:08.468010359 -0400 +++ openjdk-8.265_p01-copy/hotspot/src/os/linux/vm/os_linux.inline.hpp 2020-10-11 20:44:18.000018830 -0400 @@ -33,7 +33,7 @@ #include #include -#include +#include #include inline void* os::thread_local_storage_at(int index) { diff -Naur openjdk-8.265_p01/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp openjdk-8.265_p01-copy/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp --- openjdk-8.265_p01/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp 2020-10-11 15:53:08.472010359 -0400 +++ openjdk-8.265_p01-copy/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp 2020-10-11 20:47:50.888018933 -0400 @@ -72,7 +72,6 @@ # include # include # include -# include #ifdef AMD64 #define REG_SP REG_RSP @@ -543,6 +542,9 @@ ShouldNotReachHere(); } +#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 -Naur openjdk-8.265_p01/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp openjdk-8.265_p01-copy/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp --- openjdk-8.265_p01/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp 2020-10-11 15:53:08.472010359 -0400 +++ openjdk-8.265_p01-copy/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp 2020-10-11 20:48:23.452018949 -0400 @@ -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 -Naur openjdk-8.265_p01/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp openjdk-8.265_p01-copy/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp --- openjdk-8.265_p01/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp 2020-10-11 15:53:08.572010359 -0400 +++ openjdk-8.265_p01-copy/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp 2020-10-11 20:49:02.568018968 -0400 @@ -235,7 +235,7 @@ #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"