From c39c34871a6f9541cdc8549e9df6b38d4ac6d977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sat, 24 Oct 2026 22:48:44 +0700 Subject: [PATCH] openjdk8: update to 8u504b01. --- srcpkgs/openjdk8/files/musl_005_jdk.patch | 83 -------------- srcpkgs/openjdk8/patches/001_8041658.patch | 7 +- .../openjdk8/patches/002_8043780-pr3368.patch | 105 ++++++++---------- .../openjdk8/patches/003_8078504-pr3094.patch | 7 +- .../openjdk8/patches/004_8087218-pr2740.patch | 7 +- .../005_8158260-pr2991-rh1341258.patch | 57 +++++----- .../openjdk8/patches/007_8207057-pr3613.patch | 7 +- srcpkgs/openjdk8/patches/008_no_devirt.patch | 7 +- .../009_override-redirect-metacity.patch | 7 +- srcpkgs/openjdk8/patches/011_pr3607.patch | 7 +- srcpkgs/openjdk8/patches/012_pr3728.patch | 7 +- srcpkgs/openjdk8/patches/013_werror.patch | 23 ++-- .../openjdk8/patches/100_jdk-execinfo.patch | 6 +- .../patches/101_jdk-fix-ipv6-init.patch | 12 +- .../patches/103_hotspot-mask-shift.patch | 13 --- .../openjdk8/patches/104_mips-support.patch | 14 +-- .../patches/105_implicit_declaration.patch | 10 -- .../openjdk8/patches/106_int_conversion.patch | 16 --- .../107_incompatible_pointer_types.patch | 24 ---- .../701-musl-hotspot.patch} | 93 ++++++++-------- .../702-musl-hotspot-ppc.patch} | 22 ++-- .../703-musl-hotspot-agent.patch} | 38 +++---- .../704-musl-fix_libjvm_load.patch} | 12 +- srcpkgs/openjdk8/patches/705-musl-types.patch | 82 ++++++++++++++ .../706-musl-includes.patch} | 74 ++++++------ .../patches/{LFS64.patch => 800-lfs.patch} | 28 ++--- .../patches/999-native-no-sysroot.patch | 4 +- srcpkgs/openjdk8/template | 33 ++---- 28 files changed, 350 insertions(+), 455 deletions(-) delete mode 100644 srcpkgs/openjdk8/files/musl_005_jdk.patch delete mode 100644 srcpkgs/openjdk8/patches/103_hotspot-mask-shift.patch delete mode 100644 srcpkgs/openjdk8/patches/106_int_conversion.patch delete mode 100644 srcpkgs/openjdk8/patches/107_incompatible_pointer_types.patch rename srcpkgs/openjdk8/{files/musl_001_hotspot.patch => patches/701-musl-hotspot.patch} (54%) rename srcpkgs/openjdk8/{files/musl_002_hotspot_ppc.patch => patches/702-musl-hotspot-ppc.patch} (55%) rename srcpkgs/openjdk8/{files/musl_003_hotspot-noagent.patch => patches/703-musl-hotspot-agent.patch} (68%) rename srcpkgs/openjdk8/{files/musl_004_fix_libjvm_load.patch => patches/704-musl-fix_libjvm_load.patch} (57%) create mode 100644 srcpkgs/openjdk8/patches/705-musl-types.patch rename srcpkgs/openjdk8/{files/musl_006_jdk_includes.patch => patches/706-musl-includes.patch} (54%) rename srcpkgs/openjdk8/patches/{LFS64.patch => 800-lfs.patch} (77%) diff --git a/srcpkgs/openjdk8/files/musl_005_jdk.patch b/srcpkgs/openjdk8/files/musl_005_jdk.patch deleted file mode 100644 index 68ff8d59b9b859..00000000000000 --- a/srcpkgs/openjdk8/files/musl_005_jdk.patch +++ /dev/null @@ -1,83 +0,0 @@ -diff -ru openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp ---- openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp 2017-01-25 04:22:03.000000000 +0000 -+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp 2017-02-06 11:23:47.041165210 +0000 -@@ -46,6 +46,8 @@ - - #include "zip.h" - -+#define uchar unsigned char -+ - #ifdef NO_ZLIB - - inline bool jar::deflate_bytes(bytes& head, bytes& tail) { -diff -ru openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h ---- openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h 2017-01-25 04:22:03.000000000 +0000 -+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h 2017-02-06 11:23:47.047832009 +0000 -@@ -23,9 +23,7 @@ - * questions. - */ - --#define ushort unsigned short --#define uint unsigned int --#define uchar unsigned char -+#include - - struct unpacker; - -diff -ru openjdk.orig/jdk/src/share/native/sun/awt/medialib/mlib_types.h openjdk/jdk/src/share/native/sun/awt/medialib/mlib_types.h ---- openjdk.orig/jdk/src/share/native/sun/awt/medialib/mlib_types.h 2017-01-25 04:22:03.000000000 +0000 -+++ openjdk/jdk/src/share/native/sun/awt/medialib/mlib_types.h 2017-02-06 11:23:47.047832009 +0000 -@@ -27,6 +27,7 @@ - #ifndef MLIB_TYPES_H - #define MLIB_TYPES_H - -+#include /* for NULL */ - #include - #if defined(_MSC_VER) - #include /* for FLT_MAX and DBL_MAX */ -diff -ru openjdk.orig/jdk/src/solaris/native/java/net/Inet4AddressImpl.c openjdk/jdk/src/solaris/native/java/net/Inet4AddressImpl.c ---- openjdk.orig/jdk/src/solaris/native/java/net/Inet4AddressImpl.c 2017-01-25 04:22:03.000000000 +0000 -+++ openjdk/jdk/src/solaris/native/java/net/Inet4AddressImpl.c 2017-02-06 11:23:47.047832009 +0000 -@@ -47,7 +47,7 @@ - - #include "java_net_Inet4AddressImpl.h" - --#if defined(__GLIBC__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 601104)) -+#if defined(__linux__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 601104)) - #define HAS_GLIBC_GETHOSTBY_R 1 - #endif - -diff -ru openjdk.orig/jdk/src/solaris/native/java/net/linux_close.c openjdk/jdk/src/solaris/native/java/net/linux_close.c ---- openjdk.orig/jdk/src/solaris/native/java/net/linux_close.c 2017-01-25 04:22:03.000000000 +0000 -+++ openjdk/jdk/src/solaris/native/java/net/linux_close.c 2017-02-06 11:23:47.047832009 +0000 -@@ -56,7 +56,7 @@ - /* - * Signal to unblock thread - */ --static int sigWakeup = (__SIGRTMAX - 2); -+static int sigWakeup; - - /* - * The fd table and the number of file descriptors -@@ -95,6 +95,9 @@ - /* - * Setup the signal handler - */ -+#ifndef __AIX -+ sigWakeup = SIGRTMAX - 2; -+#endif - sa.sa_handler = sig_wakeup; - sa.sa_flags = 0; - sigemptyset(&sa.sa_mask); -diff -ru openjdk.orig/jdk/src/solaris/native/sun/nio/ch/NativeThread.c openjdk/jdk/src/solaris/native/sun/nio/ch/NativeThread.c ---- openjdk.orig/jdk/src/solaris/native/sun/nio/ch/NativeThread.c 2017-01-25 04:22:03.000000000 +0000 -+++ openjdk/jdk/src/solaris/native/sun/nio/ch/NativeThread.c 2017-02-06 11:23:47.051165409 +0000 -@@ -36,7 +36,7 @@ - #include - #include - /* Also defined in net/linux_close.c */ -- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2) -+ #define INTERRUPT_SIGNAL (SIGRTMAX - 2) - #elif __solaris__ - #include - #include diff --git a/srcpkgs/openjdk8/patches/001_8041658.patch b/srcpkgs/openjdk8/patches/001_8041658.patch index 6798936cb0f4ca..4e58697bf7a49a 100644 --- a/srcpkgs/openjdk8/patches/001_8041658.patch +++ b/srcpkgs/openjdk8/patches/001_8041658.patch @@ -7,10 +7,9 @@ 8041658: Use of -fdevirtualize on macroAssembler_x86.o (via -O2) with gcc 4.9.0 creates broken VM Summary: -fno-devirtualize should be passed when compiling this file. -diff -Nru openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make ---- openjdk.orig/hotspot/make/linux/makefiles/gcc.make 2017-04-20 14:31:49.000000000 +0100 -+++ openjdk/hotspot/make/linux/makefiles/gcc.make 2017-05-10 14:52:39.297377302 +0100 -@@ -259,6 +259,9 @@ +--- a/hotspot/make/linux/makefiles/gcc.make ++++ b/hotspot/make/linux/makefiles/gcc.make +@@ -275,6 +275,9 @@ else ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1) OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT) endif diff --git a/srcpkgs/openjdk8/patches/002_8043780-pr3368.patch b/srcpkgs/openjdk8/patches/002_8043780-pr3368.patch index 133bbe5a77361d..2dc33924781248 100644 --- a/srcpkgs/openjdk8/patches/002_8043780-pr3368.patch +++ b/srcpkgs/openjdk8/patches/002_8043780-pr3368.patch @@ -8,10 +8,9 @@ Summary: Use open(O_CLOEXEC) where available; fall back to FD_CLOEXEC when necessary Reviewed-by: rasbold, dholmes -diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp ---- openjdk/hotspot/src/os/linux/vm/os_linux.cpp -+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp -@@ -5282,38 +5282,16 @@ +--- a/hotspot/src/os/linux/vm/os_linux.cpp ++++ b/hotspot/src/os/linux/vm/os_linux.cpp +@@ -5593,11 +5593,41 @@ int os::open(const char *path, int oflag errno = ENAMETOOLONG; return -1; } @@ -20,33 +19,6 @@ diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp oflag = oflag & ~O_DELETE; - fd = ::open64(path, oflag, mode); -- if (fd == -1) return -1; -- -- //If the open succeeded, the file might still be a directory -- { -- struct stat64 buf64; -- int ret = ::fstat64(fd, &buf64); -- int st_mode = buf64.st_mode; -- -- if (ret != -1) { -- if ((st_mode & S_IFMT) == S_IFDIR) { -- errno = EISDIR; -- ::close(fd); -- return -1; -- } -- } else { -- ::close(fd); -- return -1; -- } -- } -- -- /* -- * All file descriptors that are opened in the JVM and not -- * specifically destined for a subprocess should have the -- * close-on-exec flag set. If we don't set it, then careless 3rd -- * party native code might fork and exec without closing all -- * appropriate file descriptors (e.g. as we do in closeDescriptors in -- * UNIXProcess.c), and this in turn might: + + /* All file descriptors that are opened in the Java process and not + * specifically destined for a subprocess should have the close-on-exec @@ -54,13 +26,21 @@ diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp + * might fork and exec without closing all appropriate file descriptors + * (e.g. as we do in closeDescriptors in UNIXProcess.c), and this in + * turn might: - * - * - cause end-of-file to fail to be detected on some file - * descriptors, resulting in mysterious hangs, or -@@ -5329,12 +5307,49 @@ - * 4843136: (process) pipe file descriptor from Runtime.exec not being closed - * 6339493: (process) Runtime.exec does not close all file descriptors on Solaris 9 - */ ++ * ++ * - cause end-of-file to fail to be detected on some file ++ * descriptors, resulting in mysterious hangs, or ++ * ++ * - might cause an fopen in the subprocess to fail on a system ++ * suffering from bug 1085341. ++ * ++ * (Yes, the default setting of the close-on-exec flag is a Unix ++ * design flaw) ++ * ++ * See: ++ * 1085341: 32-bit stdio routines should support file descriptors >255 ++ * 4843136: (process) pipe file descriptor from Runtime.exec not being closed ++ * 6339493: (process) Runtime.exec does not close all file descriptors on Solaris 9 ++ */ + // Modern Linux kernels (after 2.6.23 2007) support O_CLOEXEC with open(). + // O_CLOEXEC is preferable to using FD_CLOEXEC on an open file descriptor + // because it saves a system call and removes a small window where the flag @@ -71,26 +51,35 @@ diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp +#endif + + int fd = ::open64(path, oflag, mode); -+ if (fd == -1) return -1; -+ -+ //If the open succeeded, the file might still be a directory -+ { -+ struct stat64 buf64; -+ int ret = ::fstat64(fd, &buf64); -+ int st_mode = buf64.st_mode; -+ -+ if (ret != -1) { -+ if ((st_mode & S_IFMT) == S_IFDIR) { -+ errno = EISDIR; -+ ::close(fd); -+ return -1; -+ } -+ } else { -+ ::close(fd); -+ return -1; -+ } -+ } -+ + if (fd == -1) return -1; + + //If the open succeeded, the file might still be a directory +@@ -5618,34 +5648,19 @@ int os::open(const char *path, int oflag + } + } + +- /* +- * All file descriptors that are opened in the JVM and not +- * specifically destined for a subprocess should have the +- * close-on-exec flag set. If we don't set it, then careless 3rd +- * party native code might fork and exec without closing all +- * appropriate file descriptors (e.g. as we do in closeDescriptors in +- * UNIXProcess.c), and this in turn might: +- * +- * - cause end-of-file to fail to be detected on some file +- * descriptors, resulting in mysterious hangs, or +- * +- * - might cause an fopen in the subprocess to fail on a system +- * suffering from bug 1085341. +- * +- * (Yes, the default setting of the close-on-exec flag is a Unix +- * design flaw) +- * +- * See: +- * 1085341: 32-bit stdio routines should support file descriptors >255 +- * 4843136: (process) pipe file descriptor from Runtime.exec not being closed +- * 6339493: (process) Runtime.exec does not close all file descriptors on Solaris 9 +- */ #ifdef FD_CLOEXEC - { - int flags = ::fcntl(fd, F_GETFD); diff --git a/srcpkgs/openjdk8/patches/003_8078504-pr3094.patch b/srcpkgs/openjdk8/patches/003_8078504-pr3094.patch index 9bcfa0ee58e695..bafbbaa596062e 100644 --- a/srcpkgs/openjdk8/patches/003_8078504-pr3094.patch +++ b/srcpkgs/openjdk8/patches/003_8078504-pr3094.patch @@ -7,9 +7,8 @@ S8078504, PR3094: Zero fails to build Reviewed-by: kvn, simonis -diff --git openjdk.orig/hotspot/src/cpu/zero/vm/vm_version_zero.hpp openjdk/hotspot/src/cpu/zero/vm/vm_version_zero.hpp ---- openjdk.orig/hotspot/src/cpu/zero/vm/vm_version_zero.hpp -+++ openjdk/hotspot/src/cpu/zero/vm/vm_version_zero.hpp +--- a/hotspot/src/cpu/zero/vm/vm_version_zero.hpp ++++ b/hotspot/src/cpu/zero/vm/vm_version_zero.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -18,7 +17,7 @@ diff --git openjdk.orig/hotspot/src/cpu/zero/vm/vm_version_zero.hpp openjdk/hots * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it -@@ -34,6 +34,7 @@ +@@ -34,6 +34,7 @@ class VM_Version : public Abstract_VM_Ve static const char* cpu_features() { return ""; } diff --git a/srcpkgs/openjdk8/patches/004_8087218-pr2740.patch b/srcpkgs/openjdk8/patches/004_8087218-pr2740.patch index 7a9d15541272e9..2ed513a0e41858 100644 --- a/srcpkgs/openjdk8/patches/004_8087218-pr2740.patch +++ b/srcpkgs/openjdk8/patches/004_8087218-pr2740.patch @@ -7,10 +7,9 @@ 8087218, PR2740: Constant fold loads from final instance fields in VM anonymous classes Reviewed-by: jrose, rbackman -diff -Nru openjdk.orig/hotspot/src/share/vm/ci/ciField.cpp openjdk/hotspot/src/share/vm/ci/ciField.cpp ---- openjdk.orig/hotspot/src/share/vm/ci/ciField.cpp 2017-04-20 14:31:49.000000000 +0100 -+++ openjdk/hotspot/src/share/vm/ci/ciField.cpp 2017-05-10 14:55:11.722924914 +0100 -@@ -187,6 +187,10 @@ +--- a/hotspot/src/share/vm/ci/ciField.cpp ++++ b/hotspot/src/share/vm/ci/ciField.cpp +@@ -187,6 +187,10 @@ static bool trust_final_non_static_field // Even if general trusting is disabled, trust system-built closures in these packages. if (holder->is_in_package("java/lang/invoke") || holder->is_in_package("sun/invoke")) return true; diff --git a/srcpkgs/openjdk8/patches/005_8158260-pr2991-rh1341258.patch b/srcpkgs/openjdk8/patches/005_8158260-pr2991-rh1341258.patch index 4d0459b674b981..74ac91d0177e33 100644 --- a/srcpkgs/openjdk8/patches/005_8158260-pr2991-rh1341258.patch +++ b/srcpkgs/openjdk8/patches/005_8158260-pr2991-rh1341258.patch @@ -9,11 +9,10 @@ Summary: Adjust instruction generation. Includes portions of 8026049 for test ca Reviewed-by: goetz Contributed-by: gromero@linux.vnet.ibm.com, horii@jp.ibm.com -diff -Nru openjdk.orig/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp openjdk/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp ---- openjdk.orig/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp 2019-01-16 07:13:59.000000000 +0000 -+++ openjdk/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp 2019-01-25 13:46:51.799453897 +0000 -@@ -201,6 +201,11 @@ - FLAG_SET_DEFAULT(UseSHA512Intrinsics, false); +--- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp ++++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp +@@ -236,6 +236,11 @@ void VM_Version::initialize() { + FLAG_SET_DEFAULT(UseSHA, false); } + // This machine allows unaligned memory accesses @@ -24,10 +23,9 @@ diff -Nru openjdk.orig/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp openjdk/hotspot if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) { UseMontgomeryMultiplyIntrinsic = true; } -diff -Nru openjdk.orig/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp openjdk/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp ---- openjdk.orig/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp 2019-01-16 07:13:59.000000000 +0000 -+++ openjdk/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp 2019-01-25 13:46:51.799453897 +0000 -@@ -375,6 +375,13 @@ +--- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp ++++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp +@@ -386,6 +386,13 @@ void VM_Version::initialize() { (cache_line_size > ContendedPaddingWidth)) ContendedPaddingWidth = cache_line_size; @@ -41,10 +39,9 @@ diff -Nru openjdk.orig/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp openjdk/hot #ifndef PRODUCT if (PrintMiscellaneous && Verbose) { tty->print_cr("L1 data cache line size: %u", L1_data_cache_line_size()); -diff -Nru openjdk.orig/hotspot/src/cpu/x86/vm/vm_version_x86.cpp openjdk/hotspot/src/cpu/x86/vm/vm_version_x86.cpp ---- openjdk.orig/hotspot/src/cpu/x86/vm/vm_version_x86.cpp 2019-01-16 07:13:59.000000000 +0000 -+++ openjdk/hotspot/src/cpu/x86/vm/vm_version_x86.cpp 2019-01-25 13:46:51.799453897 +0000 -@@ -1033,6 +1033,11 @@ +--- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp ++++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +@@ -1045,6 +1045,11 @@ void VM_Version::get_processor_features( (cache_line_size > ContendedPaddingWidth)) ContendedPaddingWidth = cache_line_size; @@ -56,9 +53,8 @@ diff -Nru openjdk.orig/hotspot/src/cpu/x86/vm/vm_version_x86.cpp openjdk/hotspot #ifndef PRODUCT if (PrintMiscellaneous && Verbose) { tty->print_cr("Logical CPUs per core: %u", -diff -Nru openjdk.orig/hotspot/src/cpu/zero/vm/vm_version_zero.cpp openjdk/hotspot/src/cpu/zero/vm/vm_version_zero.cpp ---- openjdk.orig/hotspot/src/cpu/zero/vm/vm_version_zero.cpp 2019-01-16 07:13:59.000000000 +0000 -+++ openjdk/hotspot/src/cpu/zero/vm/vm_version_zero.cpp 2019-01-25 13:46:51.799453897 +0000 +--- a/hotspot/src/cpu/zero/vm/vm_version_zero.cpp ++++ b/hotspot/src/cpu/zero/vm/vm_version_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -79,10 +75,9 @@ diff -Nru openjdk.orig/hotspot/src/cpu/zero/vm/vm_version_zero.cpp openjdk/hotsp + FLAG_SET_DEFAULT(UseUnalignedAccesses, false); + } +} -diff -Nru openjdk.orig/hotspot/src/share/vm/prims/unsafe.cpp openjdk/hotspot/src/share/vm/prims/unsafe.cpp ---- openjdk.orig/hotspot/src/share/vm/prims/unsafe.cpp 2019-01-16 07:13:59.000000000 +0000 -+++ openjdk/hotspot/src/share/vm/prims/unsafe.cpp 2019-01-25 13:50:10.160334728 +0000 -@@ -385,6 +385,24 @@ +--- a/hotspot/src/share/vm/prims/unsafe.cpp ++++ b/hotspot/src/share/vm/prims/unsafe.cpp +@@ -402,6 +402,24 @@ UNSAFE_END #endif // not SUPPORTS_NATIVE_CX8 @@ -107,7 +102,7 @@ diff -Nru openjdk.orig/hotspot/src/share/vm/prims/unsafe.cpp openjdk/hotspot/src #define DEFINE_GETSETOOP(jboolean, Boolean) \ \ UNSAFE_ENTRY(jboolean, Unsafe_Get##Boolean##140(JNIEnv *env, jobject unsafe, jobject obj, jint offset)) \ -@@ -1716,6 +1734,11 @@ +@@ -1722,6 +1740,11 @@ JNINativeMethod fence_methods[] = { {CC "fullFence", CC "()V", FN_PTR(Unsafe_FullFence)}, }; @@ -119,7 +114,7 @@ diff -Nru openjdk.orig/hotspot/src/share/vm/prims/unsafe.cpp openjdk/hotspot/src #undef CC #undef FN_PTR -@@ -1815,5 +1838,8 @@ +@@ -1821,5 +1844,8 @@ JVM_ENTRY(void, JVM_RegisterUnsafeMethod // Fence methods register_natives("1.8 fence methods", env, unsafecls, fence_methods, sizeof(fence_methods)/sizeof(JNINativeMethod)); @@ -128,22 +123,20 @@ diff -Nru openjdk.orig/hotspot/src/share/vm/prims/unsafe.cpp openjdk/hotspot/src + register_natives("1.9 CPU methods", env, unsafecls, cpu_methods, sizeof(cpu_methods)/sizeof(JNINativeMethod)); } JVM_END -diff -Nru openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp openjdk/hotspot/src/share/vm/runtime/globals.hpp ---- openjdk.orig/hotspot/src/share/vm/runtime/globals.hpp 2019-01-16 07:13:59.000000000 +0000 -+++ openjdk/hotspot/src/share/vm/runtime/globals.hpp 2019-01-25 13:46:51.803453833 +0000 -@@ -4003,6 +4003,9 @@ - product(bool, UseLockedTracing, false, \ - "Use locked-tracing when doing event-based tracing") \ +--- a/hotspot/src/share/vm/runtime/globals.hpp ++++ b/hotspot/src/share/vm/runtime/globals.hpp +@@ -4013,6 +4013,9 @@ class CommandLineFlags { + "Allocation less than this value will be allocated " \ + "using malloc. Larger allocations will use mmap.") \ \ + diagnostic(bool, UseUnalignedAccesses, false, \ + "Use unaligned memory accesses in sun.misc.Unsafe") \ + \ product_pd(bool, PreserveFramePointer, \ "Use the FP register for holding the frame pointer " \ - "and not as a general purpose register.") -diff -Nru openjdk.orig/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java openjdk/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java ---- openjdk.orig/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java 1970-01-01 01:00:00.000000000 +0100 -+++ openjdk/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java 2019-01-25 13:46:51.803453833 +0000 + "and not as a general purpose register.") \ +--- /dev/null ++++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeUnalignedAccess.java @@ -0,0 +1,315 @@ +/* + * Copyright (c) 2016 SAP SE. All rights reserved. diff --git a/srcpkgs/openjdk8/patches/007_8207057-pr3613.patch b/srcpkgs/openjdk8/patches/007_8207057-pr3613.patch index 7627c18352b1c3..869669b0164d10 100644 --- a/srcpkgs/openjdk8/patches/007_8207057-pr3613.patch +++ b/srcpkgs/openjdk8/patches/007_8207057-pr3613.patch @@ -6,10 +6,9 @@ # Parent 2f2d2af6fa5c44e67e0a9987f56392315a1e4b64 8207057, PR3613: No debug info for assembler files -diff -Nru openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make ---- openjdk.orig/hotspot/make/linux/makefiles/gcc.make 2018-12-21 00:55:33.407545727 +0000 -+++ openjdk/hotspot/make/linux/makefiles/gcc.make 2018-12-21 01:14:40.357592769 +0000 -@@ -339,6 +339,7 @@ +--- a/hotspot/make/linux/makefiles/gcc.make ++++ b/hotspot/make/linux/makefiles/gcc.make +@@ -355,6 +355,7 @@ endif # DEBUG_BINARIES uses full -g debug information for all configs ifeq ($(DEBUG_BINARIES), true) CFLAGS += -g diff --git a/srcpkgs/openjdk8/patches/008_no_devirt.patch b/srcpkgs/openjdk8/patches/008_no_devirt.patch index 967e86ade07bce..e69927fbfe17bd 100644 --- a/srcpkgs/openjdk8/patches/008_no_devirt.patch +++ b/srcpkgs/openjdk8/patches/008_no_devirt.patch @@ -6,10 +6,9 @@ # Parent 6cb711fa264d25f3592471a81a5b865c505a9fd7 Extend 8041658 to all files in the HotSpot build. -diff -r 6cb711fa264d -r 2b4f89de39c2 make/linux/makefiles/gcc.make ---- openjdk/hotspot/make/linux/makefiles/gcc.make Wed Apr 23 22:06:29 2014 +0100 -+++ openjdk/hotspot/make/linux/makefiles/gcc.make Thu Apr 24 16:21:06 2014 +0100 -@@ -267,7 +267,7 @@ +--- a/hotspot/make/linux/makefiles/gcc.make ++++ b/hotspot/make/linux/makefiles/gcc.make +@@ -276,7 +276,7 @@ else OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT) endif ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 9), 1) diff --git a/srcpkgs/openjdk8/patches/009_override-redirect-metacity.patch b/srcpkgs/openjdk8/patches/009_override-redirect-metacity.patch index 2dd26cb4c92df2..beef4fff94fd78 100644 --- a/srcpkgs/openjdk8/patches/009_override-redirect-metacity.patch +++ b/srcpkgs/openjdk8/patches/009_override-redirect-metacity.patch @@ -1,7 +1,6 @@ -diff -Nru openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java openjdk/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java ---- openjdk.orig/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java 2010-01-04 16:57:29.000000000 +0000 -+++ openjdk/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java 2010-01-04 19:47:57.000000000 +0000 -@@ -1142,6 +1142,7 @@ +--- a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java ++++ b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java +@@ -1250,6 +1250,7 @@ class XWindowPeer extends XPanelPeer imp boolean isOverrideRedirect() { return XWM.getWMID() == XWM.OPENLOOK_WM || diff --git a/srcpkgs/openjdk8/patches/011_pr3607.patch b/srcpkgs/openjdk8/patches/011_pr3607.patch index c891ddbf89b78d..1e6c48bb03c90e 100644 --- a/srcpkgs/openjdk8/patches/011_pr3607.patch +++ b/srcpkgs/openjdk8/patches/011_pr3607.patch @@ -6,9 +6,8 @@ # Parent 66087a86ded39c2595dc61223fa03671ff051e33 PR3607: CVE-2018-3639 hw: cpu: speculative store bypass mitigation -diff -Nru openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp ---- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp 2019-01-31 04:18:03.357394677 +0000 -+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2019-01-31 04:19:59.099570272 +0000 +--- a/hotspot/src/os/linux/vm/os_linux.cpp ++++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -103,6 +103,8 @@ # include # include @@ -18,7 +17,7 @@ diff -Nru openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/ PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC #ifndef _GNU_SOURCE -@@ -5001,6 +5003,31 @@ +@@ -5061,6 +5063,31 @@ const char* os::exception_name(int excep } } diff --git a/srcpkgs/openjdk8/patches/012_pr3728.patch b/srcpkgs/openjdk8/patches/012_pr3728.patch index 68a5d9e8b30ca9..e18824cd06486f 100644 --- a/srcpkgs/openjdk8/patches/012_pr3728.patch +++ b/srcpkgs/openjdk8/patches/012_pr3728.patch @@ -6,10 +6,9 @@ # Parent 2366ee02c78968ed4d62f77fc88632873cffd183 PR3728: CVE-2018-3639 fix revision to prefer PR_SPEC_DISABLE_NOEXEC to PR_SPEC_DISABLE -diff --git openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp ---- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp -+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp -@@ -5005,26 +5005,43 @@ +--- a/hotspot/src/os/linux/vm/os_linux.cpp ++++ b/hotspot/src/os/linux/vm/os_linux.cpp +@@ -5065,26 +5065,43 @@ const char* os::exception_name(int excep /* Per task speculation control */ #ifndef PR_GET_SPECULATION_CTRL diff --git a/srcpkgs/openjdk8/patches/013_werror.patch b/srcpkgs/openjdk8/patches/013_werror.patch index ba7fa9d916b2a3..97904303e398b9 100644 --- a/srcpkgs/openjdk8/patches/013_werror.patch +++ b/srcpkgs/openjdk8/patches/013_werror.patch @@ -6,10 +6,9 @@ # Parent c75d6ce2e98b901b31ac84dbbb59667e03beb9d5 Merge jdk8u20-b23 -diff -Nru openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make ---- openjdk.orig/hotspot/make/linux/makefiles/gcc.make 2019-01-25 15:02:27.660107711 +0000 -+++ openjdk/hotspot/make/linux/makefiles/gcc.make 2019-01-25 15:05:30.485236897 +0000 -@@ -198,7 +198,9 @@ +--- a/hotspot/make/linux/makefiles/gcc.make ++++ b/hotspot/make/linux/makefiles/gcc.make +@@ -202,7 +202,9 @@ else endif # Compiler warnings are treated as errors @@ -19,10 +18,9 @@ diff -Nru openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/mak ifeq ($(USE_CLANG), true) # However we need to clean the code up before we can unrestrictedly enable this option with Clang -diff -Nru openjdk.orig/hotspot/make/solaris/makefiles/adlc.make openjdk/hotspot/make/solaris/makefiles/adlc.make ---- openjdk.orig/hotspot/make/solaris/makefiles/adlc.make 2019-01-16 07:13:59.000000000 +0000 -+++ openjdk/hotspot/make/solaris/makefiles/adlc.make 2019-01-25 15:06:44.376075821 +0000 -@@ -73,8 +73,10 @@ +--- a/hotspot/make/solaris/makefiles/adlc.make ++++ b/hotspot/make/solaris/makefiles/adlc.make +@@ -73,8 +73,10 @@ endif # CFLAGS_WARN holds compiler options to suppress/enable warnings. # Compiler warnings are treated as errors @@ -35,10 +33,9 @@ diff -Nru openjdk.orig/hotspot/make/solaris/makefiles/adlc.make openjdk/hotspot/ endif # When using compiler version 5.13 (Solaris Studio 12.4), calls to explicitly # instantiated template functions trigger this warning when +w is active. -diff -Nru openjdk.orig/hotspot/make/solaris/makefiles/gcc.make openjdk/hotspot/make/solaris/makefiles/gcc.make ---- openjdk.orig/hotspot/make/solaris/makefiles/gcc.make 2019-01-16 07:13:59.000000000 +0000 -+++ openjdk/hotspot/make/solaris/makefiles/gcc.make 2019-01-25 15:05:30.485236897 +0000 -@@ -116,7 +116,9 @@ +--- a/hotspot/make/solaris/makefiles/gcc.make ++++ b/hotspot/make/solaris/makefiles/gcc.make +@@ -117,7 +117,9 @@ endif # Compiler warnings are treated as errors @@ -47,5 +44,5 @@ diff -Nru openjdk.orig/hotspot/make/solaris/makefiles/gcc.make openjdk/hotspot/m +WARNINGS_ARE_ERRORS = -Werror +endif # Enable these warnings. See 'info gcc' about details on these options - WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef + WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef -Wformat=2 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS) diff --git a/srcpkgs/openjdk8/patches/100_jdk-execinfo.patch b/srcpkgs/openjdk8/patches/100_jdk-execinfo.patch index e4ae562c573be2..91a49d1727145a 100644 --- a/srcpkgs/openjdk8/patches/100_jdk-execinfo.patch +++ b/srcpkgs/openjdk8/patches/100_jdk-execinfo.patch @@ -1,5 +1,5 @@ ---- openjdk.orig/jdk/src/solaris/native/sun/xawt/XToolkit.c -+++ openjdk/jdk/src/solaris/native/sun/xawt/XToolkit.c +--- a/jdk/src/solaris/native/sun/xawt/XToolkit.c ++++ b/jdk/src/solaris/native/sun/xawt/XToolkit.c @@ -27,7 +27,7 @@ #include #include @@ -9,7 +9,7 @@ #include #endif -@@ -689,7 +689,7 @@ +@@ -796,7 +796,7 @@ JNIEXPORT jstring JNICALL Java_sun_awt_X return ret; } diff --git a/srcpkgs/openjdk8/patches/101_jdk-fix-ipv6-init.patch b/srcpkgs/openjdk8/patches/101_jdk-fix-ipv6-init.patch index 11f3bf6dd6d7d2..7cc503888c3cfb 100644 --- a/srcpkgs/openjdk8/patches/101_jdk-fix-ipv6-init.patch +++ b/srcpkgs/openjdk8/patches/101_jdk-fix-ipv6-init.patch @@ -1,6 +1,6 @@ ---- openjdk/jdk/src/solaris/native/java/net/net_util_md.c.orig -+++ openjdk/jdk/src/solaris/native/java/net/net_util_md.c -@@ -561,7 +561,7 @@ +--- a/jdk/src/solaris/native/java/net/net_util_md.c ++++ b/jdk/src/solaris/native/java/net/net_util_md.c +@@ -662,7 +662,7 @@ struct localinterface { static struct localinterface *localifs = 0; static int localifsSize = 0; /* size of array */ @@ -9,7 +9,7 @@ /* not thread safe: make sure called once from one thread */ -@@ -573,6 +573,10 @@ +@@ -674,6 +674,10 @@ static void initLocalIfs () { int index, x1, x2, x3; unsigned int u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,ua,ub,uc,ud,ue,uf; @@ -20,7 +20,7 @@ if ((f = fopen("/proc/net/if_inet6", "r")) == NULL) { return ; } -@@ -601,7 +605,7 @@ +@@ -702,7 +706,7 @@ static void initLocalIfs () { localifs = (struct localinterface *) realloc ( localifs, sizeof (struct localinterface)* (localifsSize+5)); if (localifs == 0) { @@ -29,7 +29,7 @@ fclose (f); return; } -@@ -624,9 +628,7 @@ +@@ -725,9 +729,7 @@ static void initLocalIfs () { static int getLocalScopeID (char *addr) { struct localinterface *lif; int i; diff --git a/srcpkgs/openjdk8/patches/103_hotspot-mask-shift.patch b/srcpkgs/openjdk8/patches/103_hotspot-mask-shift.patch deleted file mode 100644 index 3d3f0972dbb228..00000000000000 --- a/srcpkgs/openjdk8/patches/103_hotspot-mask-shift.patch +++ /dev/null @@ -1,13 +0,0 @@ -Use ~0u instead of -1 to shift an unsigned value. - ---- openjdk/hotspot/src/share/vm/code/dependencies.hpp -+++ openjdk/hotspot/src/share/vm/code/dependencies.hpp -@@ -166,7 +166,7 @@ - LG2_TYPE_LIMIT = 4, // assert(TYPE_LIMIT <= (1< ---- a/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c -+++ b/jdk/src/solaris/native/sun/nio/fs/LinuxNativeDispatcher.c -@@ -29,6 +29,7 @@ - #include "jlong.h" - - #include -+#include - #include - #include - #include diff --git a/srcpkgs/openjdk8/patches/106_int_conversion.patch b/srcpkgs/openjdk8/patches/106_int_conversion.patch deleted file mode 100644 index 2c57cb01353072..00000000000000 --- a/srcpkgs/openjdk8/patches/106_int_conversion.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/jdk/src/share/bin/splashscreen_stubs.c -+++ b/jdk/src/share/bin/splashscreen_stubs.c -@@ -61,11 +61,11 @@ - #define INVOKEV(name) _INVOKE(name, ,;) - - int DoSplashLoadMemory(void* pdata, int size) { -- INVOKE(SplashLoadMemory, NULL)(pdata, size); -+ INVOKE(SplashLoadMemory, 0)(pdata, size); - } - - int DoSplashLoadFile(const char* filename) { -- INVOKE(SplashLoadFile, NULL)(filename); -+ INVOKE(SplashLoadFile, 0)(filename); - } - - void DoSplashInit(void) { diff --git a/srcpkgs/openjdk8/patches/107_incompatible_pointer_types.patch b/srcpkgs/openjdk8/patches/107_incompatible_pointer_types.patch deleted file mode 100644 index 94e304d4e56983..00000000000000 --- a/srcpkgs/openjdk8/patches/107_incompatible_pointer_types.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 6632e6c6ca74101b45b052fb7962376fbe97605e Mon Sep 17 00:00:00 2001 -From: Vadim Pakhnushev -Date: Tue, 26 Jul 2016 18:45:05 +0300 -Subject: [PATCH] 8162545: Mac build failure - -Reviewed-by: psadhukhan, prr ---- - jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c b/jdk/src/java.desktop/share/native/libjavajpeg/imageioJPEG.c -index 91b2e18c880..26645b45f82 100644 ---- a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c -+++ a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c -@@ -2634,7 +2634,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_writeTables - RELEASE_ARRAYS(env, data, NULL); - } - --static void freeArray(void** arr, jint size) { -+static void freeArray(UINT8** arr, jint size) { - int i; - if (arr != NULL) { - for (i = 0; i < size; i++) { - diff --git a/srcpkgs/openjdk8/files/musl_001_hotspot.patch b/srcpkgs/openjdk8/patches/701-musl-hotspot.patch similarity index 54% rename from srcpkgs/openjdk8/files/musl_001_hotspot.patch rename to srcpkgs/openjdk8/patches/701-musl-hotspot.patch index cbbb5525f054e5..ca6acd294d8667 100644 --- a/srcpkgs/openjdk8/files/musl_001_hotspot.patch +++ b/srcpkgs/openjdk8/patches/701-musl-hotspot.patch @@ -1,7 +1,5 @@ -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 +--- a/hotspot/src/os/linux/vm/jvm_linux.cpp ++++ b/hotspot/src/os/linux/vm/jvm_linux.cpp @@ -154,7 +154,9 @@ struct siglabel siglabels[] = { #ifdef SIGSTKFLT "STKFLT", SIGSTKFLT, /* Stack fault. */ @@ -12,23 +10,31 @@ index ba84788..c22281f 100644 "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 @@ +--- a/hotspot/src/os/linux/vm/os_linux.cpp ++++ b/hotspot/src/os/linux/vm/os_linux.cpp +@@ -70,6 +70,7 @@ + #include "utilities/vmError.hpp" + + // put OS-includes here ++# include + # include + # include + # include +@@ -95,7 +96,9 @@ # include # include # include --# include ++#ifdef __GLIBC__ + # include ++#endif # include # include # include -@@ -530,6 +529,13 @@ void os::Linux::hotspot_sigmask(Thread* thread) { +@@ -586,6 +589,13 @@ void os::Linux::hotspot_sigmask(Thread* // detecting pthread library void os::Linux::libpthread_init() { -+#if 1 ++#ifndef __GLIBC__ + // Hard code Alpine Linux supported musl compatible settings + os::Linux::set_glibc_version("glibc 2.9"); + os::Linux::set_libpthread_version("NPTL"); @@ -38,7 +44,7 @@ index 89ba0ff..e84837a 100644 // 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() { +@@ -644,6 +654,7 @@ void os::Linux::libpthread_init() { if (os::Linux::is_NPTL() || os::Linux::supports_variable_stack_size()) { os::Linux::set_is_floating_stack(); } @@ -46,22 +52,22 @@ index 89ba0ff..e84837a 100644 } ///////////////////////////////////////////////////////////////////////////// -@@ -2834,6 +2841,11 @@ extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { } +@@ -3001,6 +3012,13 @@ extern "C" JNIEXPORT void numa_warn(int extern "C" JNIEXPORT void numa_error(char *where) { } extern "C" JNIEXPORT int fork1() { return fork(); } ++#ifndef __GLIBC__ +static void *dlvsym(void *handle, const char *name, const char *ver) +{ + return dlsym(handle, name); +} ++#endif + // 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 +--- a/hotspot/src/os/linux/vm/os_linux.inline.hpp ++++ b/hotspot/src/os/linux/vm/os_linux.inline.hpp @@ -33,7 +33,7 @@ #include @@ -71,60 +77,59 @@ index 10d56d8..b9b2b77 100644 #include 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 @@ +--- a/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp ++++ b/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp +@@ -72,7 +72,11 @@ # include # include # include --# include ++#ifdef __GLIBC__ + # include ++#else +# include /* provides __u64 */ ++#endif - #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 @@ + #define REG_FP 29 + +--- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp ++++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp +@@ -72,7 +72,9 @@ # include # include # include --# include ++#ifdef __GLIBC__ + # include ++#endif #ifdef AMD64 #define REG_SP REG_RSP -@@ -544,6 +543,9 @@ JVM_handle_linux_signal(int sig, +@@ -544,6 +546,11 @@ JVM_handle_linux_signal(int sig, return true; // Mute compiler } ++#ifndef __GLIBC__ +#define _FPU_GETCW(cw) __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw)) +#define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw)) ++#endif + 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 +--- a/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp ++++ b/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 ++ #ifndef PAGE_SIZE #define PAGE_SIZE (1UL << PAGE_SHIFT) -+ #endif ++ #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); } +--- a/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp ++++ b/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp +@@ -235,7 +235,7 @@ inline int g_isnan(double f) { return is #elif defined(__APPLE__) inline int g_isnan(double f) { return isnan(f); } #elif defined(LINUX) || defined(_ALLBSD_SOURCE) diff --git a/srcpkgs/openjdk8/files/musl_002_hotspot_ppc.patch b/srcpkgs/openjdk8/patches/702-musl-hotspot-ppc.patch similarity index 55% rename from srcpkgs/openjdk8/files/musl_002_hotspot_ppc.patch rename to srcpkgs/openjdk8/patches/702-musl-hotspot-ppc.patch index 43f86185225922..6ee1809d9c491e 100644 --- a/srcpkgs/openjdk8/files/musl_002_hotspot_ppc.patch +++ b/srcpkgs/openjdk8/patches/702-musl-hotspot-ppc.patch @@ -1,27 +1,31 @@ ---- openjdk/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp -+++ openjdk/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp -@@ -80,7 +80,7 @@ +--- a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp ++++ b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp +@@ -74,7 +74,9 @@ # include # include # include - ++#ifndef __GLIBC__ +# include ++#endif address os::current_stack_pointer() { intptr_t* csp; ---- openjdk/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp -+++ openjdk/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp -@@ -46,6 +46,8 @@ +--- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp ++++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp +@@ -44,6 +44,10 @@ #include "gc_implementation/g1/heapRegion.hpp" - #endif + #endif // INCLUDE_ALL_GCS ++#ifndef __GLIBC__ +#include ++#endif + #ifdef PRODUCT #define BLOCK_COMMENT(str) // nothing #else ---- openjdk/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp -+++ openjdk/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp +--- a/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp ++++ b/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp @@ -27,6 +27,8 @@ #include "runtime/frame.inline.hpp" #include "runtime/thread.hpp" diff --git a/srcpkgs/openjdk8/files/musl_003_hotspot-noagent.patch b/srcpkgs/openjdk8/patches/703-musl-hotspot-agent.patch similarity index 68% rename from srcpkgs/openjdk8/files/musl_003_hotspot-noagent.patch rename to srcpkgs/openjdk8/patches/703-musl-hotspot-agent.patch index 25bdb1c5a585c9..bcafa68c934123 100644 --- a/srcpkgs/openjdk8/files/musl_003_hotspot-noagent.patch +++ b/srcpkgs/openjdk8/patches/703-musl-hotspot-agent.patch @@ -1,6 +1,6 @@ ---- openjdk.orig/common/autoconf/configure -+++ openjdk/common/autoconf/configure -@@ -103,7 +103,7 @@ +--- a/common/autoconf/configure ++++ b/common/autoconf/configure +@@ -103,7 +103,7 @@ check_hg_updates() { } # Check for local changes @@ -9,9 +9,9 @@ if test -e $conf_custom_script_dir/generated-configure.sh; then # Test if open configure is newer than custom configure, if so, custom needs to ---- openjdk.orig/common/autoconf/jdk-options.m4 -+++ openjdk/common/autoconf/jdk-options.m4 -@@ -159,7 +159,7 @@ +--- a/common/autoconf/jdk-options.m4 ++++ b/common/autoconf/jdk-options.m4 +@@ -151,7 +151,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_VARIANTS AC_SUBST(JVM_VARIANT_ZEROSHARK) AC_SUBST(JVM_VARIANT_CORE) @@ -20,19 +20,19 @@ if test "x$JVM_VARIANT_ZERO" = xtrue ; then INCLUDE_SA=false fi ---- openjdk.orig/hotspot/make/linux/makefiles/defs.make -+++ openjdk/hotspot/make/linux/makefiles/defs.make -@@ -305,6 +305,9 @@ +--- a/hotspot/make/linux/makefiles/defs.make ++++ b/hotspot/make/linux/makefiles/defs.make +@@ -305,6 +305,9 @@ endif # Serviceability Binaries # No SA Support for PPC, IA64, ARM or zero +# or if thread_db.h missing (musl) + -+ifneq ($(wildcard /usr/include/thread_db.h),) ++ifeq ($(INCLUDE_SA),true) ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ $(EXPORT_LIB_DIR)/sa-jdi.jar ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ -@@ -322,6 +322,11 @@ +@@ -324,6 +327,11 @@ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) endif endif endif @@ -44,9 +44,9 @@ ADD_SA_BINARIES/ppc = ADD_SA_BINARIES/ia64 = ADD_SA_BINARIES/arm = ---- openjdk.orig/hotspot/make/linux/makefiles/sa.make -+++ openjdk/hotspot/make/linux/makefiles/sa.make -@@ -59,9 +59,11 @@ +--- a/hotspot/make/linux/makefiles/sa.make ++++ b/hotspot/make/linux/makefiles/sa.make +@@ -59,9 +59,11 @@ SA_PROPERTIES = $(SA_CLASSDIR)/sa.proper # if $(AGENT_DIR) does not exist, we don't build SA # also, we don't build SA on Itanium or zero. @@ -54,20 +54,20 @@ all: - if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" \ -+ if [ -d $(AGENT_DIR) -a -f /usr/include/thread_db.h \ ++ if [ -d $(AGENT_DIR) -a $(INCLUDE_SA) = true \ + -a "$(SRCARCH)" != "ia64" \ -a "$(SRCARCH)" != "zero" ] ; then \ $(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \ fi ---- openjdk.orig/hotspot/make/linux/makefiles/saproc.make -+++ openjdk/hotspot/make/linux/makefiles/saproc.make -@@ -61,12 +61,15 @@ +--- a/hotspot/make/linux/makefiles/saproc.make ++++ b/hotspot/make/linux/makefiles/saproc.make +@@ -66,12 +66,15 @@ endif # if $(AGENT_DIR) does not exist, we don't build SA # also, we don't build SA on Itanium or zero. +# check for thread_db.h too (musl does not have it). -+ifneq ($(wildcard /usr/include/thread_db.h),) ++ifeq ($(INCLUDE_SA),true) ifneq ($(wildcard $(AGENT_DIR)),) ifneq ($(filter-out ia64 zero,$(SRCARCH)),) BUILDLIBSAPROC = $(LIBSAPROC) diff --git a/srcpkgs/openjdk8/files/musl_004_fix_libjvm_load.patch b/srcpkgs/openjdk8/patches/704-musl-fix_libjvm_load.patch similarity index 57% rename from srcpkgs/openjdk8/files/musl_004_fix_libjvm_load.patch rename to srcpkgs/openjdk8/patches/704-musl-fix_libjvm_load.patch index d0a090ea57130e..709f7c9a34b1e7 100644 --- a/srcpkgs/openjdk8/files/musl_004_fix_libjvm_load.patch +++ b/srcpkgs/openjdk8/patches/704-musl-fix_libjvm_load.patch @@ -1,14 +1,14 @@ musl needs LD_LIBRARY_PATH set because when .so is opened with dlopen(/abs/path) it does not qualify for providing symbols for NEEDED dependency. ---- openjdk.orig/jdk/src/solaris/bin/java_md_solinux.c -+++ openjdk/jdk/src/solaris/bin/java_md_solinux.c -@@ -291,6 +291,8 @@ +--- a/jdk/src/solaris/bin/java_md_solinux.c ++++ b/jdk/src/solaris/bin/java_md_solinux.c +@@ -292,7 +292,7 @@ RequiresSetenv(int wanted, const char *j char *dmllp = NULL; char *p; /* a utility pointer */ -+ return JNI_TRUE; -+ - #ifdef AIX +-#ifdef AIX ++#if defined(AIX) || (defined(__linux__) && !defined(__GLIBC__)) /* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */ return JNI_TRUE; + #endif diff --git a/srcpkgs/openjdk8/patches/705-musl-types.patch b/srcpkgs/openjdk8/patches/705-musl-types.patch new file mode 100644 index 00000000000000..db4c855f5f2281 --- /dev/null +++ b/srcpkgs/openjdk8/patches/705-musl-types.patch @@ -0,0 +1,82 @@ +--- a/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp ++++ b/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp +@@ -46,6 +46,10 @@ + + #include "zip.h" + ++#ifndef __GLIBC__ ++#define uchar unsigned char ++#endif ++ + #ifdef NO_ZLIB + + inline bool jar::deflate_bytes(bytes& head, bytes& tail) { +--- a/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h ++++ b/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h +@@ -23,9 +23,13 @@ + * questions. + */ + ++#ifdef __GLIBC__ + #define ushort unsigned short + #define uint unsigned int + #define uchar unsigned char ++#else ++#include ++#endif + + struct unpacker; + +--- a/jdk/src/share/native/sun/awt/medialib/mlib_types.h ++++ b/jdk/src/share/native/sun/awt/medialib/mlib_types.h +@@ -27,6 +27,7 @@ + #ifndef MLIB_TYPES_H + #define MLIB_TYPES_H + ++#include /* for NULL */ + #include + #if defined(_MSC_VER) + #include /* for FLT_MAX and DBL_MAX */ +--- a/jdk/src/solaris/native/java/net/Inet4AddressImpl.c ++++ b/jdk/src/solaris/native/java/net/Inet4AddressImpl.c +@@ -47,7 +47,7 @@ + + #include "java_net_Inet4AddressImpl.h" + +-#if defined(__GLIBC__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 601104)) ++#if defined(__linux__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 601104)) + #define HAS_GLIBC_GETHOSTBY_R 1 + #endif + +--- a/jdk/src/solaris/native/java/net/linux_close.c ++++ b/jdk/src/solaris/native/java/net/linux_close.c +@@ -59,7 +59,7 @@ typedef struct { + /* + * Signal to unblock thread + */ +-static int sigWakeup = (__SIGRTMAX - 2); ++static int sigWakeup; + + /* + * fdTable holds one entry per file descriptor, up to a certain +@@ -148,6 +148,9 @@ static void __attribute((constructor)) i + /* + * Setup the signal handler + */ ++#ifndef __AIX ++ sigWakeup = SIGRTMAX - 2; ++#endif + sa.sa_handler = sig_wakeup; + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); +--- a/jdk/src/solaris/native/sun/nio/ch/NativeThread.c ++++ b/jdk/src/solaris/native/sun/nio/ch/NativeThread.c +@@ -36,7 +36,7 @@ + #include + #include + /* Also defined in net/linux_close.c */ +- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2) ++ #define INTERRUPT_SIGNAL (SIGRTMAX - 2) + #elif __solaris__ + #include + #include diff --git a/srcpkgs/openjdk8/files/musl_006_jdk_includes.patch b/srcpkgs/openjdk8/patches/706-musl-includes.patch similarity index 54% rename from srcpkgs/openjdk8/files/musl_006_jdk_includes.patch rename to srcpkgs/openjdk8/patches/706-musl-includes.patch index 6443a1973d5cbb..39cd1e059cab49 100644 --- a/srcpkgs/openjdk8/files/musl_006_jdk_includes.patch +++ b/srcpkgs/openjdk8/patches/706-musl-includes.patch @@ -1,16 +1,16 @@ ---- openjdk.orig/jdk/src/aix/native/java/net/aix_close.c -+++ openjdk/jdk/src/aix/native/java/net/aix_close.c -@@ -62,7 +62,7 @@ +--- a/jdk/src/aix/native/java/net/aix_close.c ++++ b/jdk/src/aix/native/java/net/aix_close.c +@@ -54,7 +54,7 @@ #include #include -#include +#include + #include "jvm.h" /* - * Stack allocated by thread when doing blocking operation ---- openjdk.orig/jdk/src/aix/native/sun/nio/ch/AixNativeThread.c -+++ openjdk/jdk/src/aix/native/sun/nio/ch/AixNativeThread.c +--- a/jdk/src/aix/native/sun/nio/ch/AixNativeThread.c ++++ b/jdk/src/aix/native/sun/nio/ch/AixNativeThread.c @@ -32,7 +32,7 @@ #include "sun_nio_ch_NativeThread.h" @@ -20,8 +20,8 @@ /* Also defined in src/aix/native/java/net/aix_close.c */ #define INTERRUPT_SIGNAL (SIGRTMAX - 1) ---- openjdk.orig/jdk/src/aix/native/sun/nio/ch/AixPollPort.c -+++ openjdk/jdk/src/aix/native/sun/nio/ch/AixPollPort.c +--- a/jdk/src/aix/native/sun/nio/ch/AixPollPort.c ++++ b/jdk/src/aix/native/sun/nio/ch/AixPollPort.c @@ -34,7 +34,7 @@ #include #include @@ -31,8 +31,8 @@ #include #include #include ---- openjdk.orig/jdk/src/macosx/javavm/export/jvm_md.h -+++ openjdk/jdk/src/macosx/javavm/export/jvm_md.h +--- a/jdk/src/macosx/javavm/export/jvm_md.h ++++ b/jdk/src/macosx/javavm/export/jvm_md.h @@ -60,7 +60,7 @@ #include #include @@ -42,8 +42,8 @@ /* O Flags */ ---- openjdk.orig/jdk/src/solaris/javavm/export/jvm_md.h -+++ openjdk/jdk/src/solaris/javavm/export/jvm_md.h +--- a/jdk/src/solaris/javavm/export/jvm_md.h ++++ b/jdk/src/solaris/javavm/export/jvm_md.h @@ -65,7 +65,7 @@ #include #include @@ -53,8 +53,8 @@ /* O Flags */ ---- openjdk.orig/jdk/src/solaris/native/java/net/PlainSocketImpl.c -+++ openjdk/jdk/src/solaris/native/java/net/PlainSocketImpl.c +--- a/jdk/src/solaris/native/java/net/PlainSocketImpl.c ++++ b/jdk/src/solaris/native/java/net/PlainSocketImpl.c @@ -28,7 +28,7 @@ #include #include @@ -64,41 +64,41 @@ #endif #include /* Defines TCP_NODELAY, needed for 2.6 */ #include ---- openjdk.orig/jdk/src/solaris/native/java/net/bsd_close.c -+++ openjdk/jdk/src/solaris/native/java/net/bsd_close.c -@@ -36,7 +36,7 @@ +--- a/jdk/src/solaris/native/java/net/bsd_close.c ++++ b/jdk/src/solaris/native/java/net/bsd_close.c +@@ -38,7 +38,7 @@ #include #include #include -#include +#include + #include "jvm.h" /* - * Stack allocated by thread when doing blocking operation ---- openjdk.orig/jdk/src/solaris/native/java/net/linux_close.c -+++ openjdk/jdk/src/solaris/native/java/net/linux_close.c -@@ -34,7 +34,7 @@ +--- a/jdk/src/solaris/native/java/net/linux_close.c ++++ b/jdk/src/solaris/native/java/net/linux_close.c +@@ -36,7 +36,7 @@ #include #include #include -#include +#include + #include "jvm.h" /* - * Stack allocated by thread when doing blocking operation ---- openjdk.orig/jdk/src/solaris/native/java/net/net_util_md.h -+++ openjdk/jdk/src/solaris/native/java/net/net_util_md.h +--- a/jdk/src/solaris/native/java/net/net_util_md.h ++++ b/jdk/src/solaris/native/java/net/net_util_md.h @@ -33,7 +33,7 @@ #include - + #ifndef USE_SELECT -#include +#include #endif - - int NET_Timeout(int s, long timeout); ---- openjdk.orig/jdk/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c -+++ openjdk/jdk/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c + + +--- a/jdk/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c ++++ b/jdk/src/solaris/native/sun/nio/ch/DevPollArrayWrapper.c @@ -28,7 +28,7 @@ #include "jvm.h" #include "jlong.h" @@ -108,8 +108,8 @@ #include #include ---- openjdk.orig/jdk/src/solaris/native/sun/nio/ch/NativeThread.c -+++ openjdk/jdk/src/solaris/native/sun/nio/ch/NativeThread.c +--- a/jdk/src/solaris/native/sun/nio/ch/NativeThread.c ++++ b/jdk/src/solaris/native/sun/nio/ch/NativeThread.c @@ -34,7 +34,7 @@ #ifdef __linux__ @@ -119,8 +119,8 @@ /* Also defined in net/linux_close.c */ #define INTERRUPT_SIGNAL (SIGRTMAX - 2) #elif __solaris__ ---- openjdk.orig/jdk/src/solaris/native/sun/nio/ch/Net.c -+++ openjdk/jdk/src/solaris/native/sun/nio/ch/Net.c +--- a/jdk/src/solaris/native/sun/nio/ch/Net.c ++++ b/jdk/src/solaris/native/sun/nio/ch/Net.c @@ -23,7 +23,7 @@ * questions. */ @@ -130,8 +130,8 @@ #include #include #include ---- openjdk.orig/jdk/src/solaris/native/sun/nio/fs/LinuxWatchService.c -+++ openjdk/jdk/src/solaris/native/sun/nio/fs/LinuxWatchService.c +--- a/jdk/src/solaris/native/sun/nio/fs/LinuxWatchService.c ++++ b/jdk/src/solaris/native/sun/nio/fs/LinuxWatchService.c @@ -32,7 +32,7 @@ #include #include @@ -141,8 +141,8 @@ #include #include "sun_nio_fs_LinuxWatchService.h" ---- openjdk.orig/jdk/src/solaris/transport/socket/socket_md.c -+++ openjdk/jdk/src/solaris/transport/socket/socket_md.c +--- a/jdk/src/solaris/transport/socket/socket_md.c ++++ b/jdk/src/solaris/transport/socket/socket_md.c @@ -37,7 +37,7 @@ #include #else diff --git a/srcpkgs/openjdk8/patches/LFS64.patch b/srcpkgs/openjdk8/patches/800-lfs.patch similarity index 77% rename from srcpkgs/openjdk8/patches/LFS64.patch rename to srcpkgs/openjdk8/patches/800-lfs.patch index 765a0e65ee79de..2c828814d9e085 100644 --- a/srcpkgs/openjdk8/patches/LFS64.patch +++ b/srcpkgs/openjdk8/patches/800-lfs.patch @@ -1,9 +1,7 @@ -diff --git a/hotspot/src/os/linux/vm/os_linux.inline.hpp b/hotspot/src/os/linux/vm/os_linux.inline.hpp -index a665e4c69c6..65f51254793 100644 --- a/hotspot/src/os/linux/vm/os_linux.inline.hpp +++ b/hotspot/src/os/linux/vm/os_linux.inline.hpp -@@ -81,7 +81,7 @@ inline int os::readdir_buf_size(const char *path) - } +@@ -88,7 +88,7 @@ inline void os::dll_unload(void *lib) { + inline const int os::default_file_open_flags() { return 0;} inline jlong os::lseek(int fd, jlong offset, int whence) { - return (jlong) ::lseek64(fd, offset, whence); @@ -11,7 +9,7 @@ index a665e4c69c6..65f51254793 100644 } inline int os::fsync(int fd) { -@@ -93,7 +93,7 @@ inline char* os::native_path(char *path) { +@@ -100,7 +100,7 @@ inline char* os::native_path(char *path) } inline int os::ftruncate(int fd, jlong length) { @@ -19,12 +17,10 @@ index a665e4c69c6..65f51254793 100644 + return ::ftruncate(fd, length); } - inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf) -diff --git a/hotspot/src/os/linux/vm/attachListener_linux.cpp b/hotspot/src/os/linux/vm/attachListener_linux.cpp -index 3423fb108df..3dc3981e99a 100644 + // macros for restartable system calls --- a/hotspot/src/os/linux/vm/attachListener_linux.cpp +++ b/hotspot/src/os/linux/vm/attachListener_linux.cpp -@@ -446,14 +446,14 @@ AttachOperation* AttachListener::dequeue() { +@@ -446,14 +446,14 @@ AttachOperation* AttachListener::dequeue void AttachListener::vm_start() { char fn[UNIX_PATH_MAX]; @@ -52,7 +48,7 @@ index 3423fb108df..3dc3981e99a 100644 if (ret == -1) { // need to restart attach listener. debug_only(warning("Socket file %s does not exist - Restart Attach Listener", LinuxAttachListener::path())); -@@ -517,12 +517,12 @@ bool AttachListener::is_init_trigger() { +@@ -521,12 +521,12 @@ bool AttachListener::is_init_trigger() { char fn[PATH_MAX+1]; sprintf(fn, ".attach_pid%d", os::current_process_id()); int ret; @@ -68,11 +64,9 @@ index 3423fb108df..3dc3981e99a 100644 } if (ret == 0) { // simple check to avoid starting the attach mechanism when -diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp -index 2e68815d775..ea6f67815a4 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp -@@ -5238,13 +5238,13 @@ int os::open(const char *path, int oflag, int mode) { +@@ -5689,13 +5689,13 @@ int os::open(const char *path, int oflag oflag |= O_CLOEXEC; #endif @@ -89,7 +83,7 @@ index 2e68815d775..ea6f67815a4 100644 int st_mode = buf64.st_mode; if (ret != -1) { -@@ -5284,17 +5284,17 @@ int os::create_binary_file(const char* path, bool rewrite_existing) { +@@ -5738,17 +5738,17 @@ int os::create_binary_file(const char* p if (!rewrite_existing) { oflags |= O_EXCL; } @@ -110,7 +104,7 @@ index 2e68815d775..ea6f67815a4 100644 } // This code originates from JDK's sysAvailable -@@ -5303,9 +5303,9 @@ jlong os::seek_to_file_offset(int fd, jlong offset) { +@@ -5757,9 +5757,9 @@ jlong os::seek_to_file_offset(int fd, jl int os::available(int fd, jlong *bytes) { jlong cur, end; int mode; @@ -121,8 +115,8 @@ index 2e68815d775..ea6f67815a4 100644 + if (::fstat(fd, &buf64) >= 0) { mode = buf64.st_mode; if (S_ISCHR(mode) || S_ISFIFO(mode) || S_ISSOCK(mode)) { - int n; -@@ -5315,11 +5315,11 @@ int os::available(int fd, jlong *bytes) { + /* +@@ -5774,11 +5774,11 @@ int os::available(int fd, jlong *bytes) } } } diff --git a/srcpkgs/openjdk8/patches/999-native-no-sysroot.patch b/srcpkgs/openjdk8/patches/999-native-no-sysroot.patch index aabc19835d5c09..4c24f53498dbd8 100644 --- a/srcpkgs/openjdk8/patches/999-native-no-sysroot.patch +++ b/srcpkgs/openjdk8/patches/999-native-no-sysroot.patch @@ -4,7 +4,7 @@ Newer versions of OpenJDK have seemingly fixed this, 8 has not. --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk -@@ -384,10 +384,6 @@ +@@ -384,10 +384,6 @@ define SetupNativeCompilation $$(error Unknown value for OPTIMIZATION: $$($1_OPTIMIZATION)) endif @@ -15,7 +15,7 @@ Newer versions of OpenJDK have seemingly fixed this, 8 has not. # Now call add_native_source for each source file we are going to compile. $$(foreach p,$$($1_SRCS), \ $$(eval $$(call add_native_source,$1,$$p,$$($1_OBJECT_DIR), \ -@@ -433,8 +429,6 @@ +@@ -433,8 +429,6 @@ define SetupNativeCompilation $1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE)) endif diff --git a/srcpkgs/openjdk8/template b/srcpkgs/openjdk8/template index 2203dd846bcfcd..5f34873ebac11b 100644 --- a/srcpkgs/openjdk8/template +++ b/srcpkgs/openjdk8/template @@ -1,12 +1,12 @@ # Template file for 'openjdk8' pkgname=openjdk8 -version=8u452b09 +version=8u504b01 revision=1 _jdk_update="${version#*u}" _jdk_update="${_jdk_update%b*}" _jdk_build="${version#*b}" _jdk_home="usr/lib/jvm/openjdk8" -_commit="bdc2203a44df159d94ecd0e04a230e65cb84297e" +_commit="bf8806400b80810beac384fc6b57855f0b1ece1b" archs="x86_64* i686* aarch64* arm* ppc64*" build_style=gnu-configure configure_args=" @@ -43,7 +43,8 @@ homepage="http://openjdk.java.net/" # we're using aarch64 port repo to get aarch64 JIT; the repo is # otherwise the same as the normal one, just with aarch64 port added distfiles="https://github.com/openjdk/shenandoah-jdk8u/archive/${_commit}.tar.gz" -checksum=4c39be8454a1b8b10a9ff845a4e7e639808799d3d2eddb1484df80835d5e88e4 +distfiles="https://github.com/openjdk/shenandoah-jdk8u/archive/refs/tags/shenandoah8u${_jdk_update}-b${_jdk_build}.tar.gz" +checksum=159ad1f19dda34698f1b1fe144ddc79ba62ae558011f04538608075aa2bc9d11 disable_parallel_build=yes @@ -83,29 +84,9 @@ post_extract() { } post_patch() { - # gcc complains about the signed shift left - vsed -i jdk/src/share/native/com/sun/java/util/jar/pack/constants.h \ - -e's;(-1)<<13;~0u<<13;g' - - # wrong "return false;" instead of "return null;" - vsed -i jdk/src/share/native/com/sun/java/util/jar/pack/jni.cpp \ - -e"295s;false;null;" - # pretend we're a git checkout echo "${_commit}" > .gittip mkdir .git - - if [ "$XBPS_TARGET_LIBC" = "musl" ]; then - for f in "${FILESDIR}"/musl_*.patch; do - echo "Applying $f" - patch -sNp1 -i "$f" - done - - # add cross prefix for thread_db.h check, fix cross from glibc to musl - sed -i "s,/usr/include/thread_db.h,${XBPS_CROSS_BASE}/usr/include/thread_db.h," \ - hotspot/make/linux/makefiles/defs.make hotspot/make/linux/makefiles/sa.make \ - hotspot/make/linux/makefiles/saproc.make - fi } do_configure() { @@ -129,6 +110,9 @@ do_configure() { CFLAGS+=" -D_LARGE_FILE_SOURCE=1 -D_FILE_OFFSET_BITS=64" CXXFLAGS+=" -D_LARGE_FILE_SOURCE=1 -D_FILE_OFFSET_BITS=64" + # error bool cannot be defined via typedef + CFLAGS+=" -std=c17" + ./configure ${configure_args} --with-extra-cflags="$CFLAGS" \ --with-extra-cxxflags="$CXXFLAGS" --with-extra-ldflags="$LDFLAGS" } @@ -151,8 +135,9 @@ post_install() { ln -srf "${bin}" "${bin/jre/}" done - vmkdir ${_jdk_home}/lib/security + vmkdir ${_jdk_home}/jre/lib/security ln -fs /etc/ssl/certs/java/cacerts "${DESTDIR}/${_jdk_home}/lib/security" + ln -fs /etc/ssl/certs/java/cacerts "${DESTDIR}/${_jdk_home}/jre/lib/security" vlicense ASSEMBLY_EXCEPTION vlicense LICENSE