diff --git a/make/InitSupport.gmk b/make/InitSupport.gmk index 267a2721270..dbe0fdc2b3d 100644 --- a/make/InitSupport.gmk +++ b/make/InitSupport.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -215,13 +215,15 @@ ifeq ($(HAS_SPEC), ) $$(if $$(findstring $$(CONF), $$(var)), $$(var)))) endif ifneq ($$(filter $$(CONF), $$(matching_confs)), ) + ifneq ($$(word 2, $$(matching_confs)), ) + # Don't repeat this output on make restarts caused by including + # generated files. + ifeq ($$(MAKE_RESTARTS), ) + $$(info Using exact match for CONF=$$(CONF) (other matches are possible)) + endif + endif # If we found an exact match, use that matching_confs := $$(CONF) - # Don't repeat this output on make restarts caused by including - # generated files. - ifeq ($$(MAKE_RESTARTS), ) - $$(info Using exact match for CONF=$$(CONF) (other matches are possible)) - endif endif endif ifeq ($$(matching_confs), ) diff --git a/make/autoconf/basic.m4 b/make/autoconf/basic.m4 index f574174a12e..35eb63bea0c 100644 --- a/make/autoconf/basic.m4 +++ b/make/autoconf/basic.m4 @@ -84,9 +84,15 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS], # We get the top-level directory from the supporting wrappers. BASIC_WINDOWS_VERIFY_DIR($TOPDIR, source) + orig_topdir="$TOPDIR" UTIL_FIXUP_PATH(TOPDIR) AC_MSG_CHECKING([for top-level directory]) AC_MSG_RESULT([$TOPDIR]) + if test "x$TOPDIR" != "x$orig_topdir"; then + AC_MSG_WARN([Your top dir was originally represented as $orig_topdir,]) + AC_MSG_WARN([but after rewriting it became $TOPDIR.]) + AC_MSG_WARN([This typically means you have characters like space in the path, which can cause all kind of trouble.]) + fi AC_SUBST(TOPDIR) if test "x$CUSTOM_ROOT" != x; then diff --git a/make/autoconf/util_paths.m4 b/make/autoconf/util_paths.m4 index 7717150dfd9..9e3e5472c9e 100644 --- a/make/autoconf/util_paths.m4 +++ b/make/autoconf/util_paths.m4 @@ -77,7 +77,10 @@ AC_DEFUN([UTIL_FIXUP_PATH], imported_path="" fi fi - if test "x$imported_path" != "x$path"; then + [ imported_path_lower=`$ECHO $imported_path | $TR '[:upper:]' '[:lower:]'` ] + [ orig_path_lower=`$ECHO $path | $TR '[:upper:]' '[:lower:]'` ] + # If only case differs, keep original path + if test "x$imported_path_lower" != "x$orig_path_lower"; then $1="$imported_path" fi else @@ -357,6 +360,8 @@ AC_DEFUN([UTIL_SETUP_TOOL], fi $1="$tool_command" fi + # Make sure we add fixpath if needed + UTIL_FIXUP_EXECUTABLE($1) if test "x$tool_args" != x; then # If we got arguments, re-append them to the command after the fixup. $1="[$]$1 $tool_args" diff --git a/make/modules/jdk.incubator.vector/Lib.gmk b/make/modules/jdk.incubator.vector/Lib.gmk index 69da7ed059a..7d2ef440b67 100644 --- a/make/modules/jdk.incubator.vector/Lib.gmk +++ b/make/modules/jdk.incubator.vector/Lib.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -64,7 +64,7 @@ ifeq ($(call isTargetOs, linux)+$(call isTargetCpu, aarch64)+$(INCLUDE_COMPILER2 EXTRA_SRC := libsleef/generated, \ DISABLED_WARNINGS_gcc := unused-function sign-compare tautological-compare ignored-qualifiers, \ DISABLED_WARNINGS_clang := unused-function sign-compare tautological-compare ignored-qualifiers, \ - CFLAGS := $(SVE_CFLAGS), \ + vector_math_sve.c_CFLAGS := $(SVE_CFLAGS), \ )) TARGETS += $(BUILD_LIBSLEEF) diff --git a/src/java.base/share/classes/jdk/internal/misc/CDS.java b/src/java.base/share/classes/jdk/internal/misc/CDS.java index 8661a2b3ff2..e22baf72c82 100644 --- a/src/java.base/share/classes/jdk/internal/misc/CDS.java +++ b/src/java.base/share/classes/jdk/internal/misc/CDS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,10 @@ import java.io.InputStream; import java.io.IOException; import java.io.PrintStream; +import java.net.URL; +import java.net.URLClassLoader; +import java.nio.file.InvalidPathException; +import java.nio.file.Path; import java.util.Arrays; import java.util.ArrayList; import java.util.List; @@ -337,4 +341,112 @@ private static String dumpSharedArchive(boolean isStatic, String fileName) throw System.out.println("The process was attached by jcmd and dumped a " + (isStatic ? "static" : "dynamic") + " archive " + archiveFilePath); return archiveFilePath; } + + /** + * This class is used only by native JVM code at CDS dump time for loading + * "unregistered classes", which are archived classes that are intended to + * be loaded by custom class loaders during runtime. + * See src/hotspot/share/cds/unregisteredClasses.cpp. + */ + private static class UnregisteredClassLoader extends URLClassLoader { + private String currentClassName; + private Class currentSuperClass; + private Class[] currentInterfaces; + + /** + * Used only by native code. Construct an UnregisteredClassLoader for loading + * unregistered classes from the specified file. If the file doesn't exist, + * the exception will be caughted by native code which will print a warning message and continue. + * + * @param fileName path of the the JAR file to load unregistered classes from. + */ + private UnregisteredClassLoader(String fileName) throws InvalidPathException, IOException { + super(toURLArray(fileName), /*parent*/null); + currentClassName = null; + currentSuperClass = null; + currentInterfaces = null; + } + + private static URL[] toURLArray(String fileName) throws InvalidPathException, IOException { + if (!((new File(fileName)).exists())) { + throw new IOException("No such file: " + fileName); + } + return new URL[] { + // Use an intermediate File object to construct a URI/URL without + // authority component as URLClassPath can't handle URLs with a UNC + // server name in the authority component. + Path.of(fileName).toRealPath().toFile().toURI().toURL() + }; + } + + + /** + * Load the class of the given /name from the JAR file that was given to + * the constructor of the current UnregisteredClassLoader instance. This class must be + * a direct subclass of superClass. This class must be declared to implement + * the specified interfaces. + *

+ * This method must be called in a single threaded context. It will never be recursed (thus + * the asserts) + * + * @param name the name of the class to be loaded. + * @param superClass must not be null. The named class must have a super class. + * @param interfaces could be null if the named class does not implement any interfaces. + */ + private Class load(String name, Class superClass, Class[] interfaces) + throws ClassNotFoundException + { + assert currentClassName == null; + assert currentSuperClass == null; + assert currentInterfaces == null; + + try { + currentClassName = name; + currentSuperClass = superClass; + currentInterfaces = interfaces; + + return findClass(name); + } finally { + currentClassName = null; + currentSuperClass = null; + currentInterfaces = null; + } + } + + /** + * This method must be called from inside the load() method. The /name + * can be only: + *