From e80619a032c16d16de6e063e7650b60bc317ee7e Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Fri, 22 Mar 2024 14:12:26 +0000 Subject: [PATCH] 8328680: Introduce JDK_LIB, and clean up module native compilation Reviewed-by: erikj, jwaters --- make/autoconf/libraries.m4 | 4 +- make/autoconf/spec.gmk.template | 1 - make/common/JdkNativeCompilation.gmk | 10 +++++ make/common/modules/LauncherCommon.gmk | 24 +++++----- make/hotspot/lib/CompileGtest.gmk | 8 ++-- make/modules/java.instrument/Lib.gmk | 33 +++++++------- make/modules/java.management/Lib.gmk | 11 +++-- make/modules/java.prefs/Lib.gmk | 19 ++++---- make/modules/java.rmi/Launcher.gmk | 6 ++- make/modules/java.rmi/Lib.gmk | 8 ++-- make/modules/java.scripting/Launcher.gmk | 6 ++- make/modules/java.security.jgss/Launcher.gmk | 14 +++++- make/modules/java.security.jgss/Lib.gmk | 32 ++++++++----- make/modules/java.smartcardio/Lib.gmk | 4 +- make/modules/jdk.attach/Lib.gmk | 11 ++--- make/modules/jdk.compiler/Launcher.gmk | 16 +++++-- make/modules/jdk.crypto.cryptoki/Lib.gmk | 4 +- make/modules/jdk.crypto.mscapi/Lib.gmk | 9 ++-- make/modules/jdk.hotspot.agent/Launcher.gmk | 6 ++- make/modules/jdk.hotspot.agent/Lib.gmk | 47 +++++++++++--------- make/modules/jdk.httpserver/Launcher.gmk | 6 ++- make/modules/jdk.incubator.vector/Lib.gmk | 4 +- make/modules/jdk.internal.le/Lib.gmk | 14 +++--- make/modules/jdk.jartool/Launcher.gmk | 10 ++++- make/modules/jdk.javadoc/Launcher.gmk | 6 ++- make/modules/jdk.jcmd/Launcher.gmk | 26 ++++++++++- make/modules/jdk.jconsole/Launcher.gmk | 15 ++++--- make/modules/jdk.jdeps/Launcher.gmk | 14 +++++- make/modules/jdk.jdi/Launcher.gmk | 6 ++- make/modules/jdk.jdi/Lib.gmk | 10 ++--- make/modules/jdk.jdwp.agent/Lib.gmk | 23 +++++----- make/modules/jdk.jfr/Launcher.gmk | 6 ++- make/modules/jdk.jlink/Launcher.gmk | 22 ++++++--- make/modules/jdk.jpackage/Launcher.gmk | 6 ++- make/modules/jdk.jshell/Launcher.gmk | 6 ++- make/modules/jdk.jstatd/Launcher.gmk | 6 ++- make/modules/jdk.management.agent/Lib.gmk | 9 ++-- make/modules/jdk.management/Lib.gmk | 15 +++---- make/modules/jdk.net/Lib.gmk | 30 ++++++------- make/modules/jdk.sctp/Lib.gmk | 39 ++++++++-------- make/modules/jdk.security.auth/Lib.gmk | 6 +-- 41 files changed, 345 insertions(+), 207 deletions(-) diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4 index 51d4f724c33..0aa42070a71 100644 --- a/make/autoconf/libraries.m4 +++ b/make/autoconf/libraries.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, 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 @@ -171,13 +171,11 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES], LIB_SETUP_JVM_LIBS(TARGET) JDKLIB_LIBS="$BASIC_JDKLIB_LIBS" - JDKEXE_LIBS="" JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_TARGET" OPENJDK_BUILD_JDKLIB_LIBS="$BASIC_JDKLIB_LIBS" OPENJDK_BUILD_JVM_LIBS="$BASIC_JVM_LIBS $BASIC_JVM_LIBS_BUILD" AC_SUBST(JDKLIB_LIBS) - AC_SUBST(JDKEXE_LIBS) AC_SUBST(JVM_LIBS) AC_SUBST(OPENJDK_BUILD_JDKLIB_LIBS) AC_SUBST(OPENJDK_BUILD_JVM_LIBS) diff --git a/make/autoconf/spec.gmk.template b/make/autoconf/spec.gmk.template index c0a0c9e1506..a18bfcf6210 100644 --- a/make/autoconf/spec.gmk.template +++ b/make/autoconf/spec.gmk.template @@ -559,7 +559,6 @@ JDKLIB_LIBS := @JDKLIB_LIBS@ # LDFLAGS used to link the jdk native launchers (C-code) LDFLAGS_JDKEXE := @LDFLAGS_JDKEXE@ -JDKEXE_LIBS := @JDKEXE_LIBS@ # LDFLAGS specific to C++ linking. LDFLAGS_CXX_JDK := @LDFLAGS_CXX_JDK@ diff --git a/make/common/JdkNativeCompilation.gmk b/make/common/JdkNativeCompilation.gmk index f979c0b1a2b..252aa072bd0 100644 --- a/make/common/JdkNativeCompilation.gmk +++ b/make/common/JdkNativeCompilation.gmk @@ -187,6 +187,11 @@ define SetupJdkLibraryBody # Add the module specific java header dir $1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE))) + $1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS)) + $1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS_TYPE)) + # Prepend JDK libs before external libs + $1_LIBS := $$($1_JDK_LIBS) $$($1_LIBS) + ifneq ($$($1_EXTRA_HEADER_DIRS), ) $1_PROCESSED_EXTRA_HEADER_DIRS := $$(foreach dir, $$($1_EXTRA_HEADER_DIRS), \ $$(call ProcessDir, $$(dir))) @@ -273,6 +278,11 @@ define SetupJdkExecutableBody -I$(TOPDIR)/src/java.base/windows/native/common \ $$($1_EXTRA_RCFLAGS) + $1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS)) + $1_JDK_LIBS += $$($1_JDK_LIBS_$$(OPENJDK_TARGET_OS_TYPE)) + # Prepend JDK libs before external libs + $1_LIBS := $$($1_JDK_LIBS) $$($1_LIBS) + ifneq ($$($1_DEFAULT_CFLAGS), false) # Set the default flags first to be able to override $1_CFLAGS := $$(filter-out $$($1_CFLAGS_FILTER_OUT), $$(CFLAGS_JDKEXE)) $$($1_CFLAGS) diff --git a/make/common/modules/LauncherCommon.gmk b/make/common/modules/LauncherCommon.gmk index b9f9962e8ab..83ef53a0111 100644 --- a/make/common/modules/LauncherCommon.gmk +++ b/make/common/modules/LauncherCommon.gmk @@ -122,10 +122,6 @@ define SetupBuildLauncherBody endif endif - ifeq ($(USE_EXTERNAL_LIBZ), true) - $1_LIBS += -lz - endif - $1_WINDOWS_JLI_LIB := $(call FindStaticLib, java.base, jli, /libjli) $1_EXTRA_FILES := $(LAUNCHER_SRC)/main.c @@ -155,13 +151,19 @@ define SetupBuildLauncherBody LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \ -L$(call FindLibDirForModule, java.base), \ LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \ - LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \ - LIBS_linux := -ljli -lpthread $(LIBDL), \ - LIBS_macosx := -ljli -framework Cocoa -framework Security \ - -framework ApplicationServices, \ - LIBS_aix := -ljli_static, \ - LIBS_windows := $$($1_WINDOWS_JLI_LIB) \ - $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib, \ + JDK_LIBS_linux := -ljli, \ + JDK_LIBS_macosx := -ljli, \ + JDK_LIBS_aix := -ljli_static, \ + JDK_LIBS_windows := \ + $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib \ + $$($1_WINDOWS_JLI_LIB), \ + LIBS := $$($1_LIBS), \ + LIBS_unix := $(LIBZ_LIBS), \ + LIBS_linux := $(LIBDL) -lpthread, \ + LIBS_macosx := \ + -framework ApplicationServices \ + -framework Cocoa \ + -framework Security, \ OUTPUT_DIR := $$($1_OUTPUT_DIR), \ VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \ EXTRA_RCFLAGS := $$($1_EXTRA_RCFLAGS), \ diff --git a/make/hotspot/lib/CompileGtest.gmk b/make/hotspot/lib/CompileGtest.gmk index 40430091387..e31b37d3bdf 100644 --- a/make/hotspot/lib/CompileGtest.gmk +++ b/make/hotspot/lib/CompileGtest.gmk @@ -109,9 +109,9 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \ DEFAULT_LDFLAGS := false, \ LDFLAGS := $(JVM_LDFLAGS), \ LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/libgtest, \ + JDK_LIBS_unix := -lgtest, \ + JDK_LIBS_windows := $(JVM_OUTPUTDIR)/libgtest/gtest.lib, \ LIBS := $(JVM_LIBS), \ - LIBS_unix := -lgtest, \ - LIBS_windows := $(JVM_OUTPUTDIR)/libgtest/gtest.lib, \ OPTIMIZATION := $(JVM_OPTIMIZATION), \ COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \ ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \ @@ -146,8 +146,8 @@ $(eval $(call SetupJdkExecutable, BUILD_GTEST_LAUNCHER, \ -I$(GTEST_FRAMEWORK_SRC)/googlemock/include, \ LD_SET_ORIGIN := false, \ LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/gtest $(call SET_SHARED_LIBRARY_ORIGIN), \ - LIBS_unix := -ljvm, \ - LIBS_windows := $(JVM_OUTPUTDIR)/gtest/objs/jvm.lib, \ + JDK_LIBS_unix := -ljvm, \ + JDK_LIBS_windows := $(JVM_OUTPUTDIR)/gtest/objs/jvm.lib, \ COPY_DEBUG_SYMBOLS := $(GTEST_COPY_DEBUG_SYMBOLS), \ ZIP_EXTERNAL_DEBUG_SYMBOLS := false, \ )) diff --git a/make/modules/java.instrument/Lib.gmk b/make/modules/java.instrument/Lib.gmk index 0fff8aab93a..95267a6cd95 100644 --- a/make/modules/java.instrument/Lib.gmk +++ b/make/modules/java.instrument/Lib.gmk @@ -25,32 +25,35 @@ include LibCommon.gmk +################################################################################ +## Build libinstrument ################################################################################ -ifeq ($(call isTargetOs, windows), true) - # equivalent of strcasecmp is stricmp on Windows - LIBINSTRUMENT_CFLAGS := -Dstrcasecmp=stricmp - WINDOWS_JLI_LIB := $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib -endif - +# equivalent of strcasecmp is stricmp on Windows $(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \ NAME := instrument, \ OPTIMIZATION := LOW, \ - CFLAGS := $(LIBINSTRUMENT_CFLAGS), \ + CFLAGS_windows := -Dstrcasecmp=stricmp, \ CFLAGS_debug := -DJPLIS_LOGGING, \ CFLAGS_release := -DNO_JPLIS_LOGGING, \ EXTRA_HEADER_DIRS := java.base:libjli, \ LDFLAGS_linux := -L$(call FindLibDirForModule, java.base), \ LDFLAGS_macosx := -L$(call FindLibDirForModule, java.base), \ LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \ - LIBS := $(JDKLIB_LIBS), \ + JDK_LIBS := $(JDKLIB_LIBS), \ + JDK_LIBS_linux := -ljli, \ + JDK_LIBS_macosx := -ljli, \ + JDK_LIBS_aix := -ljli_static, \ + JDK_LIBS_windows := $(WIN_JAVA_LIB) \ + $(SUPPORT_OUTPUTDIR)/native/java.base/libjli/jli.lib jvm.lib, \ LIBS_unix := $(LIBZ_LIBS), \ - LIBS_linux := -ljli $(LIBDL), \ - LIBS_aix := -liconv -ljli_static $(LIBDL), \ - LIBS_macosx := -ljli -liconv -framework Cocoa -framework Security \ - -framework ApplicationServices, \ - LIBS_windows := jvm.lib $(WIN_JAVA_LIB) advapi32.lib \ - $(WINDOWS_JLI_LIB), \ + LIBS_linux := $(LIBDL), \ + LIBS_aix := $(LIBDL) -liconv, \ + LIBS_macosx := -liconv \ + -framework ApplicationServices \ + -framework Cocoa \ + -framework Security, \ + LIBS_windows := advapi32.lib, \ )) ifeq ($(call isTargetOs, aix), true) @@ -61,5 +64,3 @@ endif $(BUILD_LIBINSTRUMENT): $(call FindLib, java.base, java) TARGETS += $(BUILD_LIBINSTRUMENT) - -################################################################################ diff --git a/make/modules/java.management/Lib.gmk b/make/modules/java.management/Lib.gmk index a32bc8181fe..c7012f2494b 100644 --- a/make/modules/java.management/Lib.gmk +++ b/make/modules/java.management/Lib.gmk @@ -28,18 +28,17 @@ include LibCommon.gmk ################################################################################ LIBMANAGEMENT_OPTIMIZATION := HIGH -ifeq ($(call isTargetOs, linux), true) - ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true) - LIBMANAGEMENT_OPTIMIZATION := LOW - endif +ifeq ($(call isTargetOs, linux)+$(COMPILE_WITH_DEBUG_SYMBOLS), true+true) + LIBMANAGEMENT_OPTIMIZATION := LOW endif $(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT, \ NAME := management, \ OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \ - LIBS := $(JDKLIB_LIBS), \ + JDK_LIBS := $(JDKLIB_LIBS), \ + JDK_LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \ LIBS_aix := -lperfstat,\ - LIBS_windows := jvm.lib psapi.lib $(WIN_JAVA_LIB) advapi32.lib, \ + LIBS_windows := advapi32.lib psapi.lib, \ )) $(BUILD_LIBMANAGEMENT): $(call FindLib, java.base, java) diff --git a/make/modules/java.prefs/Lib.gmk b/make/modules/java.prefs/Lib.gmk index 23140cf659b..4fce91d1a72 100644 --- a/make/modules/java.prefs/Lib.gmk +++ b/make/modules/java.prefs/Lib.gmk @@ -25,26 +25,29 @@ include LibCommon.gmk +################################################################################ +## Build libprefs ################################################################################ # libprefs on macosx do not use the unix code ifeq ($(call isTargetOs, macosx), true) - LIBPREFS_EXCLUDE_SRC_PATTERNS := unix + LIBPREFS_EXCLUDE_SRC_PATTERNS := /unix/ endif $(eval $(call SetupJdkLibrary, BUILD_LIBPREFS, \ NAME := prefs, \ EXCLUDE_SRC_PATTERNS := $(LIBPREFS_EXCLUDE_SRC_PATTERNS), \ OPTIMIZATION := HIGH, \ - LIBS_unix := -ljvm, \ - LIBS_linux := -ljava, \ - LIBS_aix := -ljava, \ - LIBS_macosx := -framework CoreFoundation -framework Foundation, \ - LIBS_windows := advapi32.lib jvm.lib $(WIN_JAVA_LIB), \ + JDK_LIBS_unix := -ljvm, \ + JDK_LIBS_linux := -ljava, \ + JDK_LIBS_aix := -ljava, \ + JDK_LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \ + LIBS_macosx := \ + -framework CoreFoundation \ + -framework Foundation, \ + LIBS_windows := advapi32.lib, \ )) $(BUILD_LIBPREFS): $(call FindLib, java.base, java) TARGETS += $(BUILD_LIBPREFS) - -################################################################################ diff --git a/make/modules/java.rmi/Launcher.gmk b/make/modules/java.rmi/Launcher.gmk index 001bc204c94..14b381a540e 100644 --- a/make/modules/java.rmi/Launcher.gmk +++ b/make/modules/java.rmi/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, 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 @@ -25,6 +25,10 @@ include LauncherCommon.gmk +################################################################################ +## Build rmiregistry +################################################################################ + $(eval $(call SetupBuildLauncher, rmiregistry, \ MAIN_CLASS := sun.rmi.registry.RegistryImpl, \ JAVA_ARGS := -Djava.security.manager=allow, \ diff --git a/make/modules/java.rmi/Lib.gmk b/make/modules/java.rmi/Lib.gmk index 9b40e974d75..45b3067caca 100644 --- a/make/modules/java.rmi/Lib.gmk +++ b/make/modules/java.rmi/Lib.gmk @@ -25,17 +25,17 @@ include LibCommon.gmk +################################################################################ +## Build librmi ################################################################################ $(eval $(call SetupJdkLibrary, BUILD_LIBRMI, \ NAME := rmi, \ OPTIMIZATION := LOW, \ - LIBS_unix := -ljvm, \ - LIBS_windows := jvm.lib, \ + JDK_LIBS_unix := -ljvm, \ + JDK_LIBS_windows := jvm.lib, \ )) $(BUILD_LIBRMI): $(call FindLib, java.base, java) TARGETS += $(BUILD_LIBRMI) - -################################################################################ diff --git a/make/modules/java.scripting/Launcher.gmk b/make/modules/java.scripting/Launcher.gmk index 057d2bf3aca..a969b567d1e 100644 --- a/make/modules/java.scripting/Launcher.gmk +++ b/make/modules/java.scripting/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, 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 @@ -25,6 +25,10 @@ include LauncherCommon.gmk +################################################################################ +## Build jrunscript +################################################################################ + $(eval $(call SetupBuildLauncher, jrunscript, \ MAIN_CLASS := com.sun.tools.script.shell.Main, \ JAVA_ARGS := --add-modules ALL-DEFAULT, \ diff --git a/make/modules/java.security.jgss/Launcher.gmk b/make/modules/java.security.jgss/Launcher.gmk index c17ece4becf..b0e2fdcffd1 100644 --- a/make/modules/java.security.jgss/Launcher.gmk +++ b/make/modules/java.security.jgss/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, 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 @@ -26,14 +26,26 @@ include LauncherCommon.gmk ifeq ($(call isTargetOs, windows), true) + ############################################################################## + ## Build kinit + ############################################################################## + $(eval $(call SetupBuildLauncher, kinit, \ MAIN_CLASS := sun.security.krb5.internal.tools.Kinit, \ )) + ############################################################################## + ## Build klist + ############################################################################## + $(eval $(call SetupBuildLauncher, klist, \ MAIN_CLASS := sun.security.krb5.internal.tools.Klist, \ )) + ############################################################################## + ## Build ktab + ############################################################################## + $(eval $(call SetupBuildLauncher, ktab, \ MAIN_CLASS := sun.security.krb5.internal.tools.Ktab, \ )) diff --git a/make/modules/java.security.jgss/Lib.gmk b/make/modules/java.security.jgss/Lib.gmk index 828d50f78b5..f5250c43999 100644 --- a/make/modules/java.security.jgss/Lib.gmk +++ b/make/modules/java.security.jgss/Lib.gmk @@ -25,57 +25,67 @@ include LibCommon.gmk +################################################################################ +## Build libj2gss ################################################################################ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2GSS, \ NAME := j2gss, \ OPTIMIZATION := LOW, \ DISABLED_WARNINGS_gcc := undef, \ - DISABLED_WARNINGS_clang_aix := undef, \ DISABLED_WARNINGS_clang := undef, \ - LIBS := $(LIBDL), \ + LIBS_unix := $(LIBDL), \ )) TARGETS += $(BUILD_LIBJ2GSS) ifeq ($(call isTargetOs, windows), true) + ############################################################################## + ## Build libsspi_bridge + ############################################################################## + $(eval $(call SetupJdkLibrary, BUILD_LIBSSPI_BRIDGE, \ NAME := sspi_bridge, \ OPTIMIZATION := LOW, \ EXTRA_HEADER_DIRS := libj2gss, \ - LIBS := Secur32.lib, \ + LIBS_windows := secur32.lib, \ )) TARGETS += $(BUILD_LIBSSPI_BRIDGE) endif -################################################################################ - ifneq ($(BUILD_CRYPTO), false) - ifeq ($(call isTargetOs, windows), true) + ############################################################################ + ## Build libw2k_lsa_auth + ############################################################################ + $(eval $(call SetupJdkLibrary, BUILD_LIBW2K_LSA_AUTH, \ NAME := w2k_lsa_auth, \ OPTIMIZATION := LOW, \ - LIBS := advapi32.lib Secur32.lib kernel32.lib ws2_32.lib, \ + LIBS_windows := advapi32.lib kernel32.lib secur32.lib ws2_32.lib, \ )) TARGETS += $(BUILD_LIBW2K_LSA_AUTH) endif ifeq ($(call isTargetOs, macosx), true) + ############################################################################ + ## Build libosxkrb5 + ############################################################################ + # libosxkrb5 needs to call deprecated krb5 APIs so that java # can use the native credentials cache. $(eval $(call SetupJdkLibrary, BUILD_LIBOSXKRB5, \ NAME := osxkrb5, \ OPTIMIZATION := LOW, \ DISABLED_WARNINGS_clang_nativeccache.c := deprecated-declarations, \ - LIBS := -framework Cocoa -framework SystemConfiguration \ - -framework Kerberos, \ + LIBS_macosx := \ + -framework Cocoa \ + -framework Kerberos \ + -framework SystemConfiguration, \ )) TARGETS += $(BUILD_LIBOSXKRB5) endif endif - -################################################################################ diff --git a/make/modules/java.smartcardio/Lib.gmk b/make/modules/java.smartcardio/Lib.gmk index 585eda3a021..7e7b8e5f009 100644 --- a/make/modules/java.smartcardio/Lib.gmk +++ b/make/modules/java.smartcardio/Lib.gmk @@ -25,6 +25,8 @@ include LibCommon.gmk +################################################################################ +## Build libj2pcsc ################################################################################ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2PCSC, \ @@ -37,5 +39,3 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2PCSC, \ )) TARGETS += $(BUILD_LIBJ2PCSC) - -################################################################################ diff --git a/make/modules/jdk.attach/Lib.gmk b/make/modules/jdk.attach/Lib.gmk index 3a863355e78..4298bc80097 100644 --- a/make/modules/jdk.attach/Lib.gmk +++ b/make/modules/jdk.attach/Lib.gmk @@ -25,6 +25,8 @@ include LibCommon.gmk +################################################################################ +## Build libattach ################################################################################ ifeq ($(call isTargetOs, windows), true) @@ -38,13 +40,12 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBATTACH, \ NAME := attach, \ OPTIMIZATION := LOW, \ CFLAGS := $(LIBATTACH_CFLAGS), \ - CFLAGS_windows := /Gy, \ - LIBS := $(JDKLIB_LIBS), \ - LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib psapi.lib, \ + CFLAGS_windows := -Gy, \ + JDK_LIBS := $(JDKLIB_LIBS), \ + JDK_LIBS_windows := $(WIN_JAVA_LIB), \ + LIBS_windows := advapi32.lib psapi.lib, \ )) $(BUILD_LIBATTACH): $(call FindLib, java.base, java) TARGETS += $(BUILD_LIBATTACH) - -################################################################################ diff --git a/make/modules/jdk.compiler/Launcher.gmk b/make/modules/jdk.compiler/Launcher.gmk index 66d24fb4fe6..e80c31bcb18 100644 --- a/make/modules/jdk.compiler/Launcher.gmk +++ b/make/modules/jdk.compiler/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, 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 @@ -25,12 +25,20 @@ include LauncherCommon.gmk +################################################################################ +## Build javac +################################################################################ + $(eval $(call SetupBuildLauncher, javac, \ - MAIN_CLASS := com.sun.tools.javac.Main, \ - JAVA_ARGS := --add-modules ALL-DEFAULT, \ - CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \ + MAIN_CLASS := com.sun.tools.javac.Main, \ + JAVA_ARGS := --add-modules ALL-DEFAULT, \ + CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \ )) +################################################################################ +## Build serialver +################################################################################ + $(eval $(call SetupBuildLauncher, serialver, \ MAIN_CLASS := sun.tools.serialver.SerialVer, \ CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \ diff --git a/make/modules/jdk.crypto.cryptoki/Lib.gmk b/make/modules/jdk.crypto.cryptoki/Lib.gmk index f99aa932843..a71e4f01882 100644 --- a/make/modules/jdk.crypto.cryptoki/Lib.gmk +++ b/make/modules/jdk.crypto.cryptoki/Lib.gmk @@ -25,6 +25,8 @@ include LibCommon.gmk +################################################################################ +## Build libj2pkcs11 ################################################################################ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2PKCS11, \ @@ -35,5 +37,3 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2PKCS11, \ )) TARGETS += $(BUILD_LIBJ2PKCS11) - -################################################################################ diff --git a/make/modules/jdk.crypto.mscapi/Lib.gmk b/make/modules/jdk.crypto.mscapi/Lib.gmk index 66ba6eeb496..f9089258699 100644 --- a/make/modules/jdk.crypto.mscapi/Lib.gmk +++ b/make/modules/jdk.crypto.mscapi/Lib.gmk @@ -25,18 +25,17 @@ include LibCommon.gmk -################################################################################ - ifeq ($(call isTargetOs, windows), true) + ############################################################################## + ## Build libsunmscapi + ############################################################################## $(eval $(call SetupJdkLibrary, BUILD_LIBSUNMSCAPI, \ NAME := sunmscapi, \ OPTIMIZATION := LOW, \ LDFLAGS := $(LDFLAGS_CXX_JDK), \ - LIBS := crypt32.lib advapi32.lib ncrypt.lib, \ + LIBS_windows := advapi32.lib crypt32.lib ncrypt.lib, \ )) TARGETS += $(BUILD_LIBSUNMSCAPI) endif - -################################################################################ diff --git a/make/modules/jdk.hotspot.agent/Launcher.gmk b/make/modules/jdk.hotspot.agent/Launcher.gmk index 76da3600368..94ad08bda0c 100644 --- a/make/modules/jdk.hotspot.agent/Launcher.gmk +++ b/make/modules/jdk.hotspot.agent/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, 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 @@ -25,6 +25,10 @@ include LauncherCommon.gmk +################################################################################ +## Build jhsdb +################################################################################ + $(eval $(call SetupBuildLauncher, jhsdb, \ MAIN_CLASS := sun.jvm.hotspot.SALauncher, \ MACOSX_PRIVILEGED := true, \ diff --git a/make/modules/jdk.hotspot.agent/Lib.gmk b/make/modules/jdk.hotspot.agent/Lib.gmk index 688899cb12b..326536878c9 100644 --- a/make/modules/jdk.hotspot.agent/Lib.gmk +++ b/make/modules/jdk.hotspot.agent/Lib.gmk @@ -25,36 +25,37 @@ include LibCommon.gmk +################################################################################ +## Build libsaproc ################################################################################ ifeq ($(call isTargetOs, macosx), true) - SA_CFLAGS := -D_GNU_SOURCE -mno-omit-leaf-frame-pointer \ + LIBSAPROC_CFLAGS := -D_GNU_SOURCE -mno-omit-leaf-frame-pointer \ -mstack-alignment=16 -fPIC - LIBSA_EXTRA_SRC := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent + LIBSAPROC_EXTRA_SRC := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent else ifeq ($(call isTargetOs, windows), true) - SA_CFLAGS := -D_WINDOWS -D_DEBUG -D_CONSOLE -EHsc + LIBSAPROC_CFLAGS := -D_WINDOWS -D_DEBUG -D_CONSOLE -EHsc ifeq ($(call isTargetCpu, x86_64), true) - SA_CXXFLAGS := -DWIN64 + LIBSAPROC_CXXFLAGS := -DWIN64 else # Only add /RTC1 flag for debug builds as it's # incompatible with release type builds. See # https://msdn.microsoft.com/en-us/library/8wtf2dfz.aspx - ifeq ($(DEBUG_LEVEL),slowdebug) - SA_CXXFLAGS := -RTC1 + ifeq ($(DEBUG_LEVEL), slowdebug) + LIBSAPROC_CXXFLAGS := -RTC1 endif endif endif -SA_LINK_TYPE := C ifeq ($(call isTargetOs, linux), true) - SA_LINK_TYPE := C++ + LIBSAPROC_LINK_TYPE := C++ +else + LIBSAPROC_LINK_TYPE := C endif -################################################################################ - -$(eval $(call SetupJdkLibrary, BUILD_LIBSA, \ +$(eval $(call SetupJdkLibrary, BUILD_LIBSAPROC, \ NAME := saproc, \ - LINK_TYPE := $(SA_LINK_TYPE), \ + LINK_TYPE := $(LIBSAPROC_LINK_TYPE), \ OPTIMIZATION := HIGH, \ DISABLED_WARNINGS_gcc := sign-compare, \ DISABLED_WARNINGS_gcc_ps_core.c := pointer-arith, \ @@ -62,16 +63,18 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBSA, \ DISABLED_WARNINGS_clang := sign-compare, \ DISABLED_WARNINGS_clang_libproc_impl.c := format-nonliteral, \ DISABLED_WARNINGS_clang_sadis.c := format-nonliteral, \ - CFLAGS := $(SA_CFLAGS), \ - CXXFLAGS := $(SA_CFLAGS) $(SA_CXXFLAGS), \ - EXTRA_SRC := $(LIBSA_EXTRA_SRC), \ - LIBS_unix := -ljava, \ + CFLAGS := $(LIBSAPROC_CFLAGS), \ + CXXFLAGS := $(LIBSAPROC_CFLAGS) $(LIBSAPROC_CXXFLAGS), \ + EXTRA_SRC := $(LIBSAPROC_EXTRA_SRC), \ + JDK_LIBS_unix := -ljava, \ + JDK_LIBS_windows := $(WIN_JAVA_LIB), \ LIBS_linux := $(LIBDL), \ - LIBS_macosx := -framework Foundation \ - -framework JavaRuntimeSupport -framework Security -framework CoreFoundation, \ - LIBS_windows := dbgeng.lib $(WIN_JAVA_LIB), \ + LIBS_macosx := \ + -framework CoreFoundation \ + -framework Foundation \ + -framework JavaRuntimeSupport \ + -framework Security, \ + LIBS_windows := dbgeng.lib, \ )) -TARGETS += $(BUILD_LIBSA) - -################################################################################ +TARGETS += $(BUILD_LIBSAPROC) diff --git a/make/modules/jdk.httpserver/Launcher.gmk b/make/modules/jdk.httpserver/Launcher.gmk index ead28ba1ca5..0f0c060e6e3 100644 --- a/make/modules/jdk.httpserver/Launcher.gmk +++ b/make/modules/jdk.httpserver/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2021, 2024, 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 @@ -25,6 +25,10 @@ include LauncherCommon.gmk +################################################################################ +## Build jwebserver +################################################################################ + $(eval $(call SetupBuildLauncher, jwebserver, \ MAIN_CLASS := sun.net.httpserver.simpleserver.JWebServer, \ )) diff --git a/make/modules/jdk.incubator.vector/Lib.gmk b/make/modules/jdk.incubator.vector/Lib.gmk index 58121d5287d..0620549f05c 100644 --- a/make/modules/jdk.incubator.vector/Lib.gmk +++ b/make/modules/jdk.incubator.vector/Lib.gmk @@ -25,6 +25,8 @@ include LibCommon.gmk +################################################################################ +## Build libjsvml ################################################################################ ifeq ($(call isTargetOs, linux windows)+$(call isTargetCpu, x86_64)+$(INCLUDE_COMPILER2), true+true+true) @@ -35,5 +37,3 @@ ifeq ($(call isTargetOs, linux windows)+$(call isTargetCpu, x86_64)+$(INCLUDE_CO TARGETS += $(BUILD_LIBJSVML) endif - -################################################################################ diff --git a/make/modules/jdk.internal.le/Lib.gmk b/make/modules/jdk.internal.le/Lib.gmk index 94644133f6a..8c04107e0f5 100644 --- a/make/modules/jdk.internal.le/Lib.gmk +++ b/make/modules/jdk.internal.le/Lib.gmk @@ -25,21 +25,19 @@ include LibCommon.gmk -################################################################################ - -ifeq ($(call isTargetOs, linux macosx windows), true) +ifeq ($(call isTargetOs, aix), false) + ############################################################################## + ## Build lible + ############################################################################## $(eval $(call SetupJdkLibrary, BUILD_LIBLE, \ NAME := le, \ LINK_TYPE := C++, \ OPTIMIZATION := LOW, \ LD_SET_ORIGIN := false, \ - LIBS_unix := $(JDKLIB_LIBS), \ - LIBS_windows := $(JDKLIB_LIBS) user32.lib, \ + JDK_LIBS := $(JDKLIB_LIBS), \ + LIBS_windows := user32.lib, \ )) TARGETS += $(BUILD_LIBLE) - endif - -################################################################################ diff --git a/make/modules/jdk.jartool/Launcher.gmk b/make/modules/jdk.jartool/Launcher.gmk index f74e82bfdae..3139fac45d5 100644 --- a/make/modules/jdk.jartool/Launcher.gmk +++ b/make/modules/jdk.jartool/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2024, 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 @@ -25,10 +25,18 @@ include LauncherCommon.gmk +################################################################################ +## Build jar +################################################################################ + $(eval $(call SetupBuildLauncher, jar, \ MAIN_CLASS := sun.tools.jar.Main, \ )) +################################################################################ +## Build jarsigner +################################################################################ + $(eval $(call SetupBuildLauncher, jarsigner, \ MAIN_CLASS := sun.security.tools.jarsigner.Main, \ )) diff --git a/make/modules/jdk.javadoc/Launcher.gmk b/make/modules/jdk.javadoc/Launcher.gmk index 889028a2b17..30d714be30d 100644 --- a/make/modules/jdk.javadoc/Launcher.gmk +++ b/make/modules/jdk.javadoc/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, 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 @@ -25,6 +25,10 @@ include LauncherCommon.gmk +################################################################################ +## Build javadoc +################################################################################ + $(eval $(call SetupBuildLauncher, javadoc, \ MAIN_CLASS := jdk.javadoc.internal.tool.Main, \ JAVA_ARGS := --add-modules ALL-DEFAULT, \ diff --git a/make/modules/jdk.jcmd/Launcher.gmk b/make/modules/jdk.jcmd/Launcher.gmk index 0f171502fe4..acff5a212c5 100644 --- a/make/modules/jdk.jcmd/Launcher.gmk +++ b/make/modules/jdk.jcmd/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, 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 @@ -25,6 +25,10 @@ include LauncherCommon.gmk +################################################################################ +## Build jinfo +################################################################################ + $(eval $(call SetupBuildLauncher, jinfo, \ MAIN_CLASS := sun.tools.jinfo.JInfo, \ JAVA_ARGS := \ @@ -33,6 +37,10 @@ $(eval $(call SetupBuildLauncher, jinfo, \ MACOSX_PRIVILEGED := true, \ )) +################################################################################ +## Build jmap +################################################################################ + $(eval $(call SetupBuildLauncher, jmap, \ MAIN_CLASS := sun.tools.jmap.JMap, \ JAVA_ARGS := \ @@ -41,10 +49,18 @@ $(eval $(call SetupBuildLauncher, jmap, \ MACOSX_PRIVILEGED := true, \ )) +################################################################################ +## Build jps +################################################################################ + $(eval $(call SetupBuildLauncher, jps, \ MAIN_CLASS := sun.tools.jps.Jps, \ )) +################################################################################ +## Build jstack +################################################################################ + $(eval $(call SetupBuildLauncher, jstack, \ MAIN_CLASS := sun.tools.jstack.JStack, \ JAVA_ARGS := \ @@ -53,10 +69,18 @@ $(eval $(call SetupBuildLauncher, jstack, \ MACOSX_PRIVILEGED := true, \ )) +################################################################################ +## Build jstat +################################################################################ + $(eval $(call SetupBuildLauncher, jstat, \ MAIN_CLASS := sun.tools.jstat.Jstat, \ )) +################################################################################ +## Build jcmd +################################################################################ + $(eval $(call SetupBuildLauncher, jcmd, \ MAIN_CLASS := sun.tools.jcmd.JCmd, \ )) diff --git a/make/modules/jdk.jconsole/Launcher.gmk b/make/modules/jdk.jconsole/Launcher.gmk index 9b19dcdc0e5..3e65c3cccc3 100644 --- a/make/modules/jdk.jconsole/Launcher.gmk +++ b/make/modules/jdk.jconsole/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, 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 @@ -25,11 +25,16 @@ include LauncherCommon.gmk +################################################################################ +## Build jconsole +################################################################################ + $(eval $(call SetupBuildLauncher, jconsole, \ MAIN_CLASS := sun.tools.jconsole.JConsole, \ - JAVA_ARGS := --add-opens java.base/java.io=jdk.jconsole \ - --add-modules ALL-DEFAULT \ - -Djconsole.showOutputViewer \ - -Djdk.attach.allowAttachSelf=true, \ + JAVA_ARGS := \ + --add-opens java.base/java.io=jdk.jconsole \ + --add-modules ALL-DEFAULT \ + -Djconsole.showOutputViewer \ + -Djdk.attach.allowAttachSelf=true, \ CFLAGS_windows := -DJAVAW, \ )) diff --git a/make/modules/jdk.jdeps/Launcher.gmk b/make/modules/jdk.jdeps/Launcher.gmk index 9d7d3515fc2..628b0cd5589 100644 --- a/make/modules/jdk.jdeps/Launcher.gmk +++ b/make/modules/jdk.jdeps/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2024, 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 @@ -27,16 +27,28 @@ include LauncherCommon.gmk DISABLED_WARNINGS_java += this-escape +################################################################################ +## Build javap +################################################################################ + $(eval $(call SetupBuildLauncher, javap, \ MAIN_CLASS := com.sun.tools.javap.Main, \ CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \ )) +################################################################################ +## Build jdeps +################################################################################ + $(eval $(call SetupBuildLauncher, jdeps, \ MAIN_CLASS := com.sun.tools.jdeps.Main, \ CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \ )) +################################################################################ +## Build jdeprscan +################################################################################ + $(eval $(call SetupBuildLauncher, jdeprscan, \ MAIN_CLASS := com.sun.tools.jdeprscan.Main, \ CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \ diff --git a/make/modules/jdk.jdi/Launcher.gmk b/make/modules/jdk.jdi/Launcher.gmk index fcce98cf430..79be72e6ef3 100644 --- a/make/modules/jdk.jdi/Launcher.gmk +++ b/make/modules/jdk.jdi/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, 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 @@ -25,6 +25,10 @@ include LauncherCommon.gmk +################################################################################ +## Build jdb +################################################################################ + $(eval $(call SetupBuildLauncher, jdb, \ MAIN_CLASS := com.sun.tools.example.debug.tty.TTY, \ )) diff --git a/make/modules/jdk.jdi/Lib.gmk b/make/modules/jdk.jdi/Lib.gmk index f59ec8ca201..8c620bf90e2 100644 --- a/make/modules/jdk.jdi/Lib.gmk +++ b/make/modules/jdk.jdi/Lib.gmk @@ -25,9 +25,10 @@ include LibCommon.gmk -################################################################################ - ifeq ($(call isTargetOs, windows), true) + ############################################################################## + ## Build libdt_shmem + ############################################################################## $(eval $(call SetupJdkLibrary, BUILD_LIBDT_SHMEM, \ NAME := dt_shmem, \ @@ -35,11 +36,8 @@ ifeq ($(call isTargetOs, windows), true) EXTRA_HEADER_DIRS := \ jdk.jdwp.agent:include \ jdk.jdwp.agent:libjdwp/export, \ - LIBS := $(JDKLIB_LIBS), \ + JDK_LIBS := $(JDKLIB_LIBS), \ )) TARGETS += $(BUILD_LIBDT_SHMEM) - endif - -################################################################################ diff --git a/make/modules/jdk.jdwp.agent/Lib.gmk b/make/modules/jdk.jdwp.agent/Lib.gmk index 5b516808875..17735dfe3d7 100644 --- a/make/modules/jdk.jdwp.agent/Lib.gmk +++ b/make/modules/jdk.jdwp.agent/Lib.gmk @@ -25,6 +25,8 @@ include LibCommon.gmk +################################################################################ +## Build libdt_socket ################################################################################ $(eval $(call SetupJdkLibrary, BUILD_LIBDT_SOCKET, \ @@ -35,7 +37,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBDT_SOCKET, \ include \ libjdwp/export, \ LIBS_linux := -lpthread, \ - LIBS_windows := $(JDKLIB_LIBS) ws2_32.lib iphlpapi.lib, \ + LIBS_windows := iphlpapi.lib ws2_32.lib, \ )) $(BUILD_LIBDT_SOCKET): $(call FindLib, java.base, java) @@ -43,6 +45,8 @@ $(BUILD_LIBDT_SOCKET): $(call FindLib, java.base, java) # Include socket transport with JDWP agent to allow for remote debugging TARGETS += $(BUILD_LIBDT_SOCKET) +################################################################################ +## Build libjdwp ################################################################################ # JDWP_LOGGING causes log messages to be compiled into the library. @@ -56,9 +60,9 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \ DISABLED_WARNINGS_clang_inStream.c := sometimes-uninitialized, \ DISABLED_WARNINGS_clang_log_messages.c := format-nonliteral, \ EXTRA_HEADER_DIRS := \ - include \ - libjdwp/export, \ - LIBS := $(JDKLIB_LIBS), \ + include \ + libjdwp/export, \ + JDK_LIBS := $(JDKLIB_LIBS), \ LIBS_linux := $(LIBDL), \ LIBS_macosx := -liconv, \ LIBS_aix := -liconv, \ @@ -69,13 +73,15 @@ $(BUILD_LIBJDWP): $(call FindLib, java.base, java) TARGETS += $(BUILD_LIBJDWP) ################################################################################ +# Setup static build symbols ifeq ($(STATIC_BUILD), true) + STATIC_SYMBOLS_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent JDK_JDWP_AGENT_EXPORT_SYMBOLS_SRC := \ - $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/$(LIBRARY_PREFIX)dt_socket.symbols \ - $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/$(LIBRARY_PREFIX)jdwp.symbols + $(STATIC_SYMBOLS_DIR)/$(LIBRARY_PREFIX)dt_socket.symbols \ + $(STATIC_SYMBOLS_DIR)/$(LIBRARY_PREFIX)jdwp.symbols - JDK_JDWP_AGENT_EXPORT_SYMBOL_FILE := $(SUPPORT_OUTPUTDIR)/modules_libs/jdk.jdwp.agent/jdk.jdwp.agent.symbols + JDK_JDWP_AGENT_EXPORT_SYMBOL_FILE := $(STATIC_SYMBOLS_DIR)/jdk.jdwp.agent.symbols $(JDK_JDWP_AGENT_EXPORT_SYMBOL_FILE): $(JDK_JDWP_AGENT_EXPORT_SYMBOLS_SRC) $(call LogInfo, Generating jdk.jdwp.agent symbols file) @@ -85,7 +91,4 @@ ifeq ($(STATIC_BUILD), true) $(JDK_JDWP_AGENT_EXPORT_SYMBOLS_SRC): $(BUILD_LIBDT_SOCKET) $(BUILD_LIBJDWP) TARGETS += $(JDK_JDWP_AGENT_EXPORT_SYMBOL_FILE) - endif - -################################################################################ diff --git a/make/modules/jdk.jfr/Launcher.gmk b/make/modules/jdk.jfr/Launcher.gmk index f2d504ac373..2dd3586a920 100644 --- a/make/modules/jdk.jfr/Launcher.gmk +++ b/make/modules/jdk.jfr/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2024, 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 @@ -25,6 +25,10 @@ include LauncherCommon.gmk +################################################################################ +## Build jfr +################################################################################ + $(eval $(call SetupBuildLauncher, jfr, \ MAIN_CLASS := jdk.jfr.internal.tool.Main, \ CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \ diff --git a/make/modules/jdk.jlink/Launcher.gmk b/make/modules/jdk.jlink/Launcher.gmk index df2173996d7..f0543ef73b8 100644 --- a/make/modules/jdk.jlink/Launcher.gmk +++ b/make/modules/jdk.jlink/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2024, 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 @@ -25,20 +25,30 @@ include LauncherCommon.gmk +################################################################################ +## Build jimage +################################################################################ + $(eval $(call SetupBuildLauncher, jimage,\ MAIN_CLASS := jdk.tools.jimage.Main, \ CFLAGS := -DENABLE_ARG_FILES, \ )) +################################################################################ +## Build jlink +################################################################################ + $(eval $(call SetupBuildLauncher, jlink,\ MAIN_CLASS := jdk.tools.jlink.internal.Main, \ - JAVA_ARGS := --add-modules ALL-DEFAULT, \ - CFLAGS := -DENABLE_ARG_FILES \ - -DEXPAND_CLASSPATH_WILDCARDS, \ + JAVA_ARGS := --add-modules ALL-DEFAULT, \ + CFLAGS := -DENABLE_ARG_FILES -DEXPAND_CLASSPATH_WILDCARDS, \ )) +################################################################################ +## Build jmod +################################################################################ + $(eval $(call SetupBuildLauncher, jmod,\ MAIN_CLASS := jdk.tools.jmod.Main, \ - CFLAGS := -DENABLE_ARG_FILES \ - -DEXPAND_CLASSPATH_WILDCARDS, \ + CFLAGS := -DENABLE_ARG_FILES -DEXPAND_CLASSPATH_WILDCARDS, \ )) diff --git a/make/modules/jdk.jpackage/Launcher.gmk b/make/modules/jdk.jpackage/Launcher.gmk index 8d553d5c107..f80c4ed83d3 100644 --- a/make/modules/jdk.jpackage/Launcher.gmk +++ b/make/modules/jdk.jpackage/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2024, 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 @@ -25,6 +25,10 @@ include LauncherCommon.gmk +################################################################################ +## Build jpackage +################################################################################ + $(eval $(call SetupBuildLauncher, jpackage, \ MAIN_CLASS := jdk.jpackage.main.Main, \ )) diff --git a/make/modules/jdk.jshell/Launcher.gmk b/make/modules/jdk.jshell/Launcher.gmk index 349eb88e9eb..bf555d7f64c 100644 --- a/make/modules/jdk.jshell/Launcher.gmk +++ b/make/modules/jdk.jshell/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, 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 @@ -25,6 +25,10 @@ include LauncherCommon.gmk +################################################################################ +## Build jshell +################################################################################ + $(eval $(call SetupBuildLauncher, jshell, \ MAIN_CLASS := jdk.internal.jshell.tool.JShellToolProvider, \ CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \ diff --git a/make/modules/jdk.jstatd/Launcher.gmk b/make/modules/jdk.jstatd/Launcher.gmk index 2137fddd9a0..209b810353f 100644 --- a/make/modules/jdk.jstatd/Launcher.gmk +++ b/make/modules/jdk.jstatd/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, 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 @@ -25,6 +25,10 @@ include LauncherCommon.gmk +################################################################################ +## Build jstatd +################################################################################ + $(eval $(call SetupBuildLauncher, jstatd, \ MAIN_CLASS := sun.tools.jstatd.Jstatd, \ )) diff --git a/make/modules/jdk.management.agent/Lib.gmk b/make/modules/jdk.management.agent/Lib.gmk index 59e7e07c182..7a578adc301 100644 --- a/make/modules/jdk.management.agent/Lib.gmk +++ b/make/modules/jdk.management.agent/Lib.gmk @@ -25,17 +25,18 @@ include LibCommon.gmk +################################################################################ +## Build libmanagement_agent ################################################################################ $(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT_AGENT, \ NAME := management_agent, \ OPTIMIZATION := LOW, \ - LIBS := $(JDKLIB_LIBS), \ - LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib, \ + JDK_LIBS := $(JDKLIB_LIBS), \ + JDK_LIBS_windows := $(WIN_JAVA_LIB), \ + LIBS_windows := advapi32.lib, \ )) $(BUILD_LIBMANAGEMENT_AGENT): $(call FindLib, java.base, java) TARGETS += $(BUILD_LIBMANAGEMENT_AGENT) - -################################################################################ diff --git a/make/modules/jdk.management/Lib.gmk b/make/modules/jdk.management/Lib.gmk index 9aaf526c84f..3f1ce5262f5 100644 --- a/make/modules/jdk.management/Lib.gmk +++ b/make/modules/jdk.management/Lib.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2024, 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,14 +31,12 @@ ifeq ($(call isTargetOs, windows), true) # In (at least) VS2013 and later, -DPSAPI_VERSION=1 is needed to generate # a binary that is compatible with windows versions older than 7/2008R2. # See MSDN documentation for GetProcessMemoryInfo for more information. - LIBMANAGEMENT_EXT_CFLAGS += -DPSAPI_VERSION=1 + LIBMANAGEMENT_EXT_CFLAGS := -DPSAPI_VERSION=1 endif LIBMANAGEMENT_EXT_OPTIMIZATION := HIGH -ifeq ($(call isTargetOs, linux), true) - ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true) - LIBMANAGEMENT_EXT_OPTIMIZATION := LOW - endif +ifeq ($(call isTargetOs, linux)+$(COMPILE_WITH_DEBUG_SYMBOLS), true+true) + LIBMANAGEMENT_EXT_OPTIMIZATION := LOW endif $(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT_EXT, \ @@ -46,9 +44,10 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT_EXT, \ OPTIMIZATION := $(LIBMANAGEMENT_EXT_OPTIMIZATION), \ DISABLED_WARNINGS_clang_UnixOperatingSystem.c := format-nonliteral, \ CFLAGS := $(CFLAGS_JDKLIB) $(LIBMANAGEMENT_EXT_CFLAGS), \ - LIBS := $(JDKLIB_LIBS), \ + JDK_LIBS := $(JDKLIB_LIBS), \ + JDK_LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \ LIBS_aix := -lperfstat,\ - LIBS_windows := jvm.lib psapi.lib $(WIN_JAVA_LIB) advapi32.lib, \ + LIBS_windows := advapi32.lib psapi.lib, \ )) $(BUILD_LIBMANAGEMENT_EXT): $(call FindLib, java.base, java) diff --git a/make/modules/jdk.net/Lib.gmk b/make/modules/jdk.net/Lib.gmk index 359992a4588..a0a9aff8cb8 100644 --- a/make/modules/jdk.net/Lib.gmk +++ b/make/modules/jdk.net/Lib.gmk @@ -26,20 +26,18 @@ include LibCommon.gmk ################################################################################ - -ifeq ($(call isTargetOs, linux macosx windows aix), true) - - $(eval $(call SetupJdkLibrary, BUILD_LIBEXTNET, \ - NAME := extnet, \ - OPTIMIZATION := LOW, \ - LIBS_unix := -ljava, \ - LIBS_linux := -ljvm, \ - LIBS_windows := jvm.lib ws2_32.lib $(WIN_JAVA_LIB), \ - )) - - $(BUILD_LIBEXTNET): $(call FindLib, java.base, java) - - TARGETS += $(BUILD_LIBEXTNET) -endif - +## Build libextnet ################################################################################ + +$(eval $(call SetupJdkLibrary, BUILD_LIBEXTNET, \ + NAME := extnet, \ + OPTIMIZATION := LOW, \ + JDK_LIBS_unix := -ljava, \ + JDK_LIBS_linux := -ljvm, \ + JDK_LIBS_windows := $(WIN_JAVA_LIB) jvm.lib, \ + LIBS_windows := ws2_32.lib, \ +)) + +$(BUILD_LIBEXTNET): $(call FindLib, java.base, java) + +TARGETS += $(BUILD_LIBEXTNET) diff --git a/make/modules/jdk.sctp/Lib.gmk b/make/modules/jdk.sctp/Lib.gmk index 2edd6b60517..ab68fe93bb0 100644 --- a/make/modules/jdk.sctp/Lib.gmk +++ b/make/modules/jdk.sctp/Lib.gmk @@ -26,25 +26,22 @@ include LibCommon.gmk ################################################################################ - -ifeq ($(call isTargetOsType, unix), true) - - ifeq ($(call isTargetOs, macosx aix), false) - $(eval $(call SetupJdkLibrary, BUILD_LIBSCTP, \ - NAME := sctp, \ - OPTIMIZATION := LOW, \ - EXTRA_HEADER_DIRS := \ - $(call GetJavaHeaderDir, java.base) \ - java.base:libnet \ - java.base:libnio/ch, \ - LIBS_unix := -lnio -lnet -ljava -ljvm, \ - LIBS_linux := -lpthread $(LIBDL), \ - )) - - TARGETS += $(BUILD_LIBSCTP) - - $(BUILD_LIBSCTP): $(call FindLib, java.base, nio) - endif -endif - +## Build libsctp ################################################################################ + +ifeq ($(call isTargetOs, linux), true) + $(eval $(call SetupJdkLibrary, BUILD_LIBSCTP, \ + NAME := sctp, \ + OPTIMIZATION := LOW, \ + EXTRA_HEADER_DIRS := \ + $(call GetJavaHeaderDir, java.base) \ + java.base:libnet \ + java.base:libnio/ch, \ + JDK_LIBS_unix := -ljava -ljvm -lnet -lnio, \ + LIBS_linux := $(LIBDL) -lpthread, \ + )) + + TARGETS += $(BUILD_LIBSCTP) + + $(BUILD_LIBSCTP): $(call FindLib, java.base, nio) +endif diff --git a/make/modules/jdk.security.auth/Lib.gmk b/make/modules/jdk.security.auth/Lib.gmk index 70dfde1edb7..dad60be2376 100644 --- a/make/modules/jdk.security.auth/Lib.gmk +++ b/make/modules/jdk.security.auth/Lib.gmk @@ -25,16 +25,16 @@ include LibCommon.gmk +################################################################################ +## Build libjaas ################################################################################ $(eval $(call SetupJdkLibrary, BUILD_LIBJAAS, \ NAME := jaas, \ OPTIMIZATION := LOW, \ - LIBS_windows := netapi32.lib user32.lib mpr.lib advapi32.lib $(JDKLIB_LIBS), \ + LIBS_windows := advapi32.lib mpr.lib netapi32.lib user32.lib, \ )) $(BUILD_LIBJAAS): $(call FindLib, java.base, java) TARGETS += $(BUILD_LIBJAAS) - -################################################################################