diff --git a/pkgs/development/compilers/openjdk/17/patches/fix-library-path-jdk17.patch b/pkgs/development/compilers/openjdk/17/patches/fix-library-path-jdk17.patch index 4c38aca2b48a..71d96631ef89 100644 --- a/pkgs/development/compilers/openjdk/17/patches/fix-library-path-jdk17.patch +++ b/pkgs/development/compilers/openjdk/17/patches/fix-library-path-jdk17.patch @@ -1,6 +1,8 @@ +diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp +index 7c951cee51..bcc61ff43d 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp -@@ -412,18 +412,8 @@ void os::init_system_properties_values() { +@@ -416,18 +416,8 @@ // 1: ... // ... // 7: The default directories, normally /lib and /usr/lib. @@ -18,8 +20,8 @@ -#define SYS_EXT_DIR "/usr/java/packages" #define EXTENSIONS_DIR "/lib/ext" - // Buffer that fits several sprintfs. -@@ -431,7 +421,7 @@ void os::init_system_properties_values() { + // Buffer that fits several snprintfs. +@@ -435,7 +425,7 @@ // by the nulls included by the sizeof operator. const size_t bufsize = MAX2((size_t)MAXPATHLEN, // For dll_dir & friends. @@ -28,28 +30,26 @@ char *buf = NEW_C_HEAP_ARRAY(char, bufsize, mtInternal); // sysclasspath, java_home, dll_dir -@@ -478,26 +468,22 @@ void os::init_system_properties_values() { +@@ -482,24 +472,20 @@ // should always exist (until the legacy problem cited above is // addressed). const char *v = ::getenv("LD_LIBRARY_PATH"); - const char *v_colon = ":"; - if (v == NULL) { v = ""; v_colon = ""; } +- // That's +1 for the colon and +1 for the trailing '\0'. +- size_t pathsize = strlen(v) + 1 + sizeof(SYS_EXT_DIR) + sizeof("/lib/") + sizeof(DEFAULT_LIBPATH) + 1; + if (v == NULL) { v = ""; } - // That's +1 for the colon and +1 for the trailing '\0'. - char *ld_library_path = NEW_C_HEAP_ARRAY(char, -- strlen(v) + 1 + -- sizeof(SYS_EXT_DIR) + sizeof("/lib/") + sizeof(DEFAULT_LIBPATH) + 1, -+ strlen(v) + 1, - mtInternal); -- sprintf(ld_library_path, "%s%s" SYS_EXT_DIR "/lib:" DEFAULT_LIBPATH, v, v_colon); -+ sprintf(ld_library_path, "%s", v); ++ size_t pathsize = strlen(v) + 1; + char *ld_library_path = NEW_C_HEAP_ARRAY(char, pathsize, mtInternal); +- os::snprintf_checked(ld_library_path, pathsize, "%s%s" SYS_EXT_DIR "/lib:" DEFAULT_LIBPATH, v, v_colon); ++ os::snprintf_checked(ld_library_path, pathsize, "%s", v); Arguments::set_library_path(ld_library_path); FREE_C_HEAP_ARRAY(char, ld_library_path); } // Extensions directories. -- sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home()); -+ sprintf(buf, "%s" EXTENSIONS_DIR, Arguments::get_java_home()); +- os::snprintf_checked(buf, bufsize, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home()); ++ os::snprintf_checked(buf, bufsize, "%s" EXTENSIONS_DIR, Arguments::get_java_home()); Arguments::set_ext_dirs(buf); FREE_C_HEAP_ARRAY(char, buf); @@ -57,4 +57,5 @@ -#undef DEFAULT_LIBPATH -#undef SYS_EXT_DIR #undef EXTENSIONS_DIR - } \ No newline at end of file + } + diff --git a/pkgs/development/compilers/openjdk/17/source.json b/pkgs/development/compilers/openjdk/17/source.json index 546e2fff8a19..c372853e70e0 100644 --- a/pkgs/development/compilers/openjdk/17/source.json +++ b/pkgs/development/compilers/openjdk/17/source.json @@ -1,6 +1,6 @@ { - "hash": "sha256-9UB1H3gd+b4wWxOMgsdDPgX/IGWNORKk1gMsSjYoZMw=", + "hash": "sha256-wHJlCmaE8titkfcWb2WboqemekPBn3JWc4bGyWskmoY=", "owner": "openjdk", "repo": "jdk17u", - "rev": "jdk-17.0.12+7" + "rev": "refs/tags/jdk-17.0.13+11" } diff --git a/pkgs/development/compilers/openjdk/generic.nix b/pkgs/development/compilers/openjdk/generic.nix index 49742ca8b989..669057216a55 100644 --- a/pkgs/development/compilers/openjdk/generic.nix +++ b/pkgs/development/compilers/openjdk/generic.nix @@ -221,15 +221,6 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-Qcm3ZmGCOYLZcskNjj7DYR85R4v07vYvvavrVOYL8vg="; }) ] - ++ lib.optionals (featureVersion == "17") [ - # Backport fixes for musl 1.2.4 which are already applied in jdk21+ - # Fetching patch from chimera because they already went through the effort of rebasing it onto jdk17 - (fetchurl { - name = "lfs64.patch"; - url = "https://raw.githubusercontent.com/chimera-linux/cports/4614075d19e9c9636f3f7e476687247f63330a35/contrib/openjdk17/patches/lfs64.patch"; - hash = "sha256-t2mRbdEiumBAbIAC0zsJNwCn59WYWHsnRtuOSL6bWB4="; - }) - ] ++ lib.optionals (!headless && enableGtk) [ ( if atLeast17 then